A
A
Alexander2016-10-03 22:35:10
OpenStreetMap
Alexander, 2016-10-03 22:35:10

How to "draw" a street line on a map?

Hey!
I have a table with street names (such fields: city, street name, coordinates of some point lying on this street).
There was a task to "select" on the map (it doesn't matter - Google, Yandex or osm) a street. It is clear that you can draw a polyline, but for this you need to know the array of street coordinates? And where to get them? Or can it be automated?
I tried to extract the street database from OSM ( overpass-turbo.eu/), there is a lot of data, but the quality is a concern. I checked several random test streets: in the OSM data, they are wound up not as a single line, but as two segments.
An example of how to do it:
3189cf62e0.png
Tell me, in which direction to dig?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
Zakharov Alexander, 2016-10-04
@librown

I did a similar thing with routes on leaflet+mapbox. I won’t tell you where to get the coordinates of the streets, I had fixed routes and stopping points, but usually the lines are drawn on a separate layer. Those. you need to create a layer, find out the coordinates and draw on this layer. You can draw anything.
Here are examples for mapbox+leaflet: https://www.mapbox.com/mapbox.js/example/v1.0.0/po... (I worked with these examples live)
For google maps: https://developers. google.com/maps/documentation/j...
Here's a good article about openstreet maps: webmap-blog.ru/obzors/znakomimsya-s-otkrytoj-js-bi...
If I'm not mistaken, leaflet also works with openstreetmap. If I'm wrong - tell me, I'll remove this sentence.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question