-
Hi, I am serving pbf vector tiles based from a python backend using mapbox_vector_tile pip package. Basically my backend :
My problem is that when maplibre decodes the featurecollection sent from the backend (in EPSG3857), the coordinates are completely off and the layer is not displaying on the map. I checked the coordinates encoded in the pbf file and they are correct. Hope to get some insight here. Thx |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
A demo would be helpful. |
Beta Was this translation helpful? Give feedback.
-
Yes` you're right ! As an exemple this is a FeatureCollection that the backend constructs :
It would send it via a Response object from Flask : Where the transform function is converting the coordinates to ESPG3857. (It works I checked by decoding a message as an exmple). When I look at the layer that maplibre is supposed to draw, I get as propreties : |
Beta Was this translation helpful? Give feedback.
-
I don't see an obvious error, although it's hard to troubleshoot the problem with just some code fragments. Is it possible for you to make a live demo? Or at least provide a pbf tile ? If I get you right, you believe the data in the pbf tile is correct, but maplibre (which version?) messed up the coordinates? Also, "more points" doesn't help to see which coordinates are "completely off". I assume it appears to be shifted by a fixed amount? |
Beta Was this translation helpful? Give feedback.
-
The pbf file, you uploaded, does not contain any valid geometry. All values are 'NULL':
|
Beta Was this translation helpful? Give feedback.
-
I may be wrong about this, but aren't the coordinates inside a pbf file relative to the tile? when I've debugged tiles before i had to use something like https://github.com/mapbox/vt2geojson to get real coordinates, otherwise the coordinates from directly decoding it weren't valid |
Beta Was this translation helpful? Give feedback.
I may be wrong about this, but aren't the coordinates inside a pbf file relative to the tile? when I've debugged tiles before i had to use something like https://github.com/mapbox/vt2geojson to get real coordinates, otherwise the coordinates from directly decoding it weren't valid