2

Hi,

I'm very new to OpenStreetMap but I want to build a small java program who converts Latitude and Longitude from GPS to the nearest street address. I know the basics of java so a i know how to create a GUI for input/output, so that's not the problem. I just don't know how to use OpenStreetMap API to convert the lat/long to a street address. Could anybody get me on the right track?

Thx Fred

asked 07 Apr '14, 14:51

FredGoe's gravatar image

FredGoe
41113
accept rate: 0%


One Answer:
8

The process of converting lat/lon to an address is called "Reverse Geocoding". The OSM API is not suitable for that but the Nominatim service does a decent job at reverse geocoding. All that's left for you is send a HTTP request and parse the response. Note that this is subject to usage restrictions (don't bulk geocode tons of addresses).

If you want to implement your own reverse geocoder (not recommended - lots of work to get it right) then you will probably want to import raw OSM data and preprocess it suitably. You could possibly use the Osmosis library for that (also Java).

permanent link

answered 07 Apr '14, 16:20

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
73.3k866641137
accept rate: 24%

2

Thanks for the help! You've set me on the right track :)

(08 Apr '14, 09:44) FredGoe

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×212
×166
×122
×117

question asked: 07 Apr '14, 14:51

question was seen: 26,480 times

last updated: 08 Apr '14, 10:25

powered by OSQA