[GIS] Connecting markers by following the roads in Google Maps

google mapskmlpolyline-creation

I have many markers in a kml file. All the markers are on the roads.

I wonder if there is a way to process the data and connect the markers by following the road? Of course, the markers should not be randomly connected with each other. The point is to mark the parts of the roads that have markers on them.

I could of course just manually create the lines myself. But there are so many markers, and the data is expanded almost daily.

Best Answer

AFAIK Google Maps API won't give you access to its underlying vector data. You can use OpenStreetMap instead (which does provide its vector data, and this is often not understood by people). Unless you have vector data, there is no reliable way to match your markers with roads.

You could match each of your markers to the nearest road (using a certain distance tolerance). Then you can simply highlight the roads that have a certain density of markers.

Related Question