What does HackerNews think of photon?

an open source geocoder for openstreetmap data

Language: Java

#16 in Java
Thanks for telling me about Photon! I see that it's provided by Graphhopper, who in my experience have been absolutely excellent with technical support about Map Matching. I wish I could choose a subset instead of 53GB for the whole world so I could run it on my phone, but it's certainly realistic to run on my laptop.

https://github.com/komoot/photon

It's different software.

openstreetmap.org uses Nominatim:

https://github.com/openstreetmap/Nominatim

The photon link uses Photon:

https://github.com/komoot/photon

Nominatim processes OSM data, associating items of interest with features like town boundaries that enclose the item, or place markers that are nearby, and then is also a fairly pedantic search interface for that data.

Photon takes the data that Nominatim generates and sticks a more flexible search on top of it.

Checking for/creating an issue for Nominatim describing the address format that doesn't work well would be a useful thing to do, as global support is a goal there.

> I assume I'd be using at least a day to set things up

You assume wrong. :)

It takes an hour or so to get a tileserver up and running with the switch2osm instructions. I've done it countless times. (You do then need to wait for the Postgres database to populate, but that's just fire-and-forget.) They're written for Ubuntu LTS versions so the "newer versions" issue doesn't arise.

Or if Docker's your bag, you can get a ready-to-go image from openmaptiles: https://openmaptiles.com/server/

> where anyone can spin it up for $5/mo

Not gonna happen. Running a worldwide map server needs a lot of (SSD) storage and decent CPU. I have a £10/month Hetzner VM just to do geocoding (with Photon: https://github.com/komoot/photon) so you aren't going to get a tileserver for half that - and that's no surprise; OSM is ultimately competing with Google, and you can't really expect to host your own Google for $5. But there are plenty of hosted options with tiered pricing.

There's (justifiably) a lot of love for Mapbox in this thread as an alternative, but as remarked, their pricing isn't particularly cheap (why should it be, they sell on the quality of the product).

So the other option is to self-host tools using OpenStreetMap data. Some pointers:

* Raster tiled maps: the canonical instructions are at switch2osm.org; put it on commodity hardware such as Hetzner/OVH.

* Vector maps: a lot of development in this area at the moment and you could happily lose yourself for days among all the emerging solutions, but probably the easiest out-of-the-box solution is openmaptiles.org.

* Geocoding: Photon (https://github.com/komoot/photon) is the easiest to set up because it comes with precompiled indexes - no need to generate your own. Based on ElasticSearch, needs SSD for reasonable performance.

* Routing: OSRM (Mapbox's routing engine) and Graphhopper are both self-hostable. OSRM is very RAM-hungry, but blazingly fast.

This is just a start - there are many more options available, not least the whole stack developed by Mapzen before they shut down. The raw OSM data is downloadable from planet.openstreetmap.org (full dump) or http://download.geofabrik.de/ (regional extracts).

Worth noting as well that there are a few well-established and competitively priced indie providers based on OSM: Thunderforest (http://thunderforest.com/), Geofabrik (http://geofabrik.de/), Graphhopper (https://www.graphhopper.com/).

Photon builds nice, find as you type, free text search on top of OSM data:

https://photon.komoot.de/

I wonder if GP is talking specifically about on device apps, Photon needs a pretty big index (31 gigabytes compressed):

https://github.com/komoot/photon

Have you tried the Scout App (which the article is about)? How does its search work?

I agree that geocoding has been a problem for OSM, especially for building numbers, where the data often isn't there. But on the software side there seems to be progress recently, for instance, here are two open-source geocoders released in the last few months:

Photon, made by Komoot: https://github.com/komoot/photon, used in production at http://www.komoot.de/suggest/?&hl=en

Pelias, made by Mapzen: http://stateofthemap.us/session/pelias/, live demo at http://mapzen.com/pelias/

On building numbers, we need geocoders which can interpolate between sparse data, and then use that system to highlight where the gaps are. People tend to add data to OSM when they're confident that it's actually being used, to its full extent. If there are a hundred buildings along a road, in theory you don't need to add many of them before you can get a very good idea of where an address might be.