mapbox / vt2geojson Goto Github PK
View Code? Open in Web Editor NEWDump vector tiles to GeoJSON
License: ISC License
Dump vector tiles to GeoJSON
License: ISC License
Using vt2geojson tool I convert several pbf tiles from 3 zoom level to geojson files:
vt2geojson https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Esri_Childrens_Map/VectorTileServer/tile/3/3/2.pbf > 3_2.geojson
vt2geojson https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Esri_Childrens_Map/VectorTileServer/tile/3/3/1.pbf > 3_1.geojson
vt2geojson https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Esri_Childrens_Map/VectorTileServer/tile/3/2/2.pbf > 2_2.geojson
vt2geojson https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Esri_Childrens_Map/VectorTileServer/tile/3/2/1.pbf > 2_1.geojson
But when I open geojson files in QGIS, features have wrong position and tiles order:
Services Directory: https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Esri_Childrens_Map/VectorTileServer?cacheKey=aa41ff47603e8df5&f=html
How I can receive geojson files with correct coordinates?
Thanks!
Hi, I'd like to update some properties of the features inside the vector tiles, how can I encode the decoded geo json file into mvt vector tile again? Or is there any related client tool to do this?
In line 78 of index.js
77: var layer = tile.layers[layerID];
78: for (var i = 0; i < layer.length; i++) {
it crashes if layer is undefined, which could happen from an invalid layer ID or a layer that don't exist in current tile. Putting an if check if (layer)
would solve it.
"Packages No packages published" is displayed right now, fortunately this pointless section can be removed.
Edit repo page config to remove it (cog next to the description).
I am not making a PR as it is defined in proprietary github settings, not in a git repository - and I have no rights to modify repo settings.
Can we depend on a stable https://github.com/mapbox/vector-tile-js version?
Line 22 in f5e6f1f
Is there any way to resolve this value error while using it to convert a composite mvt to geojson?
It's great tool and it worked for me, but I don't know how to direct the output to a file. While using vt2geojson https://a.tiles.mapbox.com/v4/housingdemony.x8xatou7/2/11/22.vector.pbf?access_token={token}
I have the console output only. I can't see any additional arguments.
I use vt2geojson to extract the transportation layers in the pbf file,Is there a way to convert this geojson back to pbf?
vt2geojson({
uri: './5-19-12.pbf',
layer: 'transportation',
z: 5,
x: 19,
y: 12
}, function (err, geoJson) {
if (err) throw err;
console.log(geoJson)
});
Outputs multiple FeatureCollections
, should be nested.
I am using vt2geojson for requesting vector tiles geojson in osm-compare, to get a set of features but getting following issue in few requests.
Traceback:
/app/node_modules/@mapbox/vt2geojson/index.js:34
if (err) throw err;
^
Error: socket hang up
at createHangUpError (_http_client.js:250:15)
at Socket.socketOnEnd (_http_client.js:342:23)
at emitNone (events.js:91:20)
at Socket.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:926:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)
The code is here, where I am making the query.
Not sure what this means and what's causing this issue. Would be great to get some help debugging it.
cc @mapsam
We are currently outputting both feature.coordinates
and feature.geometry.coordinates
. The former is the result of layer.feature(i).loadGeometry();
which is a custom structure of x,y in tile coordinates. The latter is geojson coordinates. I think we should output only the latter by removing this line:
@@ -69,7 +78,6 @@ function readTile(args, buffer, callback) {
var layer = tile.layers[layerID];
for (var i = 0; i < layer.length; i++) {
var feature = layer.feature(i).toGeoJSON(args.x, args.y, args.z);
- feature.coordinates = layer.feature(i).loadGeometry();
collection.features.push(feature);
}
});
/cc @jfirebaugh who might remember if there was a reason for feature.coordinates = layer.feature(i).loadGeometry();
.
I would like to get features across several adjacent tiles. Does anybody know if there is a way to do this and have the features that span across tiles get stitched back together?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.