I have splitted off the places from the osm_point table and I'm wondering how the processing of diff files is going to work.

In my testsetup I have this for the points: function osm2pgsql.process_node(object) if clean_tags(object.tags) then return end

local place = object.tags.place
if place == 'city' or place == 'town' or place == 'village' or place == 'hamlet' or place == 'borough' or place == 'suburb' or place == 'quarter' or place == 'neighbourhood' then
  tables.place:add_row({ tags = object.tags })
else
  tables.point:add_row({ tags = object.tags })
end

end

so places end up in the place table and not in the points. If diffs are processed, will that work correctly? So f.e. if the place-tag is deleted from a point, will it be deleted from my place table and inserted into the point table? (I mean: the add_row() implies that only additions will be done through the process_node function...)

asked 06 Sep, 13:05

Paulosm2016's gravatar image

Paulosm2016
25125
accept rate: 0%


Yes, this will all work magically. You don't have to think about this, osm2pgsql will just handle it for you correctly. Just write your config file like there were no updated at all.

Internally what happens is that all entries in all tables derived from changed objects will be deleted and, possibly, re-added based on whats in your config file. (This is certainly not the most efficient way to do this, but the easiest. It might be handled differently in the future, so you should not rely on the details of this mechanism.)

permanent link

answered 07 Sep, 08:01

Jochen%20Topf's gravatar image

Jochen Topf
4.8k54769
accept rate: 30%

Your answer
toggle preview

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:

×248

question asked: 06 Sep, 13:05

question was seen: 103 times

last updated: 07 Sep, 08:01

powered by OSQA