What the following error means: Topology Exception: An unexpanded intersection between LINESTRING was detected

I am trying to consolidate a form file that I loaded into R using 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 form file for the continent of Africa with 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 that I mentioned earlier. I believe that R has some problems with the polygon - is there a way around this?

+4
source share
1 answer

As you can see from the comments, mdsumner and agstudy were able to answer why this is happening, although agstudy was not able to recreate it with an accessible dataset. I found a job around this problem.

 library(rgdal) library(rgeos) library(ggplot2) #LOADING IN DATA africa = readOGR("directory", layer="filename") #FIXING THE NON-NODED INTERSECTS# africa = gBuffer(africa, width=0, byid=TRUE) africa.map = fortify(africa, region="ID") 
+6
source

All Articles