I want to ask if its possible to download the Json source of a leaflet web map layer, I want to extract the info from a map that returns info on a selected feature, inspecting the element I can see the selected info in Json format, but I want to know; first if it's possible, and, if it cloud be done, some light on how to approach it, I'm a noob in web scraping, thanks
Related
I'm migrating from Fusion Tables to Mapbox. I created a Dataset --> Tileset from an uploaded csv with my data. Formatted my style using the tileset and I can visualize and filter my map using the Mapbox GL JS API, but I'm struggling to understand how to add more entries to my map.
My data is a collection of features with the same properties on each feature, so I display all the features and display the properties based a feature clicked on the map.
If I try to add a feature on Mapbox Studio Dataset, it gives me the option to add a feature, but I have to manually add all the properties for the feature.
Is there a way to append entries or programmatically add data to a dataset to append data to my map?
Thanks!
You can use the Mapbox Datasets API to programmatically read, create, update, and remove features from your dataset. For your use case specifically, the update a dataset endpoint and insert or update a feature endpoint will likely be useful.
Note that after you update your dataset, you will need to re-export it as a tileset to then use the updated data in your map style.
Alternatively, you could consider using the new Mapbox Tilesets API, which provides a powerful pipeline for programmatically creating and updating tilesets. This tutorial is a useful resource for getting started with the Tilesets API and Tilesets CLI.
If I upload a gpx trace to
convert it into a tileset, I can use it in the Style editor just as expected. But if I upload a second and want to use it as a data source for another or even the same layer, It is greyed out with the following notice:
This source includes vector layer names that are already in your composite source. vector layer names must be unique.
I didn't set any name myself or changed the gpx traces in a weird way. I even renamed the style layer. I looked into the details of the automatically created tileset but I couldn't see a name which was the same on both sources. The only thing that both gpx traces had was the "tracks" part of the source, which contained the actual trace.
But I can't figure out how to change this name.
Is there some way to upload two gpx traces and use them in the same style?
I want to avoid workarounds if possible but if it doesn't work another way, I imagine that there are at least two workarounds:
1. Convert into a geojson file, upload as a dataset and convert into a tileset.
2. Somehow append multiple gpx files into one, but keep the traces separate.
What would be the downsides, apart from having more files to keep up2date? Is (2) even possible?
Update:
In the end I did convert the gpx files into geojson tracks. THis did work exactly as hoped. But I'm still interested if there's a shorter way or if I just did something wrong previously.
Disclaimer: I work at Mapbox.
It isn't possible to upload multiple GPX files directly to the same map style in Mapbox because their layer names are automatically set as track. To fix this, I recommend following these steps:
Convert your data to GeoJSON using a tool like toGeojson
Upload the GeoJSON to Mapbox Studio
Add the data to your map in Studio or GL JS
So to answer your question: you are going about this the correct way. One thing to note: you don't have to upload it as a dataset first. You can upload your GeoJSON as a tileset directly, unless you have some editing you want to do first.
I'd like to transition the map in my app from currently Apple-Maps-SDK to Mapbox. My users already downloaded a lot of offline maps into several .mbtiles tiles containing raster data.
My question now is if it's possible to still use those while the user will be transitioning to the new maps? I just don't simply want to delete all offline maps and tell the user that he needs to download everything again right now, but rather give them a time-window to do that...
I was looking at MGLRasterTileSource/MGLSource and thought that I can create a subclass and somehow provide my own data to the map, but this does not seem to be supported. There are no datasource methods on it for that purpose...
Would be great if somebody could point me into the direction on how to archive what I want.
EDIT:
So I thought it might work that way... I migrate my existing raster tiles into a downloaded pack inside the mapbox offline database. So I had a look at the caches.db but at least the data in there is not just a plain png/jpg (tried with the mapbox satellite images, which should be raster).
Cause there is no public interface for getting existing raster-tiles in there, is there?
I've seen an other solution where somebody is hosting a webserver inside the app... but that somehow looks like quite an overkill to me?!?
https://gist.github.com/namannik/3b7c8b69c2d0768d0c2b48d2ed5ff71c
I was asked to create metadata (INSPIRE) for one gdataset extracted from Open Street Map. I downloaded the polygon layer and added basic information but I don't know where to find more information than this : http://openstreetmapdata.com/data/land-polygons
I have been looking for 2 hours now and I think I will go crazy soon.
So if anyone knows, thank you a lot.
Cheers,
I am especially looking about data quality !
You will not find complete metadata information about the polygon file you downloaded.
The source where you downloaded the OSM data unfortunately does not have any id associated with the polygons. If you download the data for example from Geofabrik the data will have an id associated. This way you can look up the individual lines and might get further information about the way they were created or the author.
Inspire Metadata are in XML format. You probably have to create that from scratch. There are no OSM XML metadata available as far as I know.
my client prepared google map with points on. Now he wants that points on map in iPhone app. Is there way to export points from map prepared by him ?
If your client prepared the map in Google Maps, then he can use the "KML" link in his Google Map to download a file with all his data points in it, in KML format.
Did he use javascript to prepare the points and can you get that? If so, use the source.
Did he use maps.google.com to prepare it by dropping points on that? If so, click the URL button and you'll should see the points embedded in the URL, at least that is true for driving directions.