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
Handling of invalid locations in area assembler #195
Comments
Do we? I don't think that's current behavior. |
We actually make use of the feature for rendering the Swiss map on http://osm.ch. The extract is created from a padded Swiss polygon with excat cutting (only nodes inside the polygon). The rendered map has the landcover roughly follow the extract polygon, so it's a cheap way to get a cut-out-effect. It's far from perfect, there are smaller rendering errors and sometimes missing areas where a multipolygon is now incomplete. So I would be in favour of keeping the current behaviour and just skipping over the missing nodes. For those who prefer to render the full polygons on extract boundaries, extracts with the complete way option or osmium smart extracts can be used. |
The area::Assembler now detects invalid locations in the ways used to assemble an area. It will count them and report them in the stats and through the problem reporter. If the new config option ignore_invalid_locations is set, the Assembler will pretend they weren't even referenced in the ways. See #195.
I have added support for ignoring invalid locations in 3459e84. |
Currently the area assembler expects all locations in the ways it uses to create a (multi)polygon to be valid. If a location is not valid, the result is not well defined. In most cases it will probably just fail to create the multipolygon, but it could also create totally broken ones.
This is most certainly something we want to fix. The assembler should either throw an exception or just not try to build any area. Other failures in the data are handled by the assembler by not building any area (and possibly reporting the error throw a "problem_reporter"), so I tend towards using the same mechanism here also.
This came up in the context of osm2pgsql-dev/osm2pgsql#684 . osm2pgsql wants to be able to handle the case of invalid locations by just ignoring those locations and trying to build an area from the remaining valid locations. This could help at the boundary of an extract. I do not think this is the right solution, though, because it could lead to wrong polygons like in this example:
Ignoring all locations outside the dotted box would create a triangular polygon exactly where the original polygon is not!
/cc @lonvia @pnorman
The text was updated successfully, but these errors were encountered: