mapbox / geojson-vt

Slice GeoJSON into vector tiles on the fly in the browser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to interpret the coordinate data in the final result?

yasongguo opened this issue · comments

Hello,
I'm trying to use geojson-vt to get vector tiles which conform to EPSG3857 tile rules from EPSG4326 data. And I encountered some problems:

  1. I enter the following code and the original data is EPSG4326
var content = fs.readFileSync("./r143263.geojson").toString();
var tileIndex = geojsonvt(JSON.parse(content));
var features = tileIndex.getTile(0, 0, 0).features;
console.log(features[20].geometry)

And the following results were obtained,
[ [ [ 3260, 1568 ], [ 3263, 1562 ] ] ]
This coordinate data is obviously not in EPSG4326. Is there any explanation about this data or what am I doing wrong?

  1. Does the tiles generated using geojson-vt conform to the EPSG3857 tile rule?

Thank you

These are the mercator-projected, rounded coordinates relative to the current tile, as described by the vector tile specification.