1

I have several polygon shapes inside a City in Germany. I need to generate Point data of houses inside those Polygons. It is very time consuming to add all the building Locations manually. I am wondering, if it is possible to extract the Point for all address somehow from Google maps as XML or kml Format.

For your Kind information, I do not have any Point data. I need to generate it somehow using Google map or Google earth from geocoded address. That is now the main challenge for me.

  • 2
    Rereading your post I think you are asking about getting address data out of Google Maps and I don't think you will be able to do that unless you have a source for the address data. You might try contacting the specific municipal government in Germany and see if you can get address points from them. – jbchurchill Oct 7 '14 at 14:44
2

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.

2

here.com's API can, supposedly, give you up to 100 addresses within a circle.

This is how I create the URL for the API call

function makeURL ( point, radius) {
    return 'http://reverse.geocoder.cit.api.here.com/6.2/reversegeocode.json'
        + '?app_id='+config.Here.App_Id
        + '&app_code='+config.Here.App_Code
        + '&mode=retrieveAddresses'
        + '&gen=7'
        + '&prox='+point.lat+'%2C'+point.lng+'%2C'+radius
        + '&maxresults='+config.Here.limit;
}

I'm using this to step over my polygon and try to get all the addresses.

I say supposedly, because I have noticed that there are addresses missed by this call, I haven't figure out why yet..., but seems to be better than grabbing one per point.

  • Is there a way though to stay within the confines of a set of polygon coordinates? – Jared Eitnier Feb 28 '15 at 5:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.