Google maps lets you obtain a valid address by clicking on houses or buildings one by one, but it would be much easier if you could draw a polygon on the map and get a list of all valid addresses within it.

Here's some pseudo code:

  1. Draw a rectangular polygon on google maps.
  2. Generate a fine grid of lat/lon coordinates/points inside of the polygon (or retrieve if a function/algorithm exists).
  3. Reverse geocode all the points inside the polygon that were generated to obtain addresses for each and store the data (could be a db, array, xml, text file etc...).
  4. Read the data and filter duplicate addresses and anything that's not a valid address.
  5. Store the filtered results.

put on hold as off-topic by PolyGeo 18 hours ago

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "When seeking help to debug/write/improve code always provide the desired behavior, a specific problem/error and the shortest code (as formatted text, not pictures) needed to reproduce it in the question body. Providing a clear problem statement and a code attempt helps others to help you." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • That seems reasonable - other than you might run into service limits with your reverse geocoding engine if you have a big enough polygon and/or small enough grid spacing. I assume you don't have a vector layer (parcels or something) against which to query? You listed three different languages - do you have a preference? – deroses Jun 10 '14 at 3:13
  • @deroses "you might run into service limits with your reverse geocoding engine" --- This is a valid concern, but it can be addressed later. Perhaps by limiting the scan to a small quantity of polygons at first. --- "I assume you don't have a vector layer (parcels or something) against which to query?" --- Correct, none."three different languages - do you have a preference?" --- Not particularly. Perl would be great (not listed limited to 5 tags), but the others are ok. I can always translate the code to another language. – Juan Madrigal Jun 10 '14 at 18:07
  • 1
    What do you mean with "ALL the points in a polygon"? Are you just asking how to create a point grid? Check the source of the regular point grid tool that ships with QGIS. – underdark Jun 11 '14 at 17:55
  • All points within a polygon on google maps. These can be generated by determining a min/max lat/lon range between two parallel points (or points on parallel lines) and generating the points in between. Think of a rectangle and drawing lines from the left to the right side until its filled. Each of the lines would contain lat/long points. A grid within the polygon could work as well if you could get all the intersecting points' lat/long coordinates. – Juan Madrigal Jun 11 '14 at 20:58
  • 1
    IMHO you still need to explain what you mean with "ALL points in polygon". There is an infinity of points in a polygon, so you need to define some type of filter to select the points of interest( random, regular grid, existing features...) – radouxju Jun 17 '14 at 7:43