0

I tried to reproduce a recent question on spatial data visualization using ggplot2 and received the following error message during fortify(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?

1

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

world <- spTransform(world, CRS("+proj=robin"))
  • So it's simply the projection that is not suited for world-wide data? – fdetsch May 10 '15 at 7:33
  • 1
    As far as I can tell it's the Robinson projection which is suitable for mapping the world: en.wikipedia.org/wiki/Robinson_projection I suspect transforming the polygons is causing overlap – Phil May 10 '15 at 8:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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