mapbox / pbf

A low-level, lightweight protocol buffers implementation in JavaScript.
BSD 3-Clause "New" or "Revised" License
801 stars 107 forks source link

strange coordinates after parser mapbox pbf #119

Closed yasongguo closed 4 years ago

yasongguo commented 4 years ago

Hello, I am trying to make vector tile base on Mapbox pbf standard.

First, convert data from EPSG4326 to EPSG3857 and export as .json. Second, use mapbox/tippecanoe to generate vector tile in pbf format Third, use mapbox/pbf, @mapbox/vector-tile and zlib, and use toGeoJSON Finally, I got the following results

geojson { type: 'Feature', geometry: { type: 'LineString', coordinates: [ [Array], [Array], [Array], [Array], [Array] ] }, properties: { FNODE: 27, TNODE: 27, LPOLY: 9, RPOLY: 1, LENGTH: 1.567, HYD14M: 278, HYD1_4M_ID: 1454, GBCODE: 23010, NAME: '濂庡悲娌', LEVEL_RIVE: 5, LEVEL_LAKE: 1 } }

and in the coordinates: [ -48.427734375, 74.74118495548183 ] [ -48.7353515625, 74.78737860165961 ] [ -48.6474609375, 74.74118495548183 ] [ -48.4716796875, 74.71803680830911 ] [ -48.427734375, 74.74118495548183 ]

this coordinate is very strange, the origin data is in EPSG4326 and I convert the data in EPSG3857, but the above data is obviously not EPSG4326 or EPSG3857.

Does anyone know why this is? Thanks in advance

yasongguo commented 4 years ago

Code error caused by my own negligence, close this issue. Thank you very much for developing this tool, it is very easy to use.