Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pprepair hangs on this geometry #54

Open
ldemaz opened this issue Mar 25, 2018 · 2 comments
Open

pprepair hangs on this geometry #54

ldemaz opened this issue Mar 25, 2018 · 2 comments
Assignees

Comments

@ldemaz
Copy link

ldemaz commented Mar 25, 2018

Hello, we have encountered a problem with this geometry. It has 6 polygons, with 1 and 2 duplicated. When we run

./pprepair -i polys.shp -o polys_fix.shp -fix

pprepair hangs and has to be aborted. Some testing reveals that the problem lies with option -rrrn. Every other option results in a solution, albeit one that kills polygons 4 and 5 (which seem valid, shown here in red).

We have built pprepair to output to .shp (because of an existing workflow) rather than geojson, and are using it with gdal 2.2.3.

Any thoughts on why this is hanging? Thanks

@ldemaz
Copy link
Author

ldemaz commented Mar 30, 2018

As an update, I can confirm hanging on another geometry also. This is a multipolygon that first went through prepair (fixing a self-intersection).

Pre-prepair:

POLYGON((30.6412432373056 -22.3588451355342,30.6418011367807 -22.3588451355342,30.641672390748 -22.3591240852718,30.640942829896 -22.3590382545833,30.6411788642893 -22.3583086937312,30.6413934410105 -22.3585018127803,30.6410501182566 -22.3585876434688,30.6412432373056 -22.3588451355342)

Post-prepair (i.e. the contents of the shapefile):

MULTIPOLYGON (((30.6412432373056 -22.3588451355342,30.6410770138319 -22.3586235042359,30.640942829896 -22.3590382545833,30.641672390748 -22.3591240852718,30.6418011367807 -22.3588451355342,30.6412432373056 -22.3588451355342)),((30.6413934410105 -22.3585018127803,30.6411788642893 -22.3583086937312,30.6410920036326 -22.3585771721248,30.6413934410105 -22.3585018127803)),((30.6410501182566 -22.3585876434688,30.6410770138319 -22.3586235042359,30.6410920036326 -22.3585771721248,30.6410501182566 -22.3585876434688)))

Which looks like this

It seems that the culprit is again the -rrrn flag (part of -fix).

Tested on RHEL (gdal 2.2.3) and Mac Sierra (gdal 2.2.2).

@kenohori kenohori self-assigned this Mar 30, 2018
@ldemaz
Copy link
Author

ldemaz commented Mar 30, 2018

Also, just to add to this, pprepair works on this, if passing other arguments, e.g.

../pprepair/pprepair -i temp2.shp -o tempf.shp -rtnn -rtam

But the results seem to remove two of three parts fairly consistently (i.e. when testing various other options besides -rrlb -rrrn). I haven't used pprepair in a while, but I seem to recall that it should preserve those parts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants