5

I have a list of 2000 addresses like this:

Macquarie Park, New South Wales
Kitami, Hokkaido
Hachioji, Tokyo
Pokemon Inc. Asahi Bldg. 7F 3-2-6 Asakusabashi Taito-ku, Tokyo 111-0053 Japan
東京都港区

And I want to display them on a map without sending these addresses over the Internet.

Geocoding addresses:

  • City-level precision is OK.
  • Some addresses (like the 4th one above) contain many details, they can be skipped but it might be tricky for an algorithm to find what can be safely skipped.
  • Many addresses don't have the country name. Note that Google Maps find these without any problem, so I guess there usually is no ambiguity.
  • Places all over the world.
  • Some of the addresses use non-Latin scripts. Bonus for geocoding them too.

Output format:

  • .osm/.obf/.kml file output is OK.
  • Raw latitude/longitude output is OK too.
  • If the software insists on showing results as a map, it is OK too. I don't need very detailed maps, a map where names of cities above 100000 inhabitants are visible is enough.

Requirements:

  • Runs on my local computer (I can install any OS).
  • Easy to install, without downloading gigabytes of data.
  • Free.
  • 1
    Related: gis.stackexchange.com/questions/6/… – Deer Hunter May 14 '14 at 12:51
  • 1
    The requirement to do without downloading Gigabytes of data conflicts with the "offline" requirement. Either one or the other. – Deer Hunter May 14 '14 at 12:57
  • @DeerHunter: The question you linked to is only for the USA, unfortunately. – Nicolas Raoul May 15 '14 at 3:31
  • @DeerHunter: I am only looking for town-level precision. A database containing coordinates of all cities above 100000 inhabitants and their address matching expressions would probably fit in 100 MB. That would be enough. – Nicolas Raoul May 15 '14 at 3:32
2

This could be possible with the OpenStreetMap API, licensed under ODbL.

I haven't used it for a while, but basically you define a rectangle (bbox, bounding box) of two points (S, N, W and E). Since the maximum area of the bounding box is limited, you'd need to repeat the query for small parts of the world (where areas with a size of Germany are typically ok).

Then you define conditions of what you want to receive. For cities, place=city would be such a condition. Unfortunately the catgorization of cities may be country specific, so you need to read the documentaion and find out.

Example API query for cities in Germany (roughly, since rectangled):

http://www.overpass-api.de/api/xapi?node[bbox=5.87,47.27,15.04,55.12][place=city]

The result is quite small (155 kB) and contains relevant information:

<node id="17193023" lat="49.5981208" lon="11.0036532">
    <tag k="ele" v="279"/>
    <tag k="is_in" v="Mittelfranken,Bayern,Bundesrepublik Deutschland,Europe"/>
    <tag k="is_in:country" v="Germany"/>
    <tag k="is_in:country_code" v="DE"/>
    ...
    <tag k="name" v="Erlangen"/>
    <tag k="name:ta" v="எர்லங்கன்"/>
    ...
    <tag k="place" v="city"/>
    <tag k="population" v="105624"/>
    ...
</node>

This is an answer because:

  • city level precision is available (as described above)
  • the algorithm to find cities can be defined by you (some programming knowledge needed, though)
  • your algorithm can handle ambiguosities
  • worldwide: OSM data is really good weanwhile
  • non-latin city names supported, see example above for name:ta
  • it provides raw longitude/latitude output (see lon and lat)
  • runs on your computer (you can use any programming language that can download data via HTTP)
  • easy to install: no installation, it's a webservice
  • without downloading gigabytes of data: small amount of data, see example above
  • free: ODbL

I'm sorry that this answer still needs some custom programming, but considering the age of the question and no answers yet, I guess that your request is very specific can can only be solved like this.

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.