1

I am using newobj <- nowrapRecenter(obj), from the package maptools to recenter a SpatialPolygonsDataFrame such that longitude runs 0 - 360 (pacific view) rather than -180 to 180 (Atlantic view). Unfortunately, the resulting newobj is a SpatialPolygon only --- the data is lost. I expect I can merge the data back on, but I'm not sure how... generally I would merge by a data column, and this new polygon has no data.

I am using this GEOLEV1 shapefile:

https://international.ipums.org/international/gis_harmonized_1st.shtml

1 Answer 1

1

Everything should be ordered so, it is probably as simple as coercing back to a SpatialPolygonsDataFrame object. Say y is the original data and x is the new SpatialPolygons object you could try: new <- SpatialPolygonsDataFrame(x, y@data)

2
  • Thanks! You're so right, that works perfectly. Thanks a ton, I really appreciate it. : )
    – Leah Bevis
    Commented Sep 16, 2016 at 18:51
  • @LeahBevis, if this answer was helpful to you, then upvote it. If it solved your question, then accept it (green checkmark under the vote arrows). See: gis.stackexchange.com/help/someone-answers. Tks. Commented Apr 1, 2019 at 1:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.