-
Notifications
You must be signed in to change notification settings - Fork 432
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
Wrong geometry? #559
Comments
I've found the problem. |
In the next revision of the vector tile spec, we are planning to add the ability to merge features back together across tile boundaries. mapbox/vector-tile-spec#104. The best you can do now is to give each of your features a unique |
Thanks for the reply, good to know that you are working on that, I've subscribed to the issue to stay up to date. Meanwhile, my features already have a unique id in the data file, so all I have to do is load the geometry from a separate store. |
I am trying to create mbtiles from a geoJson, EPSG:3857.
I've tried, with partial success, different parameters, currently:
tippecanoe -o out.mbtiles -pS -s EPSG:3857 -P -f in.json -z12 -Z0
I am using tileserver-php to serve the tiles to OpenLayers:
"source": new ol.source.VectorTile({ "projection": 'EPSG:3857', format: new ol.format.MVT({ featureClass: ol.Feature }), tileGrid: new ol.tilegrid.createXYZ({ minZoom: 0, maxZoom: 12 }), tilePixelRatio: 16, urls: vectorH })
Visually the tiles are OK.
In my page, to highlight the feature hovered by the mouse, I add that feature to another vector tile (let's call that highlighted feature), that has the correct style and the I remove the feature from it when the mouse leaves the feature.
This vector style is defined as:
"source": new ol.source.Vector({ "projection": 'EPSG:3857' })
The thing works perfectly when I render the vector layer using the geoJSON directly. The future release of my webapp, however, will have more than 10.000 features, this is why I am evaluating to switch to vector tiles.
With the mbtiles, the method of adding the feature to a temporary layer is not working (no errors but the highlighted feature is not shown on the map) so I'm trying to find out why.
I've found out that the geometry of the features is somehow changed, as an example, a feature's geometry that in both the json file and the vector layer built with it, is:
[3430837.84594,3402171.50494,3429629.55149,3402171.50494,3429983.98861,3404344.33362,3426358.73065,3404344.33362...]
gets translated to
[1801, 727, 1782, 841, 2289, 841, 2252, 1069, 1872, ...]
Why is this happening?
The text was updated successfully, but these errors were encountered: