mapbox / mapnik-vector-tile

Mapnik implemention of Mapbox Vector Tile specification
BSD 3-Clause "New" or "Revised" License
553 stars 117 forks source link

Geometry tests #154

Closed jakepruitt closed 8 years ago

jakepruitt commented 8 years ago

This pull request adds geometry test data to mapnik-vector-tile tests, with the goal of improving coverage and making mapnik-vector-tile robust against various invalid and bad geometries. The current strategy for these tests is:

  1. Create many problematic and non-problematic vector files and place them in https://github.com/mapnik/geometry-test-data input folder.
  2. Run a test that reads the input vector file and performs the clipping and simplification of the vector-tile production process.
  3. Compare the resulting clipped-and-simplified tile to a corresponding expected tile in the expected folder of geometry-test-data.

refs #153

cc/ @flippmoke, @springmeyer, @artemp

flippmoke commented 8 years ago

@jakepruitt see: https://github.com/mapnik/mapnik/blob/master/test/unit/geometry/geometry_strategy_test.cpp#L97-L105

and

https://github.com/mapnik/mapnik/blob/master/include/mapnik/util/geometry_to_wkt.hpp#L43

and

https://github.com/mapnik/mapnik/blob/master/include/mapnik/util/geometry_to_geojson.hpp#L32

as I think they might be better routes then what it looks like you might be doing?

jakepruitt commented 8 years ago

I just added functionality for updating the fixtures and running the benchmark with the ginormous polygon. If you want to overwrite all of the existing features, use

UPDATE=true make test

and if you want to run the ginormous polygon through clipping and simplification (warning, tends to take ~10 mins) use

BENCHMARK=true make test
springmeyer commented 8 years ago

Just synced with @jakepruitt on this. Pending that it builds on windows, it is ready to merge. Phase 1 is done:

This sets us up nicely for potential future phases and improvements: