Open bt-maps opened 2 years ago
I agree 100%. I created a little mvt project a little while back for this purpose exactly. I haven't gotten around to putting it into Tile38 yet.
for reference: https://github.com/tidwall/mvt
Thanks. No external dependencies! Nice! I really need to to learn Go sometime soon so I can try to contribute.
I wrote the mvt library 4 years ago, yet I still haven't added it to tile38... ðŸ˜
The dev branch for the mvt feature will be at here.
The idea will be that you can do an INTERSECTS
with the MVT x y z
option.
INTERSECTS fleet MVT 513 412 12
Which works the same as TILE 513 412 12
but instead of returns a list of geojson objects, it'll return the mvt binary.
For JSON the output will be:
{"ok":true,"mvt":"...base64...","count":100}
Where "count" is the number of features represented in the mvt. This can be raised or lowered using LIMIT number
. Default is 100.
For RESP the output will be two values:
1) (integer) 100
2) ...rawmvtbinary...
The current branch work and produces a working mvt tile, but the mvt does not contain any features yet. This will take a little work because there're certain decisions that still need to be made. Such as what default extent to use? I'm thinking 4096 is good. Also how much margin? Which will affect our clipping algorithm. Also dealing with tagging and layer naming is important.
Fortunately the tidwall/mvt has all the features.
Describe the solution you'd like Add option to return vector tile output (mvt/.pbf) on search results. Having the ability to generate mvt directly in tile38 like PostGIS's asMVT() function would be a great feature.
Describe alternatives you've considered Clipped geojson from tile38 ---- geojson to pbf middleware -- client-side js renderer.
Additional context
https://github.com/mapbox/vector-tile-spec