I am using OSMnx to download and simplify a road network. But the problem I have is that once I simplify, I cannot preserve the precise geometry/geospatial information of links. The following figure shows the road network drawn from the road network in graph format
Road Network from graph
But the interesting fact is if I convert the same network to geodataframe, then that geodataframe has the exact linestring of links like the following figure,
Road network from gdf
I want to save the downloaded and simplified road network in .osm format with preserved geometry/geospatial information of links.
I tried to save the road network in .osm format with the pristine geospatial information of links. But the simplified network in a .osm/graphml format does not have that. But the saved network in .gpkg format has the pristine linestring.
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 using OSMnx to get building footprints for buildings, expecting to put polygon data in grasshopper to generate building models for energy simulations. I already have building height data and other energy input for that. The question is I need building addresses along with geometry data (polygon) from OpenStreetMap to match the building height data I have.
I used ox.geometries_from_place('Helsingborg, Sweden', tags={'building':True}) to get polygons of building footprints but there are so many blank in address columns like addr:city, addr:street.... But I'm pretty sure there's data for this information because I can see the address info when searching the building on OpenStreetMap web.
For example, I searched the building called 'Furutorpsgatan 49A' in Helsingborg.
In OpenStreetMap, all the information looks fine, but in the data I extracted from OSMnx there's no address info
What should I do? Is there any mistake I made? Or Is there any other method to get building footprint data for a specific building?
Many thanks!
I've pulled up a 'plot of land' raster and I'm attempting to georeference it to Openstreetmap. I can get the raster and the OSM to line up however it isn't accurate enough - there are straight lines that have warped.
I'm assuming this is an issue relating to the message, "Used a ballpark transform epsg:27700 to EPSG:3857" that I get when I add OSM as a layer to a new project set to EPSG27700.
As you may easily tell, I'm quite a novice at QGIS!
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.
When I upload two shapefiles to ArcMap they are not overlapping. I have to click "Zoom to Layer" to see each one. I know I have to change the coordinate systems but I am unsure how... If anyone would like to see the data I am using, I am using an Oklahoma Counties Shapefile and the Tornado Shapefile provided by NOAA. The links to each are provided below:
Oklahoma Counties Link I downloaded the statewide shapefile
Tornado Link: I downloaded the torn.zip for tornadoes from 1950-2016
How do I get these two shapefiles to overlap? I have spent hours trying to figure this and have been reading/searching other posts but but I am not getting anywhere. Any help that can be provided would be great!
There is no projection defined on the county shapefile .Use the Define projection tool to project it to the projection defined in the textfile.Its(Geographic Coordinate system,NAD1983_2011) .
Also to better help overlay them add the USA counties data from ArcGIS Online and then proceed to add the county and tornado shapefiles and it seemed to work just fine
I have attached a picture below with a definition query on the tornado file to Oklahoma city.
image1