NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hello,

I'm going to use Photon as a search engine. In a result, Photon give the id of the node / way / relation.

How can I get the associated point / roads / polygon in my OSM DB (I don't have a Nominatim DB)? Is it always -1*<id>? Am I sure to get a result?

Thanks in advance

asked 10 Jul '19, 12:41

Tim%20Autin's gravatar image

Tim Autin
16234
accept rate: 0%


  • If Photon gives you a node, it will either be in planet_osm_point with its ID, or not present at all.
  • If Photon gives you a way, it will either be in planet_osm_line with its ID, or in planet_osm_polygon with its ID, nor not present at all.
  • If Photon gives you a relation, it will either be in planet_osm_line with -ID, or in planet_osm_polygon with -ID, or not present at all.
permanent link

answered 10 Jul '19, 12:44

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Thank you very much for the very clear answer! The links between relations/line, relations/polygons, way/line & node/point are still a bit obscure to me. If a relation is updated/deleted/added, does the polygon (or line) also get updated/deleted/added?

(10 Jul '19, 12:49) Tim Autin

If you do process updates with your database (osm2pgsql -a), then yes, the polygon or line will get updated when the relation changes.

(10 Jul '19, 15:13) Frederik Ramm ♦

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

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:

×128
×92
×55
×4

question asked: 10 Jul '19, 12:41

question was seen: 2,207 times

last updated: 10 Jul '19, 15:13

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum