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

Tagging error with triangles? #43

Closed
adrien-berchet opened this issue Jun 3, 2016 · 5 comments
Closed

Tagging error with triangles? #43

adrien-berchet opened this issue Jun 3, 2016 · 5 comments

Comments

@adrien-berchet
Copy link
Contributor

The polygons with only 3 edges are not tagged properly. Or is it on purpose? I think it is not because these polygons are not reconstructed at the end of the process.
When I add a new edge to these polygons, it is tagged properly.
pprepaire_issue1
After adding an edge:
pprepaire_issue1b

For now I did this as a temporary workaround and I get the result I want but it is quite suboptimal :)

      // Transform 4 nodes polygons to 5 or more nodes polygons
      if (geometry->getExteriorRing()->getNumPoints()==4) geometry->segmentize(geometry->getExteriorRing()->get_Length()/4.0);

Regards

@hugoledoux
Copy link
Member

Show me the input please, here I can't understand what the problem is.

@adrien-berchet
Copy link
Contributor Author

Here is the initial data:
pprepaire_issue1_data

And here is the complete data set I used:
test_pprepair_issue.zip

@hugoledoux
Copy link
Member

First, your data are probably not what should be used as input in pprepair. There are many disconnected parts, and here I am not sure what I as a human would do to "repair" this dataset. What do you want to obtain in the case above where you have roads/canals (I guess...)?

Second, what happens in your first image above is that the empty part gets the value of the triangle in red, because in theory any of the adjacent polygon to a problematic polygon can be used to fix the problematic area. But this is my guess, since I am not sure if I know the meaning of the 2 colours in your image.

In brief: I'd first consider if pprepair can fix your problem here. It seems to me that snapping would perhaps be more appropriate for many of the errors that you have. pprepair was created to solve a very specific problem: fix a planar partition, not any GIS datasets.

Hope this helps.

@adrien-berchet
Copy link
Contributor Author

  1. For the first point, each part is supposed to be a planar partition (they are land use parcels so they are supposed to be perfecly contiguous, without any hole nor overlap). So your advice would be to run pprepair on each part separately?
  2. Sorry, I did not explained much about the pictures. The last image, in my previous post, is the original dataset. The images I firstly posted are the tagged triangulation exported using the argument -otnt. The red triangles are the ones tagged with a 0 and the others are tagged with a 1. All the triangles that are tagged with a 0 are not reconstructed in the output dataset. So there are some initial polygons that are just deleted from the final dataset. The very weird thing is that just adding a node to these polygons make them being tagged with a 1 and thus they reappear in the final dataset.
  3. Also, I am still not sure about something: is pprepair sensitive to invalid geometries? Should I repair the invidual geometries with prepair before running pprepair?

@hugoledoux
Copy link
Member

  1. yes
  2. hmmmm, no time now to check but I advice you to use the branch "new", and use --outtr to see the triangles.
  3. yes it is. and yes you should. Use branch "new" and then by default the validation of each is done (can be skipped with --skipvalideach). The branch master automatically repairs wrong input ones, but I think it's safer to run prepair on your file first and then pprepair it.

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