More

TopologyException error during fortify SpatialPolygonsDataFrame

TopologyException error during fortify SpatialPolygonsDataFrame


I tried to reproduce a recent question on spatial data visualization using ggplot2 and received the following error message duringfortify(world, region = "ISO3"):

Error: TopologyException: Input geom 0 is invalid: Self-intersection at or near point 3980740.7660219339 4277735.2740812832 at 3980740.7660219339 4277735.2740812832

Any ideas on that?


As per my comment in that question, it's to do with thespTransform. Simply remove the offending line:

world <- spTransform(world, CRS("+proj=robin"))

Watch the video: How to combine shapefiles in ArcGis