mapbox / Hecate

Fast Geospatial Feature Storage API
MIT License
252 stars 36 forks source link

Pka tile grid crate #182

Open ingalls opened 4 years ago

ingalls commented 4 years ago

Context

Copied from https://github.com/mapbox/Hecate/pull/181 so I could fix the test runner - previously it wouldn't work from forked repos as docker didn't like the :

tile-grid has been extracted as a minimal crate from t-rex recently. Since it contains various fixes, it's better to use the maintained version as a dependency. License is the same as Hecate (MIT).

cc/ @ingalls @pka

ingalls commented 4 years ago

@pka hmm haven't gotten as much ton of time to dig in here as I hoped, but I noticed that the tile endpoint is now returning empty mvts.

Comparing the calculated extents between master and this branch it seems like the new crate is returning extents differently

Master

Extent { minx: -20037508.342789248, miny: -0.000000003725290298461914, maxx: -0.000000003725290298461914, maxy: 20037508.34278924 }
Extent { minx: -10879740.857998852, miny: 7669997.166247722, maxx: -10879129.361772569, maxy: 7670608.662474003 }
Extent { minx: -10879740.857998852, miny: 7668162.677568879, maxx: -10877294.873093726, maxy: 7670608.662474003 }
Extent { minx: -10879740.857998852, miny: 7670302.914360862, maxx: -10879435.109885711, maxy: 7670608.662474003 }
Extent { minx: -10879740.857998852, miny: 7669385.670021441, maxx: -10878517.865546288, maxy: 7670608.662474003 }

Branch

Extent { minx: -20037508.342789248, miny: -20037508.342789248, maxx: 0.0, maxy: 0.0 }
Extent { minx: -10879740.85799885, miny: -7670608.662474008, maxx: -10877294.873093724, maxy: -7668162.677568883 }
Extent { minx: -10879740.85799885, miny: -7670608.662474008, maxx: -10879129.361772567, maxy: -7669997.166247727 }
Extent { minx: -10879740.85799885, miny: -7670608.662474008, maxx: -10879435.10988571, maxy: -7670302.914360868 }
Extent { minx: -10879740.85799885, miny: -7670608.662474008, maxx: -10878517.865546286, maxy: -7669385.670021446 }
pka commented 4 years ago

I'm sorry that I didn't catch the test failures. I'm quite sure that I ran cargo test.

The WebMercator scales are now calculated with Rust code to prevent rounding errors like in your first test (https://github.com/t-rex-tileserver/t-rex/commit/111f350). Originally, they were copied from MapCache.