I am using mapbox to visualise the data but i want to copy a pbf file(already generated by tippecannoe) from one source to another source with a different source layer so that it can be visualised by mapbox.
`
Some of my attempt looks like below
var pbf = new Pbf(fs.readFileSync('4.pbf'));
const tile = new VectorTile(new Pbf(fs.readFileSync('4.pbf')));
const layer_name=Object.keys(tile.layers).join(',');
obj.new_layer_name = obj.layer_name;
delete obj.layer_name;
console.log('Vector source layers found: ', Object.keys(tile.layers).join(','))
I want to either convert this again into pbf format or any other method to copy pbf tiles with different source layer so that it can be visualised by mapbox
Related
I'm trying to convert a Geojson to a zipped shapefile using shp-write.
But when I follow the example given on the GitHub page https://github.com/mapbox/shp-write#example
I'm getting a "ReferenceError: require is not defined" error on this line:
var shpwrite = require('shp-write');
This question was posted at Converting Geojson to Shapefile in Javascript using shp-write, but I was unable to access the updated file at https://jsfiddle.net/rajkishan16/3xff9zmy/
Can someone help me?
Thanks.
I'm trying to implement mapbox offline in my flutter application... until now I'm using the repository https://github.com/mapbox/mapbox-gl-native to get the map but this map comes in format *.db which is a SQLite format.
Now if I want to use that map (in format .db) in flutter I found the package https://github.com/tobrun/flutter-mapbox-gl where it has an instructions for loading the map (.db) ...
Now, that library is so basic .. I can't do more things like put markers or anything else.. that's why I'm trying to use the other library which is more common in fluter and is called 'flutter_map' and it has a way to load offline maps but the problem here is that I need '{x}{y}{z}.png' that's an image format.
Finally my question is: How can I pass from my map (.db) to that format ({x}{y}{z}.png) ??? or maybe ... how to convert (.db) to (*.mbtiles) ?? cause the last one is more common.
Thanks again!
Mapbox offers the Raster Tiles API which will serve map tiles in ({x}{y}{z}.png) format. https://docs.mapbox.com/api/maps/#raster-tiles These images will be satellite imagery though.
Mapbox also offers the Vector Tiles API which serves map tiles in .mvt format.
https://docs.mapbox.com/api/maps/#vector-tiles
Conversion to .mbtiles
You can convert .mvt tiles to geoJSON using this converter.
Use Mapbox Tippecanoe to convert from geoJSON to .mbtiles
all files load fine, I have the following lines to load my data
var map = L.map('map').setView([0,0],2);
var countriesLayer = L.geoJSON(test).addTo(map);
I have exported the shape file from qgis to geojson, with the above script
I can view a sample geojson data but not this one. The CRS I'm working with is Adindan, can't tell if that is the issue. but my geojson data loads fine on mapshaper.
I'm using a png filter to filter a video/image but at the end I want the user to have export options.
So save video as mp4, photo as jpg/png etc
But I also need the user to save the filtered file as a 3DL and Cube file
Basically, 3DL files are used as LUTS/lookuptables in Adobe Premiere and Cube files are used as LUTS in DaVinci Resolve and FCPX.
But cube files also use two different sizes, 17x17x17 for FCPX and 33X33X33 for Resolve.
Any ideas how to save as 3dl and cube files?
Using Swift
*.pbf("Protocolbuffer Binary Format") is primarily intended as an alternative to the XML format.
There are two formats of *.osm.pbf and *.vector.pbf. What tools can I use to open these files? (I know JOSM can open *.osm.pbf files, but it can't open *.vector.pbf files.)
If I want to write own *.vector.pbf files in Mapbox, how do I work for that?
Thanks!
Regarding question #2, extracting PBF data
Using GDAL's ogr2ogr is the easiest method (I found).
Given a file named 1583.vector.pbf decode it to a, for example, shapefile (folder) named output:
# cmd show prog. output format output name input name
ogr2ogr -progress -f "ESRI Shapefile" output 1583.vector.pbf
Regarding question #3, creating PBF data
Use the same command as above but swap the input/outputs and output format:
# example source: https://gdal.org/drivers/vector/mvt.html
ogr2ogr -f MVT mytileset source.gpkg -dsco MAXZOOM=10
The Vector tiles used by Mapbox are serialized as Protocol Buffers.
Protocol Buffers allow you to efficiently compress the vector data inside the tile.
The Mapbox Tile Specification is available on github.
Esri has also adopted the same specification for their products.
You can find a list of parsers, renderers & CLI utilities here: https://github.com/mapbox/awesome-vector-tiles
In the common scenario, you can use mapbox-gl-js to render the vector tiles on the client. To generate vector tiles, you can use Mapbox Studio. This will require uploading your data online in the Studio. You can also use Mapbox Studio Classic (the older version) to generate the tiles locally.
Internally, Mapbox Studio uses the tilelive API, so you can programatically generate the tiles. In the list above there are other good alternatives as well.