geojson-vt | Slice GeoJSON into vector tiles on the fly in the browser | Map library
kandi X-RAY | geojson-vt Summary
kandi X-RAY | geojson-vt Summary
Slice GeoJSON into vector tiles on the fly in the browser
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Clip a new line clipping .
- Convert a set of feature objects into a GeoJSON Feature .
- Add a new feature .
- Draws the tile .
- Shifts all points in the given polygon coordinates
- Convert a single line to an array .
- Calculates the distance between a point in a segment
- Adds a new line to the array of tiles .
- Redirects to an indexing ring .
- drag drop
geojson-vt Key Features
geojson-vt Examples and Code Snippets
Community Discussions
Trending Discussions on geojson-vt
QUESTION
I am querying raw vector tiles from zoom level 8 from tiles created to zoom level 11. I then convert the point features in these tiles to geojson. The converted feature geometries do not match the tile geometry at zoom level 11, or tiles from zoom level 11 converted to geojson. I have created the tiles with two different programs (tegola and geojson-vt). I am converting the tiles with vt2geojson. I am trying to determine at what stage in the conversion process the geometry is being manipulated - tile creation, tile conversion back to geojson, or in mapbox gl js. As far as I can tell the coordinates are not being trimmed in the creation or conversion process, but am not 100% positive on that. I get the reason for the simplification of lines and polygons at lower zoom levels, but I do not see any reason to manipulate point geometry.
As can be seen in the image, the points start to drift apart after the max zoom level of the original tiles. One workaround is to simply filter the vector tiles to only show the features in the resulting geojson features as the properties are still intact or store the coordinates in the properties, but this is not ideal.
Bottom line - if I want to view points as close to the original data as possible, what max tile zoom level should I use (i.e., 11, 12, 13, 14), and at what stage does the geometry get manipulated?
...ANSWER
Answered 2020-Apr-27 at 10:17It's a bit hard to tell what your exact question is, but if I'm understanding correctly it is essentially: "Why do I lose spatial accuracy when I overzoom my vector tiles" and the answer is "because you're overzooming them". It's inherent in the way they work.
Your original data probably had 10 significant figures of precision. Each offset for a point in a vector tile is usually encoded as an integer between 1 and 4096.
Your options are basically:
- increase the spatial accuracy of the generated tiles (eg, tippecanoe's
-d
flag) - generate tiles to a higher zoom level
- don't overzoom them so much
QUESTION
I'm new in MapBox GL Js and I want to call a big GeoJSON file over https and display it to the map. I think that calling vector Tile is the best way to do that, I found some tutorials that show how to convert your GeoJSON data to Vector Tile but on Server Side or upload it to the MapBox Style but my GeoJSON file is frequently changing. So I found this solution is a new JavaScript library called geojson-vt, describing how to convert a huge GeoJSON files to vector tile on the fly (Client Side) with crazy fast, It's seems like what I'm looking for, BUT !!, How can I integrate it to the MapBox GL JS for calling the layer ??
Blocking on How can I add Layer using Mapbox GL JS with the following result : var tileIndex = geojsonvt(MyGeoJSON); var tile = tileIndex.getTile(z, x, y);
... Or I just didn't get it ! Please somebody helps or can propose some other solution for my problem.
...ANSWER
Answered 2020-Apr-21 at 19:55I'd recommend using Deck.gl GeoJSON Layer. Here's an example:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install geojson-vt
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page