Add vector tile support #775
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit adds commands for returning objects in a vector tile. Allows for fetching tiles over JSON, RESP, or HTTP.
Using the command "INTERSECT key MVT x y z", Tile38 returns a vector tile containing objects that intersects the tile at (x,y,z). The format is a Mapbox Vector Tile, which can be loaded into mapping tools that support mvt/pbf sources, such as mapbox, maplibre, leaflet.js, etc.
Example using the tile38-cli:
Returns json with an "mvt" member as base64.
If desired, The raw (non-base64) binary can be returned when the client output is set to 'resp', as with "OUTPUT resp".
The number of items that are included in the mvt binary are limited to 100, which is the default for all Tile38 spatial commands, but can be increased using the LIMIT option.
Direct http access is allowed using the following URL.
Such as:
A simple map viewer is provided with Tile38 for viewing and experimenting with vector tiles.
All objects are encoded as features in the MVT binary format. Each feature is tagged with an 'id' and 'type' property. These properties can be used for programatically filtering at the source layer. All source layers are named 'tile38'.
View the source code for the web viewer from a web browser to see a working example.