I am having a GeoJSON dataset of venues in different cities.
Is it possible to cluster only items belonging to one city together?
A naive way I could think of would be to create a layer for each city myself and place the cities items in them?
That would amount to like over 60 geojson layers.
Related
I have a high volume dataset with keys like this:
lat:6.897585,
long:52.785805,
speed:12,
bearing:144
Basically it is a dataset of records of various trips on cars. The data was stored every few seconds during each trip. The main goal of this project is to be able to visualize only u-turns (turn arounds) on a map. But for now, I am trying to at least show the data on specifc roads. For that, I am using Overpass API
With the help of Overpass Turbo, I can get a dataset with all the roads I need.
However, in the dataset, the road's geometry is represented with LineString type.
My question is, How can I get a bounding box(es) of the roads from Overpass API, so later on, I can display events that happened only on the given roads? Or maybe you have a better solution on how to achieve this?
A bounding box wouldn't be very helpful here, as using it to filter your points would show everything that falls within the box (which could include other nearby roads)
It sounds like getting a buffer around a linestring might get you closer, but could still include points that are within the buffer but not on the road you are inspecting.
The smarter way to do this would be to assign each event to a road segment using some logic based on their attributes/properties, so you don't have to depend on a spatial filter.
I'm now using OSMnx to extract data for buildings. What I need is to get building polygons through addresses. The question I met is about some of the buildings have multiple addresses, thus there are no address data for that building's polygon.
For example, the building 'Furutorpsgatan 49A' (in Helsingborg, Sweden) has three nodes you can search for, which are:
Furutorpsgatan 49A; Furutorpsgatan 49B; Gustav Adolfs Gata 23
But if you export the geometry data (polygon), there's no address data at all! In another word, there's no way to get the building polygon except for three nodes inside.
I was trying to use OSMid for polygons to match the position, but I can't find the building with OSMid 'w483244917'
Then I'm thinking is there any method I can extract the polygon data through one or several nodes inside?
Or could you suggest me some methods to get any building footprint polygons through building addresses?
Or is there a plugin for grasshopper to get building footprints by addresses?
Thank you!
I am working on a project where I need to get a shapefile of all roads in a given US county from open streetmap data, add some information to the county roads, then merge the individual county road shape files into a larger single shapefile using qgis.
My current process is to download the state roads map from the OSM repsitory that has my desired counties, and clip the larger state map to my desired county set of roads using qgis. I use the census bureau's county boundary shapefile to determine the boundary of the clip. The problem is that qgis seems to delete small sections of roads at the county boundary and I am unable to merge the "fabric" of the map together because there are gaps in road lines at the county boundary.
As an alternative approach, I have stared to research using the OSM overpass api to query for a set of county roads. If I can query OSM for all roads within a given county and download as a shapefile, should I then be able to merge the individual county road maps into a larger map without gaps and avoid the problem I have with clipping?
Are there any articles that describe the overpass api query for getting roads within a known administrative boundary, like a US county?
I have 3 separated GeoJSON files, each one contains a Feature Collection of Polygons.
First one for regions, the second for provinces and last for communes.
So the scenario is: for each region on click or zoom, show provinces in the clicked region then same thing with procinces.
I am using Leaflet for interactive map.
I am stuck on how to link every region with their provinces.
Is there any way to detect nested polygons?
Do I need a database or server side analysis?
Welcome to SO!
You would like to be able to tell the child ("nested") polygons of a given parent / container polygon, so that when a user clicks on the latter, you can show only the former.
The easiest would be to embed in your GeoJSON data properties some ID to each Feature, and for each child the ID of its container parent, and/or for each parent the array (list) of its children.
If your GeoJSON data does not already contain such association, then you could refactor it once to make it available. You have plenty ways of doing so, whether in GIS software, or directly using Client libraries. E.g. have a look at http://turfjs.org/ and its booleanContains method:
Boolean-contains returns True if the second geometry is completely contained by the first geometry. The interiors of both geometries must intersect and, the interior and boundary of the secondary (geometry b) must not intersect the exterior of the primary (geometry a).
I have two Open Street Map node IDs. Is there any API provided by Mapbox or Leaflet which could draw a PolyLine or LineString given the two node IDs?
I am not able to find any reference to OSM IDs anywhere in Mapbox documentation, apart from here and it does not detail how to use the OSM IDs for ourselves to draw lines on the map.
What I want to do is given 2 OSM IDs, I want to highlight the road segment connecting those OSM IDs. I can't go for things like Leaflet routing machine since the number of such lines are too many, with small distances. I can't run routing for all the edges.
Since you say "I can't go for things like Leaflet routing machine since the number of such lines are too many, with small distances. I can't run routing for all the edges." I'm excluding all solutions calling an external routing API, instead you can do your own internal routing.
Use the OSM Overpass API to get the long,lat points for those nodes
In Mapbox GL JS fitBounds to those two nodes and do map.querySourceFeatures to get the roads as GeoJSON LineStrings
then compute a network graph from this and use Dijkstra's algorithm to get the shortest path between your two OSM nodes.