Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Finish removing --append and --skip-dump options #291

Merged
merged 1 commit into from
Jan 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 1 addition & 27 deletions docker/pgosm_flex.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,6 @@
from import_mode import ImportMode


APPEND_REMOVED_MSG = """----- ERROR -----

The --append option was removed in PgOSM Flex v0.7.0; use --replication.

Details: https://github.com/rustprooflabs/pgosm-flex/issues/275
"""

SKIP_DUMP_REMOVED_MSG = """----- ERROR -----

The --skip-dump option was replaced in PgOSM Flex v0.7.0 by --pg-dump.

Details: https://github.com/rustprooflabs/pgosm-flex/issues/266
"""


@click.command()
# Required and most common options first
@click.option('--ram', required=True,
Expand All @@ -47,10 +32,6 @@
@click.option('--subregion', required=False,
help='Sub-region name matching the filename for data sourced from Geofabrik. e.g. district-of-columbia')
# Remainder of options in alphabetical order
@click.option('--append',
default=False,
is_flag=True,
help=APPEND_REMOVED_MSG)
@click.option('--data-only',
default=False,
is_flag=True,
Expand Down Expand Up @@ -82,8 +63,6 @@
@click.option('--schema-name', required=False,
default='osm',
help="Change the final schema name, defaults to 'osm'.")
@click.option('--skip-dump', default=False, is_flag=True,
help=SKIP_DUMP_REMOVED_MSG)
@click.option('--skip-nested',
default=False,
is_flag=True,
Expand All @@ -95,7 +74,7 @@
help='When set, builds SP-GIST indexes on geom column instead of the default GIST indexes.')
@click.option('--update', default=None,
type=click.Choice(['append', 'create'], case_sensitive=True),
help='EXPERIMENTAL - Options: create / append. Using to wrap around osm2pgsql create v. append modes, without using osm2pgsql-replication.')
help='EXPERIMENTAL - Wrap around osm2pgsql create v. append modes, without using osm2pgsql-replication.')
def run_pgosm_flex(ram, region, subregion, append, data_only, debug,
input_file, layerset, layerset_path, language, pg_dump,
pgosm_date, replication, schema_name, skip_dump, skip_nested,
Expand All @@ -108,11 +87,6 @@ def run_pgosm_flex(ram, region, subregion, append, data_only, debug,
logger.info('PgOSM Flex starting...')

# Input validation
if append:
sys.exit(APPEND_REMOVED_MSG)
if skip_dump:
sys.exit(SKIP_DUMP_REMOVED_MSG)

if schema_name != 'osm' and replication:
err_msg = 'Replication mode with custom schema name currently not supported'
logger.error(err_msg)
Expand Down
87 changes: 45 additions & 42 deletions docs/DOCKER-RUN.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,48 +126,51 @@ Usage: pgosm_flex.py [OPTIONS]
Run PgOSM Flex within Docker to automate osm2pgsql flex processing.

Options:
--ram FLOAT Amount of RAM in GB available on the machine running
the Docker container. This is used to determine the
appropriate osm2pgsql command via osm2pgsql-tuner
recommendation engine. [required]
--region TEXT Region name matching the filename for data sourced
from Geofabrik. e.g. north-america/us. Optional when
--input-file is specified, otherwise required.
--subregion TEXT Sub-region name matching the filename for data sourced
from Geofabrik. e.g. district-of-columbia
--append Deprecated! Use --replication. --append will be
removed in 0.7.0 Details:
https://github.com/rustprooflabs/pgosm-flex/issues/275
--data-only When set, skips running Sqitch and importing QGIS
Styles.
--debug Enables additional log output
--input-file TEXT Set filename or absolute filepath to input osm.pbf
file. Overrides default file handling, archiving, and
MD5 checksum validation. Filename is assumed under
/app/output unless absolute path is used.
--layerset TEXT Layerset to load. Defines name of included layerset
unless --layerset-path is defined. [required]
--layerset-path TEXT Custom path to load layerset INI from. Custom paths
should be mounted to Docker via docker run -v ...
--language TEXT Set default language in loaded OpenStreetMap data when
available. e.g. 'en' or 'kn'.
--pgosm-date TEXT Date of the data in YYYY-MM-DD format. If today
(default), automatically downloads when files not
found locally. Set to historic date to load locally
archived PBF/MD5 file, will fail if both files do not
exist.
--replication EXPERIMENTAL - Replication mode enables updates via
osm2pgsql-replication.
--schema-name TEXT Change the final schema name, defaults to 'osm'.
--skip-dump Skips the final pg_dump at the end. Useful for local
testing when not loading into more permanent instance.
--skip-nested When set, skips calculating nested admin polygons. Can
be time consuming on large regions.
--srid TEXT SRID for data loaded by osm2pgsql to PostGIS. Defaults
to 3857
--sp-gist When set, builds SP-GIST indexes on geom column
instead of the default GIST indexes.
--help Show this message and exit.
--ram FLOAT Amount of RAM in GB available on the machine
running the Docker container. This is used to
determine the appropriate osm2pgsql command via
osm2pgsql-tuner recommendation engine. [required]
--region TEXT Region name matching the filename for data sourced
from Geofabrik. e.g. north-america/us. Optional
when --input-file is specified, otherwise
required.
--subregion TEXT Sub-region name matching the filename for data
sourced from Geofabrik. e.g. district-of-columbia
--data-only When set, skips running Sqitch and importing QGIS
Styles.
--debug Enables additional log output
--input-file TEXT Set filename or absolute filepath to input osm.pbf
file. Overrides default file handling, archiving,
and MD5 checksum validation. Filename is assumed
under /app/output unless absolute path is used.
--layerset TEXT Layerset to load. Defines name of included
layerset unless --layerset-path is defined.
[required]
--layerset-path TEXT Custom path to load layerset INI from. Custom
paths should be mounted to Docker via docker run
-v ...
--language TEXT Set default language in loaded OpenStreetMap data
when available. e.g. 'en' or 'kn'.
--pg-dump Uses pg_dump after processing is completed to
enable easily load OpenStreetMap data into a
different database
--pgosm-date TEXT Date of the data in YYYY-MM-DD format. If today
(default), automatically downloads when files not
found locally. Set to historic date to load
locally archived PBF/MD5 file, will fail if both
files do not exist.
--replication EXPERIMENTAL - Replication mode enables updates
via osm2pgsql-replication.
--schema-name TEXT Change the final schema name, defaults to 'osm'.
--skip-nested When set, skips calculating nested admin polygons.
Can be time consuming on large regions.
--srid TEXT SRID for data loaded by osm2pgsql to PostGIS.
Defaults to 3857
--sp-gist When set, builds SP-GIST indexes on geom column
instead of the default GIST indexes.
--update [append|create] EXPERIMENTAL - Wrap around osm2pgsql create v.
append modes, without using osm2pgsql-replication.
--help Show this message and exit.
```

An example of running with many of the current options.
Expand Down