Google-maps – How to get the width of a road through Google Maps API

google mapsgoogle-maps-api-3

I need to find the width of roads in Google Maps.

Google Earth can't be used as it doesn't support Linux.
Streetviews cannot be used, since it is not available in the area I live.

This link: http://osdir.com/ml/google-maps-js-api-v3/2011-05/msg00666.html suggests the method of finding the distance between the two ends of the road by knowing the coordinates of both sides.

Therefore the first question is as in title.

BTW, I have managed to display the "route" between the two coordinates already on the maps.

The type of the map can be set to "satellite" view through the API.
Does that affect the distance and coordinates that'll be fetched?

Best Answer

All this stuff about getting points across the street from each other is further complicated by the fact that sometimes the geocode returned will be a ROOFTOP geocode--likely meaning the centroid of a building--and other times, it is RANGE_INTERPOLATED which suggests that it will be not very precise. See http://code.google.com/apis/maps/documentation/javascript/reference.html#GeocoderLocationType. In either case, it won't be the edge of the road.

It may be sobering to look just how far from the road Google Maps may put the marker for an address: http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=4+Clinton+Drive,+Englishtown,+NJ&aq=&sll=40.299985,-74.290066&sspn=0.009426,0.015213&gl=us&ie=UTF8&hq=&hnear=4+Clinton+Dr,+Englishtown,+New+Jersey+07726&t=h&z=16

In short, unless your use case can tolerate a pretty wide error bar, I think it's safe to say that this just isn't going to work, at least not without considerable resources at your disposal.

Google Earth web plug-in is not available for Linux, but if you don't need it to be a web page, then you can try working with Google Earth app, perhaps. It works on Linux.

If your use case is for a reasonably narrow geographical area, there may be data available elsewhere. But getting this from Google Maps API v3 is unlikely to be a very good option.

(As always when I give a "I don't think this is feasible" answer, I'd be happy for someone to come along and prove me wrong.)