-
Notifications
You must be signed in to change notification settings - Fork 23
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 generates lots of spikes (dangling edges) #36
Comments
This spike was surely caused by your choice of a (in this case wrong) repair option. What option did you use? I assume that above the polygon there are 2 polygons and the spike is a gap between the two, right? Then if you use a longest-boundary repair that spike will disappear; the gap will be filled with either the above-left or above-right polygon. We do not plan to add simplification of polygons in pprepair, that would break its original idea as the geometries would be moved, and would conflict with other polygons. |
We used the dafault , I think: "pprepair-new -r fix" |
“-r fix” is indeed random neighbour. put “-r LB” instead, the spike should disappear. On Wed, Jan 20, 2016 at 5:12 PM, lucasmation notifications@github.com
|
Yeah, I was reading that now. Let me try it out |
Besides the "-fix" default, is there any other ways in which pprepair-new is behind pprepair (master) that I should be concerned about ? |
Don't think so no.. On Wednesday, 20 January 2016, lucasmation notifications@github.com wrote:
|
@hugoledoux, tks. I tryed with the -r LB and ran the tests again. There are still spikes, although their frequency descreased by one order of magnintude. For instance, out of 316k sectors we have, : Sectors whose perimeter changes more than 1%: Sectors whose perimeter changes more than 5%: Still there are quite a number of spikes. Looking at some examples, they still seem similtar to the one in the original stackoverflow question, and they don´t seem related to any "legit" corrections in the polygons. even with "pprepair-new -r LB" is the RN still being used as default second criteria? |
Can you send one isolated example please of such a spike? And yes random is used is there's a tie. But you'd see it in output if that happened (rare in practice): |
if you could isolate with 4-5 polygons and send them to me that would be useful. Here on screen I can't really assess. b) is the answer. Indeed, a) would make more sense, open an issue I can work on that at some points. But does the code print "Repairing 'tie'" often for your datasets? |
The 3 problematic polygons in the image above image are: blue one: cd_geocodi=530010805100231 you can select the polygons in the picture by the cd_geocodi variable (sorry I did not select the features with the bug. The file is still quite small, I don´t know how to select the features without introducing the postgis changes in precision). |
and yes, "Repairing 'ties' ..." is printed on the output of pprepair-new for all the 27 state files we are using |
Upon testing the output of pprepair on the Brasilian Enumeration districts we noticed a lot of spikes (or dangling edges) are generated. By comparing the perimeter lenghts before and after pprepair we noticed large perimeter changes are quite common and a lot of them are related to spikes.
See example we posted in this StackOverflow question
The behavior is a bit weird. From reading the paper describing pprepair, I expected small spikes to occur, only inside the overlap areas between original polygons. What we get are large spikes, that follow neighbor polygons perimeters, and excede the original polygon overlap or gap.
Following the suggestion in the StackOverflow question, we tried using the function ST_SimplifyVW to remove the spikes.We first used ST_SimplifyVW(geom_ppr , 0 ) to only remove spikes that were actually lines. This removes only a small fraction of the spikes. Higher tresholds ( ST_SimplifyVW(geom_ppr,1) , ST_SimplifyVW(geom_ppr,5) , ST_SimplifyVW(geom_ppr,10) ) were necessary to remove most of the spikes. The fact that spikes have a non zero area may be due to the errors introduced when importing pprepair output to postgis, due to limited precision in Postgis (double).
It would be great if you could introduce in the pprepair workflow something equivalent to what ST_SimplifyVW(geom_ppr , 0) does.
The text was updated successfully, but these errors were encountered: