Commit Graph

35 Commits

Author SHA1 Message Date
53a143d584 Split command line parser code from options
Removes all code from the options_t class and makes it into a simple
struct. All code parsing and checking the command line is now in
command-line-parser.hpp/cpp.
2023-06-28 16:19:46 +02:00
ce37bc7a53 Again, add more consts 2023-01-16 20:36:07 +01:00
7ba523ba37 Update copyright date to 2023 2023-01-15 16:13:42 +01:00
1d7ac93a83 Use parse_*_param() funcs to parse command line option parameters
Use consistently named functions parse_*_param() for all parameters of
command line options that are more complex to parse. And test them!

Also add print_version() function.
2022-12-22 10:26:47 +01:00
b6938c7834 Fix some misc code smells reported by clang-tidy 2022-10-21 14:35:52 +02:00
7766666010 Use data() instead of taking the address of the 0-th element 2022-10-21 12:06:29 +02:00
56d5145615 Updates copyright date to 2022 in all files 2022-01-11 14:30:34 +01:00
cfaa0391d9 Miscellaneous const cleanups 2021-05-27 15:59:07 +02:00
5f402c3009 Better error message when command line can not be parsed
Better error when there are no input files or when there is a problem
with a command line option.
2021-01-31 21:54:28 +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
704ade2bc2 test that options do not allow append without slim 2020-01-07 21:26:54 +01:00
b3e51388c2 Moves all src files into new src directory
Sources files (*pp) are moved into `src` directory. Also renames
taginfo_impl.hpp to taginfo-impl.hpp.

Adds a new src/CMakeLists.txt which is called from the main
CMakeLists.txt. The libosm2pgsql.a library is now built in the src
directory, but the osm2pgsql is still built in the main build directory.
2019-11-22 10:56:51 +01:00
56927b8cfb Move catch2 into contrib, update to current version
This way it can be included as system include and is easier to set apart
in coverage checks etc.
2019-11-20 12:14:00 +01:00
8859b6eb8e move new tests into place 2019-11-15 21:52:42 +01:00
3be54aacd4 move test options to catch
Removed output tests as this should be tested through output tests.
2019-11-15 21:52:41 +01:00
b89aea3db9 test-options-parse needs a DB to connect to 2019-02-28 21:00:08 +01:00
bee043b65a move export_list into c transform
Avoid having to hand in the export list on every filter call.
2019-02-10 21:54:39 +01:00
5eaaf99409 fix warnings appearing with -Wextra
This fixes pretty much exclusively unsued-parameter
warnings. Removes some function parameters which have
fallen out of use and also the permutating parameter
test. The latter did not really do what it promised
and was pretty much beyond repair.
2019-02-09 17:36:31 +01:00
39665dc961 split middle-pgsql into insert and query class
The query instance can work on a single connection. This saves
a couple of connections in the processing stage.

Requires slightly changing the behviour of the connections
that copy in the data. They need to commit, so that the
data becomes visible.

middle also needs to start the tables earlier, because
the tables must have been created when preparing queries
in the query connection.
2019-01-18 23:54:31 +01:00
b5809ed9a1 Hand outputs a shared pointer to the middle query object
Binds the lifetime of the middle objects to the outputs.
2019-01-13 12:02:47 +01:00
b7ec16d858 Split middle interface between insert query and insert
Middle has three interface classes: middle_query_t, middle_t
and slim_middle_t. They inherit from each other. This is
problematic when one wants to supply a middle implementation
that follows a similar inheritence structure.

There is actualy no need that the interfaces for inserting
(middle_t and slim_middle_t) inherit from middle_query_t.
The code is very clear about which interface is needed by
which class.

This change splits off the middle_query_t interface and
cleans up the code where the clear distinction was still
missing.

Needs some larger rework of the middle test which did rely
on being able to access both interface types. There is now
a template class for testing middle that also contains
some more common boilerplate code.
2019-01-06 19:32:44 +01:00
137650e37f make tests use new dynamic gazetteer style
Includes a test style that mimics previous behaviour, so that
test results remain the same.
2019-01-03 22:37:30 +01:00
ecbeef702a Code style fix via clang-format 2018-05-06 12:55:19 +02:00
508501808d Unit test for Return error when Lua tag transform cannot be read 2018-04-22 09:47:28 +02:00
41fd21a992 fix unit test 2018-04-01 10:38:48 +02:00
6eae9e133a Fix parsing of command line option "-e 12" (no expiry maxzoom given)
This commit also adds a bunch of unit tests for parsing the command line
option `-e`.
2018-03-21 11:58:57 +01:00
24488bfdae uint32_t for zoom level in options_t, zoom level 0 for "no tile expiry"
The constructor of expire_tiles_t expects uint32_t and the conversion to
unsigned has to happen anywhere. In addition, some more checks on the
arguments supplied by the user and a unit test for option `-e` does not harm.

This commit adapts output_pgsql_t and output_multi_t because zoom level 0
for the tile expiry now means that no expiry output is requested.
2017-04-21 15:24:40 +02:00
c49d1b91aa Merge pull request #684 from lonvia/projection-in-output
Use libosmium for geometry building
2017-03-03 03:30:38 -05:00
bdcf5d6fe7 Do not assume a default database name
Instead of defaulting to gis, the default database is unspecified,
and libpq will decide what to connect to in those cases. This will
normally rely on PGDATABASE or its compiled defaults.
2017-02-04 14:36:08 -08:00
eb9ec381a7 remove unused exclude-invalid-polygon option 2017-02-04 22:18:59 +01:00
0a6238da51 rework projection code
- make use of osmium's proj wrapper class CRS
- use virtual functions instead of switching over projection
- remove duplicate code (mainly WSG84 to mercator transformation)
- use custom projections also with --proj 4326 and 900913 (fixes #514)
2016-01-17 14:09:48 +01:00
9608e980d1 fix some warnings about int-size_t mismatch 2015-10-29 20:34:57 +05:00
34382ba8bd update to libosmium 2.3.0
- remove protobuf dependencies as libosmium now comes with its own pbf parser
- fix remaining uses of libxml2 as file format in tests
2015-08-19 00:10:31 +02:00
23c85ae885 Rename test-parse-options 2015-08-01 16:29:53 -07:00