You can generate a mesh of, for example, 0.001 degrees on each side, and make a reverse geocoding for every point. The google geocoder service would answer with N possible addresses.
Each reverse geocoding request would have the following structure
var latlng = new google.maps.LatLng(lat, lng);
geocoder.geocode({'latLng': latlng}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
if (results[1]) {
map.setZoom(11);
marker = new google.maps.Marker({
position: latlng,
map: map
});
infowindow.setContent(results[1].formatted_address);
infowindow.open(map, marker);
} else {
alert('No results found');
}
} else {
alert('Geocoder failed due to: ' + status);
}
});
Of course, this won't be an exhaustive directory of all addresses, but it will get you a nice sample of addresses.
Btw, the geocoder has a request limit for each day, and it's also throttled on its requests per seconds capacity.
Depending on your preferred smartphone app you could use the Google Maps App and view your saved map there without having it to export as KML.
Otherwise you can skip the GPSVisualizer and export a KML from Google Maps directly when saving the direction in My Maps:
- Open a new or existing map in My Maps.
- Click the directions icon in the toolbar.
- Type your start and end locations. After, if you want, click Add Destination to add additional destinations.
After you saved your map you can export it as KML:
- Click the map menu button in the left panel.
- Select Export as KML.
- Choose the layer you want to export, or click Entire map.
- Click Export.
Best Answer
It looks like the method described on this blog post still works:
Instead of GPX, just use the KML option.