In the quest of a geocoder service

Hi Volkert,

As far as I know there is no such library.

We have it internally, but that part is not open source. But it is not so hard to do yourself.

Here is an example for forward geocoding (address -> coordinates):

ZnClient new
url: ‘http://nominatim.openstreetmap.org/search‘;
queryAt: #format put: ‘json’;
queryAt: #addressdetails put: ‘1’;
queryAt: #q put: ‘Villerspark 5, 3500 Hasselt’;
queryAt: #countrycodes put: ‘be’;
accept: ZnMimeType applicationJson;
contentReader: [ :entity | STONJSON fromString: entity contents ];
get.

Here is an example for reverse geocoding (coordinates -> address):

ZnClient new
url: ‘http://nominatim.openstreetmap.org/reverse‘;
queryAt: #format put: ‘json’;
queryAt: #lon put: 5.33732 asString;
queryAt: #lat put: 50.926 asString;
accept: ZnMimeType applicationJson;
contentReader: [ :entity | STONJSON fromString: entity contents ];
get.

These are against the OpenStreetMap Nomatim service, others are similar.

HTH,

Sven

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: