I'm trying to fortify a shape file that I loaded into R with rgdal, but I get the following error:
"Error: TopologyException: found non-noded intersection between LINESTRING
(34.7279 1.59723, 34.7278 1.59729) and LINESTRING
(34.7278 1.59723, 34.7278 1.59729) at 34.727793021883102 1.5972887049072426"
I am using a shape file for the continent of Africa from maplibrary.org. It is available from my dropbox here: https://www.dropbox.com/s/etqdw3nky52czv4/Africa%20map.zip
I am using the following code:
library(rgdal)
library(ggplot2)
africa = readOGR("Africa_SHP", layer = "Africa")
africa.map = fortify(africa, region="COUNTRY")
And I get the error I mentioned before. I take it that R has some problems with the polygon - is there a way around this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…