This adds a copyright notice to all C++ files and the README clarifying
the license. (There is no change of the license.) This also removes a
few names explicitly mentioned as copyright holders, instead refering to
the git log which has a full list of all osm2pgsql developers. (There is
also still the AUTHORS file which names the most important developers.)
The only exception is the sprompt.cpp file which was taken from
PostgreSQL and keeps its original license information (and, of course,
the files in contrib).
Osm2pgsql needs to keep track of all objects it writes into the output
tables by their id, so it can remove/update them when the database is
updated. In the flex output there were two options:
* Use tables with nodes, ways, or relations only. Then we can write
the id of those objects "as is" into those tables.
* For area tables, ways can use positive ids and relations negative
ids.
* For tables which can take more than one type of object, we use
two columns, one for the object type ("N", "W", or "R"), one for
the id.
The second option has the drawback that we need to have two columns
which might take more space and also makes some operations more
difficult. Some programs might also need a single unique id column.
So we added a new option here: Just have a single id column and,
similarly to how this is done for area tables, convert the ids.
Rather then inventing a new scheme, we use the same scheme that imposm
uses in this case: node ids stay the same (so they are positive), way
ids are negative and relation ids are negative and 1e17 is subtracted
from them. This gives distinct ranges for all ids.
To tell osm2pgsql that you want the type scheme, do not set the
"type_column" option on the ids setting in your flex Lua config.
(Before this, not setting this option meant you get the default
column name "osm_type".)
When using a table in the flex output which can take any type of OSM
object, the setting of the type_column name did not work. It always used
the default. The test only checked setting this to the default value, so
it didn't fail.
Tables that can take different OSM types have a type and an id column,
because the expire functionality needs to find and remove rows by type
and id. The query that does this was broken, so it never found anything.
This introduces a new "flex" backend which allows much more flexibility
in choosing the database format and the transformation from OSM data to
the database format. The user defines all this in a Lua script.