Code Monkey home page Code Monkey logo

vt2geojson's People

Contributors

amishas157 avatar jessecrocker avatar jfirebaugh avatar jgravois avatar mapsam avatar tmcw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vt2geojson's Issues

Wrong coorinates in exported geojson files

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:
image

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!

Question: Encode into vector tile again

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?

Invalid layer name crash

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.

Consider editing repository setings to remove "Packages" section

"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.

Peek 2020-10-25 09-10

How to save output?

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.

convert between geojson and pbf

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)
});

Socket hang up error

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

Remove `feature.coordinates`

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();.

combine features across multiple tiles

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.