Commit Graph

13 Commits

Author SHA1 Message Date
ede8880e72 Update copyright date 2025-01-13 09:07:30 +01:00
7b6ed0d2bc Use anonymous namespace instead of static in test code
This is recommended in C++ Core Guidelines SF.22
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rs-unnamed2
2024-08-15 22:24:35 +02:00
ff91d49869 Update copyright date 2024-01-26 16:45:53 +01:00
7ba523ba37 Update copyright date to 2023 2023-01-15 16:13:42 +01:00
56d5145615 Updates copyright date to 2022 in all files 2022-01-11 14:30:34 +01:00
d45018f88b Update copyright year to 2021 2021-01-28 09:38:17 +01:00
61bdfb4bc5 Add/update copyright notice on all C++ files
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).
2020-12-19 11:25:07 +01:00
1eebb1089c Add option to how flex output handles ids in output tables
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".)
2020-10-21 15:19:25 +02:00
b1bd3b15cd Bugfix: Setting of type_column in flex backend did not work
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.
2020-10-21 08:48:03 +02:00
4362106236 Cleanup and simplify uni test 2020-07-01 11:46:42 +02:00
40f67ee2a6 Fix flex backend expire for tables with type/id columns
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.
2020-06-04 09:43:37 +02:00
b6d8645094 Remove unused way nodes in test data 2020-06-03 10:07:22 +02:00
9c16722d04 New flex backend
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.
2020-02-05 19:41:00 +01:00