eblondel / cleangeo

Cleaning geometries from spatial objects in R

Home Page:https://github.com/eblondel/cleangeo/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error with countriesLow

mdsumner opened this issue · comments

I get this in 0.1-0

library(rworldmap)
data(countriesLow)
library(cleangeo)
x <- clgeo_Clean(countriesLow)
Error in SpatialPolygonsDataFrame(Sr = fixed.sp, data = as(sp, "data.frame")) :
row.names of data and Polygons IDs do not match

Thanks! (I'll explore more when I have a chance).

Thanks @mdsumner i will have a look later today and report to you asap

Fixed.

For testing, you will need to install again cleangeo from Github doing:

require(devtools)
install_github("eblondel/cleangeo")

Then you can test it:

library(rworldmap)
data(countriesLow)

#inspect input data
sp <- countriesLow
report <- clgeo_CollectionReport(sp)
clgeo_SummaryReport(report)

#fix the geometries & inspect again
sp.fixed <- clgeo_Clean(sp)
report.fixed <- clgeo_CollectionReport(sp.fixed)
clgeo_SummaryReport(report.fixed)

The fix has been released in cleangeo 0.1-1 and now in CRAN. Closing the ticket.