Open Street Map map export - openstreetmap

How to export country map, not only lines, polygons and points, but with roads, streets, etc. Tried to download this one http://download.geofabrik.de/europe/ukraine.html, but it consists only of points, lines, multipolygons.

Related

OSM get all roads for a given US county as a shapefile

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?

Tableau - Given longitude and latitude how can I count how many points fall under a certain zip code for New York?

I'm trying to count how many subway stations each zip code in NYC has. I have the longitudes and latitudes of each station but am wondering how I can relate this to zip codes? Thank you for your help!
Subway Stations on default map
You'll need some spatial data source that contains the boundaries of each zip code, such as a ESRI shapefile, GeoJSON file, KML etc. Tableau's built-in geocoding can display zip code boundaries visually, but they are not accessible for computation (unless you find a way to hack the geocoding files that ship with Tableau)
It should not be hard to find a shapefile of zip code boundaries for NYC.
Once you have that use a spatial join with the INTERSECTS operator to combine the zip code boundary data with your subway station data. If your station data is not in a spatial format, you'll need to use the MAKEPOINT() function in Tableau to convert the latitude and longitude coordinates into a spatial geometry datatype that can be used to specify your join condition.
This sounds like more work that it really is. In the end, the INTERSECTS operator will do all the work to assign each station to the correct zip code.

Mapbox: Making a line given two OSM Node IDs

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.

Visualising road segments as heatmap in Leaflet efficiently

I have data consisting of parts of road segments of a city, with different number of visits. I want to plot the data on a Map and visualise it in the form of a heatmap.
I have two related questions:
I have the data from Open Street Maps (OSM) in the form of pairs of node ID's, where node ID correspond to the unique ID being assigned to a point by OSM. I also have a mapping for each node Id to its corresponding coordinates. Is there any Leaflet or Mapbox utility or plugin, which can plot a trip / highlight the road segment using 2 node ID's. I can always do it manually (by using the coordinate mapping and converting it into GeoJSON), but the problem occurs with the line width -- I have to make it exactly overlap with the width of the road, so that it seems that I am highlighting a road segment.
Is there any plugin / utility for Leaflet or Mapbox, which can be used for plotting polylines or geojson as heatmap efficiently? My current approach is calculating the color for each polyline and encoding that as a geojson property. But the problem is that with the increase in the number of lines (> 1K) the rendering becomes a pain and the method is not feasible. There are some plugins for Leaflet out there for plotting heatmap, but all of them are for points only and not lines. Any approach using WebGL would be really great.
An approach which I thought of could be converting my data into a shape file, upload to Mapbox Studio and use as a layer directly. But I have no idea how to go about doing that i.e. creating a shapes file, encoding the information in such a way that the complete road segment gets highlighted in the correct color.

Extract Images from Bing Maps using QGIS

I have extracted shape files with polygon coordinates in geojson format for a particular area. Now I want to use this shapefile in qgis to extract individual images from Bing Maps corresponding to Polygon coordinates.
How to do that?
If you want to clip the exact area from the Polygons, i think you can't extract them from Bing Maps. You need the raw data.
On the other hand if you are just fine with an image of the area of the Maximum bounding box of your Polygons you could calculate these and than automatically clip them from the WMS server.
I had a similar problem where i downloaded several building shapefiles from Open Street Map and needed to get an image for each building from annother WMS server with aerial images (e.g.Google Satellite). In Qgis load in the Bing WMS server and your shapefiles then you can click on your specific polygon in the attribute table and zoom to this Polygon. This will set the Qgis map canvas to the Maximum Bounding Box containing your shape. Then you go to "Project" -> "Save as image" and you can save this screen as a image, tiff, png... Of course you can automate this using the Python consol:
from qgis.PyQt.QtCore import *
l=range(0,90)
for i in l:
x=int(i)
layer = iface.mapCanvas().currentLayer()
layer.select(x)
qgis.utils.iface.actionZoomToSelected().trigger()
layer.deselect(x)
name=str(x)
qgis.utils.iface.mapCanvas().saveAsImage('yourpath'+ name +'.png')