Coder Social home page Coder Social logo

Comments (5)

craigloftus avatar craigloftus commented on September 26, 2024

I've been thinking about addresses and I'm not sure they are as easy as pulling tags from the database. It is quite common practice to only provide a partial address, e.g., addr:housenumer=11, addr:street=Foo Road, addr:postcode=OX2 8JG. Is this enough?

My thoughts, in order of decreasing work, are 1) we do the query server-side and provide the full address in the pop-up 2) we query Nominatim from JS letting the client do the work, 3) we somehow provide a link to an external Nominatim query for the entity, and 4) we just don't display addresses, which seems like a bit of a cop out as the information is probably useful.

I think 1 is the most elegant and robust solution, but it depends whether the extra complexity is worth it. After that I would go for 3, then 2, then 4.

from brewmap.

craigloftus avatar craigloftus commented on September 26, 2024

For reference, it is pretty easy to do an address look-up for a specific entity using a query such as:

http://nominatim.openstreetmap.org/reverse?osm_type=W&osm_id=4728342

We can include "&format=json", to provide a format we can easily use in the client or server.

Probably best to not use "&addressdetails=0" as for pretty rendering of the address we're going to want to line-break on the commas.

from brewmap.

jones139 avatar jones139 commented on September 26, 2024

That's neat - I have never tried to use nominatim before - I was about to write a complicated SQL query to try to do the same, extracting the information from the place tags near it. I must add a suburb called 'Stranton' because Foggy Furze is wrong for Cameron's Brewery!
Whether to do this on the server or the client depends on how we implement it - if we are going to run it for all addresses we should do it on the server so it gets done less frequently....on second thoughts, with my database updating every 10 minutes, that is probably less load on nominatim if we do it on the client.
I think the 'best' way is to do it ourselves on our database though if feasible, then we do not load up the main OSM servers with bulk requests.

from brewmap.

jones139 avatar jones139 commented on September 26, 2024

In fact, I may just install nominatim on my server - it uses an osm2pgsql database, so I can probably run it on my server.

from brewmap.

jones139 avatar jones139 commented on September 26, 2024

Thanks Craig, I have merged your changes in and deployed them.

from brewmap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.