eblondel / cleangeo

Cleaning geometries from spatial objects in R
https://github.com/eblondel/cleangeo/wiki
45 stars 2 forks source link

error with countriesLow #7

Closed mdsumner closed 9 years ago

mdsumner commented 9 years ago

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).

eblondel commented 9 years ago

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

eblondel commented 9 years ago

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)
eblondel commented 9 years ago

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