Proper parsing of polygons in osm-simplify while cutting to tiles

Authored by dkolozsvari on Aug 15 2016, 6:20 AM.



With the introduction of batymetry polygons I realized that the parsing and cutting of polygons was working on the outer boundary of the polygon, the inner rings were left out.

This patch aims to fix that, though there are some issues with this approach or I'm just missing something. When a bathymetry polygon with some inner rings is cut and then the tile loaded into Marble, the inner rings are not getting rendered, though they are there in the file.

Test Plan

Cutting to level 5 tiny_planet_5.1.osm and then checking tile 5/14/12

we can clearly see that even though there are lots of inner rings in the file, and the file's size is >500KB(that's pretty huge for a level 5 tile), there are barely some nodes and polygons rendered.

Diff Detail

R34 Marble
Lint Skipped
Unit Tests Skipped
dkolozsvari retitled this revision from to Proper parsing of polygons in osm-simplify while cutting to tiles.Aug 15 2016, 6:20 AM
dkolozsvari updated this object.
dkolozsvari edited the test plan for this revision. (Show Details)
dkolozsvari added reviewers: nienhueser, rahn.
dkolozsvari set the repository for this revision to R34 Marble.
dkolozsvari added a project: Marble.
dkolozsvari added a subscriber: Marble.
dkolozsvari updated this revision to Diff 6090.Aug 20 2016, 5:43 AM

This revision solves the issue mentioned with the bathymetry polygons missing. The problem was with the orientation of the inner rings: they are counterclockwise polygons, but the clipping algorith works ONLY on clockwise polygons, so implementing an efficient way to reverse the order of the nodes solved the problem.

Besides that, I had to track down another issue in the BaseClipper.cpp, because I noticed, that some inner rings are not even added to the files. The clipping algorithm with the TinyPlanetProcessor class works fine now, landmass polygons and bathymetry polygons too are parsed, cut and outputted correctly.

nienhueser edited edge metadata.Sep 8 2016, 7:14 PM

This is already pushed, right?

This is already pushed, right?


nienhueser accepted this revision.Sep 9 2016, 3:55 AM
nienhueser edited edge metadata.
This revision is now accepted and ready to land.Sep 9 2016, 3:55 AM
nienhueser closed this revision.Sep 9 2016, 3:55 AM