Convert TomTom PBF to Mapbox MVT format - mapbox

I have downloaded traffic data from TomTom API which as come in the format
https://api.tomtom.com/traffic/map/4/tile/flow/relative0/12/1207/1539.pbf?tileSize=256&key=*****
However, I want to show it on MapBox which is requesting it in MVT format
I've tried ogr2ogr but that is outputting an MVT folder with numerous subfolders containing PBFs. I assumed the format would've been {z}/{x}/{y}.mvt
Is GDAL able to convert PBF into the appropriate MVT format, or any other commandline conversion?

Related

Convert OpenStreetMap POI Data to CSV

I am looking to extract some Point of Interest (POI) data from OpenStreetMap in a tabular format. I have used this link navigated to the relevant country and downloaded the file,
http://download.geofabrik.de/
What I get is a file with the .osm.pbf extension. However, I think it is possible to download the files in other formats like .shp.zip and .osm.bz2. Is there some way that I can convert this data into a tabular format like a CSV file?
I came across a tool called Osmosis which can be used to manipulate data in these formats, but I am not sure if it can be used for this purpose,
https://wiki.openstreetmap.org/wiki/Osmosis
I was able to successfully install in on my Windows machine though.
To be frank, I am not even sure if this gives me what I want.
In essence, what I am looking for is Sri Lankan POI data that contains the following attributes,
https://data.humdata.org/dataset/hotosm_lka_points_of_interest
If the conversion of this file does not give me data in this format, then I am open to other approaches as well? What is the best way to go about acquiring this data?

Osmosis for OpenStreetMap data - fields lost when extracting data

I have downloaded a pbf file, france_latest.osm.pbf, from geofabrik.de and want to use osmosis to filter it to get a .osm file with just the major roads. Here is my osmosis command string:
osmosis --read-pbf france-latest.osm.pbf --tf accept-ways highway=motorway,motorway_link,trunk,primary,secondary,trunk_link,primary_link,secondary_link --used-node --write-xml roads_m_1ry_2ry.osm
This produces a .osm file with the correct items, but it does not contain any field information to distinguish the different types of highway so I can display them in different colours in QGIS. I did the same operation a few years ago and the field information was contained in the filtered export so I am not sure why it hasn't worked this time. Is there something else I need to add to my osmosis command to get the field information?
The highway type data was in the .osm file generated by osmosis. It seems the information was getting lost when I tried to convert the .osm to a .db spatialite file to load into QGIS. But with QGIS 3 you no longer need to do this, as you can import .osm files directly into a project.

JOSM - Tags not exporting when converting shp to pbf

I am trying to use OSM data to make routes with different speeds. I modified the OSM file with R, wrote the shapefile, imported it to JOSM and created the .pbf file. When opening the resulting pbf all the other tags are lost. What can I do?

How to convert nominatim file to osm file pbf?

I have a backup file from postgresql of nominatim. Now I want to convert that backup file into OSM's PBF file, is it possible? If yes give me some suggestions on the conversion . Thanks a lot
I don't think so. Nominatim doesn't store raw OSM data in a database. During import it removes all information that isn't necessary for geocoding and transforms data in such a way that typical geocoding tasks can run efficiently. It is not possible to convert the results back into the original OSM PBF.

Importing geospatial data into mongodb

I have found a source for geo data that represents a country, and its constituents. I am building a service where I would like to have a user select a country and then based on that country select an area they would like results from. I am trying to download the data and import it into MongoDB but I am unsure which file format is best to download, and what tools I will need to convert the data to import it. The file options are ESRI file geodatabase, Shapefile, R file, Google Earth (.kmz), Geopackage, and ESRI personal geodatabase. Which one do I choose and what tools do I need for the next step? Is this even the correct approach to having the collection of countries and their states/territories?
Here is the open source data
gadm.org
MongoDB uses a subset of the GeoJSON format for its geo-spatial data. I would look at which formats are closest to that. A quick web-search turned up this tool for converting kml files to GeoJSON.