-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What format is returned by get_tile ? #2
Comments
It should comply with the vector-tile-spec that can be found here: https://github.com/mapbox/vector-tile-spec/blob/master/README.md. |
Hello, I'm not sure about that, MVT file are supposed to be protobuf, or maybe I should then encode the dict payload to protobuf ? Thanks |
Seems I misunderstood the spec. This is a python port of the javascript equivalent geojson-vt which states:
I'm not sure, but in theory it should be possible to encode in protobuf to be conformant with the spec. |
@Murthy10 I have the same question... I'm not quite sure how to get from the not-quite-GeoJSON but also not-quite-vt-protobuf output to something I can load as a real honest vector tile.... this code illustrates I believe the same "what now?" question that has us scratching our heads # This is a large half-gigabyte FeatureCollection, load once at startup
geojson_path = 'big-featurecollection.geojson'
geojson_data = get_json(geojson_path)
mvt = geojson2vt(geojson_data, {'maxZoom': 20})
@app.route(f"{URL_BASE}/vector_tiles/<int:z>/<int:x>/<int:y>")
def vector_tiles(z=None, x=None, y=None, geojson_key=None):
tile_dict = mvt.get_tile(z, x, y)
# So.... Now what????
#
# OK, I don't think /this/ is right.... this JSON is now a LOT
# more like the spec in vector_tile.proto but I'm missing some
# step to convert this to an actual binary ProtoBuf, but tile_dict
# is still not suitable to call google.protobuf.json_format.ParseDict
# according to the vector_tile.proto spec.... so how do we get
# from point A to something mapboxGL will see as a binary protobuf MVT???
return jsonify(tile_dict) Any hints? :-) |
did you managed to figuring it out? I am stuck here. |
old issue but still relevant: |
Hello,
I used you library to implement a VectorTile server from GeoJSON however I've been unable to display the resulting tile with OpenLayers.
I get a dict with keys likes minX, maxY... and I have no idea what format this is. I tried MVP, GeoJSON and TopoJSON in OpenLayers, none managed to load these tiles.
Thanks
The text was updated successfully, but these errors were encountered: