eblondel / cleangeo

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

rgeos warning #18

Closed DerekYves closed 1 year ago

DerekYves commented 7 years ago

Hi again! There's a number of moving parts between the last time I submitted a bug report (new R versions, sp updates, and new versions of your package), but I'm no longer able to clean the same shape file I was working with. It used to complete in seconds, but I'm getting errors such as the following in the verbose output of clgeo_Clean:

[cleangeo][INFO] Catched RGEOS warning 'simpleWarning in RGEOSUnaryPredFunc(spgeom, byid, "rgeos_isvalid"): Ring Self-intersection at or near point -2884367.4982672399 3537417.1548343902
' 
[cleangeo][INFO] Catched RGEOS warning 'simpleWarning in RGEOSUnaryPredFunc(spgeom, byid, "rgeos_isvalid"): Ring Self-intersection at or near point -2258215.72911544 2346387.0472559901
' 

The summary and isValid outout for this shapefile are:

> clgeo_SummaryReport(report)
             type      valid                 issue_type
 rgeos_validity: 8   Mode :logical   GEOM_VALIDITY: 8  
 NA's          :91   FALSE:8         NA's         :91  
                     TRUE :91                          
                     NA's :0                           
> clgeo_IsValid(tec_rx_laea_raw, verbose=TRUE)
[cleangeo][INFO] Catched RGEOS warning 'simpleWarning in RGEOSUnaryPredFunc(spgeom, byid, "rgeos_isvalid"): Ring Self-intersection at or near point -2884367.4982672399 3537417.1548343902
' 
[1] FALSE

Happy to provide you with a copy of the shape file off line if you have time to look at it. Would it be advisable to revert to the "buffer" strategy? With this method it completes in the "normal" amount of time with this output:

[cleangeo][INFO] Cleaning geometry at index 2 (Ring Self-intersection at or near point -2884367.4982672399 3537417.1548343902) 
[cleangeo][INFO] Cleaning geometry at index 18 (Self-intersection at or near point 2113533.1055950201 -820989.46085422998) 
[cleangeo][INFO] Cleaning geometry at index 36 (Self-intersection at or near point 2201242.5476380899 -122464.20489261999) 
[cleangeo][INFO] Cleaning geometry at index 48 (Self-intersection at or near point -663318.71329095995 -1008727.5029289901) 
[cleangeo][INFO] Cleaning geometry at index 51 (Ring Self-intersection at or near point 2305334.6818985799 211472.93414217001) 
[cleangeo][INFO] Cleaning geometry at index 69 (Ring Self-intersection at or near point -764312.57034562004 -1104824.43560423) 
[cleangeo][INFO] Cleaning geometry at index 78 (Self-intersection at or near point 1783130.8072641599 -1814850.07555165) 
[cleangeo][INFO] Cleaning geometry at index 94 (Self-intersection at or near point 795575.92022841994 -1689707.2803640501) 

All the best, Derek

PS: Possibly of note, this shape file has the following Albers-type CRS:

CRS("+proj=laea +lat_0=45 +lon_0=-100 +x_0=0 +y_0=0 +a=6370997 +b=6370997 +units=m +no_defs")

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/40069385-regeos-warning?utm_campaign=plugin&utm_content=tracker%2F6407602&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F6407602&utm_medium=issues&utm_source=github).
eblondel commented 7 years ago

Send me a shapefile, i will have a look as soon as i can.

About the strategy, in previous versions of cleangeo, the cleaning was limited to "buffer" method, but this method is very limited and rough to clean geometries, and doesn't allow to clean many cases of geometry invalidity without altering a lot the initial shapes. The "polygonation" strategy is slower but is a more advanced method and behind it guarantees better cleaning of geometries without altering the initial shapes. The more geometry issues you have in your data, and the higher is the data resolution, the longer will be the cleaning process.

Le 14/12/2016 à 20:22, Derek Darves a écrit :

Reopened #18 https://github.com/eblondel/cleangeo/issues/18.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/eblondel/cleangeo/issues/18#event-894157843, or mute the thread https://github.com/notifications/unsubscribe-auth/ABQ1bBCg6hOruAW6dcbN25UdlyHTiSvpks5rIEH9gaJpZM4LNTdA.

eblondel commented 7 years ago

send the shapefile to my email address

eblondel commented 1 year ago

rgeos is not used anymore as it is going to be archived in Oct 2023