Converting city address to approximate Longitude/Latitude

In my test application I need to convert a city address to a rough/approximate longitude/latitude coordinate…

Additionally would rather do on my own OSM server (worldmap)… (I will not be using any imaging tiles only coordinate results)

-Best way to achieve this?

-Am i correct that I have to build and OSM server and additionally another Server with Nomamintim Services…?

-Cannot the services run on one Server that that is using i.e. i9 w/ 265g ram and 4tb of storage space…?

Thank you for your help… )

Hi and welcome to OSM

Have a look at Nominatim - OpenStreetMap Wiki .

Thank you PHerison for the suggestion… but I was looking for a little more less generalized answer that addresses these questions:

i.e.

  • can both OSM (worldmap database) and Nomamintim reside on same server with enough horsepower to be efficient enough to serve the purpose of translating an address into a longitude/latitude coordinate ?

Again, thank you…)))

From your question, I think you are asking if the OSM data can be imported into both a rendering database and a geocoded/decoder database that will fit on one server. I will get to that below with a non-answer.

First, the hard part for address to lat/lon is searching for the address in the database you’ve import the OSM data into. Everything in the database has lat/lon so once you have identified the correct object it is a simple low overhead read operation.

But parsing addresses is hard. Especially if you want to do it worldwide. That is what makes Nominatim worth while. Lots of effort has gone into that.

As to the question, can one server do both rendering for map display and address lookup? You will need lots of storage for the database and map tile cache. But it also comes down to how many address queries per second you plan on dealing with, how many map tiles are served per second, and how often as well as how you plan on updating the database.

I think more information from you would be needed to answer this question.

If I read your question right, you explicitly do not want a map to display. In that case, you only need the geocoding server.

You can install a full Nominatim instance. Minimum hardware requirements for a planet are 128GB RAM and 1.5TB SSD disk (better NVME) these days, so your server is more than up to the task.

Before you do that, have a look at Photon and see if results are good enough for your application. Photon is super-easy to install on your own machine because we provide pre-computed database dumps. It’s really the go-to solution if you quickly need your private geocoding instance.

2 Likes

Thank you Ionvia for your gracious reply… )))

Yes I will NOT be using any maps/images whatsoever…
I’m only needing to convert a city into long/lat coordinate…

When you say that all i need is a Nominatim instance … to clarify… all I will need is to install Nominatim? … not OSM on the same server as well?.. or both?

Additionally thank you, I will go take a look at your suggestive source of Photon as well… )

hopefully if Nominatim will be easy enough to accomplish the task at hand without tethering via external API’s we will stick with it as the solution… )))

To address the question of the system i’m planning on running such is configuried with an intel i9 core with 256gb of RAM and a 4tb NVME… adequate?

Again thank you for your help…))) will be waiting for your answer prior to installation… )))

I think there is some confusion about what an “OSM server” is. Over at openstreetmap.org we do run a ‘OSM server’ with a huge database and complicated API. But this is only needed because openstreetmap.org is used to let everybody enter data into the database.

If you want to just use OSM data, things are much simpler. openstreetmap.org publishes so-called planet files. These are simple data files with snapshots of all the data that OSM has for the whole world at a certain point in time. If somebody wants to work with OSM data, they simply “grab a planet” and work with it. That means data users are pretty much independent from the software that runs on our main server. And they are independent from each other, too. You need geocoding? Install Nominatim and feed it the planet data. Do you want to do route planning? Get one of the routing softwares (OSRM, graphhopper, Valhalla) and they will happily consume a planet and give you an API for routing only. Do you want to display a map? Had over to switch2osm.org and learn how to set up a rendering toolchain.

Google Maps has caused many people to thing that “maps” is this one integrated thing with a map display, search, routing etc. OSM doesn’t work that way. You pick the tool for the functionality you need. (Conversely, if you want to have something integrated like Google Maps, you end up installing and running many different tools.)

So go ahead, install Nominatim on your server and you will be set.

2 Likes