diff --git a/README.md b/README.md index d7a09bb..e45ce23 100644 --- a/README.md +++ b/README.md @@ -79,10 +79,11 @@ usage: ogr2osm [-h] [--version] [-t TRANSLATION] [--encoding ENCODING] [--rounding-digits ROUNDINGDIGITS] [--significant-digits SIGNIFICANTDIGITS] [--split-ways MAXNODESPERWAY] [--id ID] [--idfile IDFILE] - [--saveid SAVEID] [-o OUTPUT] [-f] [--pbf] [--no-upload-false] - [--never-download] [--never-upload] [--locked] [--add-bounds] - [--suppress-empty-tags] [--max-tag-length MAXTAGLENGTH] - [--add-z-value-tag TAGNAME] + [--saveid SAVEID] [--positive-id] [-o OUTPUT] [-f] [--pbf] + [--no-upload-false] [--never-download] [--never-upload] + [--locked] [--add-bounds] [--suppress-empty-tags] + [--max-tag-length MAXTAGLENGTH] [--add-z-value-tag TAGNAME] + [--add-version] [--add-timestamp] DATASOURCE positional arguments: @@ -123,6 +124,8 @@ options: Defaults to 0. --idfile IDFILE Read ID to start counting from from a file. --saveid SAVEID Save last ID after execution to a file. + --positive-id Cause ID to increment. Use with care, this option can + cause problems when used inappropriately -o OUTPUT, --output OUTPUT Set destination .osm file name and location. -f, --force Force overwrite of output file. @@ -145,6 +148,12 @@ options: to 255. Values smaller than 3 disable the limit. --add-z-value-tag TAGNAME The tagname in which the z-value will be saved. + --add-version Add version to nodes, ways and relations. Use with + care, this option can cause problems when used + inappropriately + --add-timestamp Add timestamp to nodes, ways and relations. Use with + care, this option can cause problems when used + inappropriately ``` ### As a library @@ -203,6 +212,7 @@ osmdata = ogr2osm.OsmData(translation_object) # - max_points_in_way: --split-ways parameter # - add_bounds: --add-bounds parameter # - start_id: --id parameter +# - is_positive: --positive-id parameter # - z_value_tagname: --add-z-value-tag osmdata.process(datasource) @@ -215,6 +225,8 @@ datawriter = ogr2osm.OsmDataWriter(output_file) # - no_upload_false: --no-upload-false parameter # - never_download: --never-download parameter # - locked: --locked parameter +# - add_version: --add-version parameter +# - add_timestamp: --add-timestamp parameter # - significant_digits: --significant-digits parameter # - suppress_empty_tags: --suppress-empty-tags parameter # - max_tag_length: --max-tag-length parameter diff --git a/ogr2osm/ogr2osm.py b/ogr2osm/ogr2osm.py index ad6c8f2..8cbac2a 100755 --- a/ogr2osm/ogr2osm.py +++ b/ogr2osm/ogr2osm.py @@ -105,7 +105,8 @@ def parse_commandline(logger): parser.add_argument("--saveid", dest="saveid", type=str, default=None, help="Save last ID after execution to a file.") parser.add_argument("--positive-id", dest="positiveId", action="store_true", - help=argparse.SUPPRESS) # can cause problems when used inappropriately + help="Cause ID to increment. Use with care, this option can " + + "cause problems when used inappropriately") # output file options parser.add_argument("-o", "--output", dest="outputFile", metavar="OUTPUT", help="Set destination .osm file name and location.") @@ -138,9 +139,11 @@ def parse_commandline(logger): parser.add_argument("--add-z-value-tag", dest="zValueTagName", type=str, metavar="TAGNAME", help="The tagname in which the z-value will be saved.") parser.add_argument("--add-version", dest="addVersion", action="store_true", - help=argparse.SUPPRESS) # can cause problems when used inappropriately + help="Add version to nodes, ways and relations. Use with care, " + + "this option can cause problems when used inappropriately") parser.add_argument("--add-timestamp", dest="addTimestamp", action="store_true", - help=argparse.SUPPRESS) # can cause problems when used inappropriately + help="Add timestamp to nodes, ways and relations. Use with care, " + + "this option can cause problems when used inappropriately") # required source file parser.add_argument("source", metavar="DATASOURCE", help="DATASOURCE can be a file path or a org PostgreSQL connection " + diff --git a/test/basic_usage.t b/test/basic_usage.t index 1f8ff19..8dd47dd 100644 --- a/test/basic_usage.t +++ b/test/basic_usage.t @@ -10,10 +10,11 @@ usage: [--rounding-digits ROUNDINGDIGITS] [--significant-digits SIGNIFICANTDIGITS] [--split-ways MAXNODESPERWAY] [--id ID] [--idfile IDFILE] - [--saveid SAVEID] [-o OUTPUT] [-f] [--pbf] [--no-upload-false] - [--never-download] [--never-upload] [--locked] [--add-bounds] - [--suppress-empty-tags] [--max-tag-length MAXTAGLENGTH] - [--add-z-value-tag TAGNAME] + [--saveid SAVEID] [--positive-id] [-o OUTPUT] [-f] [--pbf] + [--no-upload-false] [--never-download] [--never-upload] + [--locked] [--add-bounds] [--suppress-empty-tags] + [--max-tag-length MAXTAGLENGTH] [--add-z-value-tag TAGNAME] + [--add-version] [--add-timestamp] DATASOURCE positional arguments: @@ -54,6 +55,8 @@ usage: Defaults to 0. --idfile IDFILE Read ID to start counting from from a file. --saveid SAVEID Save last ID after execution to a file. + --positive-id Cause ID to increment. Use with care, this option can + cause problems when used inappropriately -o OUTPUT, --output OUTPUT Set destination .osm file name and location. -f, --force Force overwrite of output file. @@ -76,6 +79,12 @@ usage: to 255. Values smaller than 3 disable the limit. --add-z-value-tag TAGNAME The tagname in which the z-value will be saved. + --add-version Add version to nodes, ways and relations. Use with + care, this option can cause problems when used + inappropriately + --add-timestamp Add timestamp to nodes, ways and relations. Use with + care, this option can cause problems when used + inappropriately require_output_file_when_using_db_source: $ ogr2osm "PG:dbname=test" @@ -85,10 +94,11 @@ require_output_file_when_using_db_source: [--rounding-digits ROUNDINGDIGITS] [--significant-digits SIGNIFICANTDIGITS] [--split-ways MAXNODESPERWAY] [--id ID] [--idfile IDFILE] - [--saveid SAVEID] [-o OUTPUT] [-f] [--pbf] [--no-upload-false] - [--never-download] [--never-upload] [--locked] [--add-bounds] - [--suppress-empty-tags] [--max-tag-length MAXTAGLENGTH] - [--add-z-value-tag TAGNAME] + [--saveid SAVEID] [--positive-id] [-o OUTPUT] [-f] [--pbf] + [--no-upload-false] [--never-download] [--never-upload] + [--locked] [--add-bounds] [--suppress-empty-tags] + [--max-tag-length MAXTAGLENGTH] [--add-z-value-tag TAGNAME] + [--add-version] [--add-timestamp] DATASOURCE ogr2osm: error: ERROR: An output file must be explicitly specified when using a database source [2] @@ -101,10 +111,11 @@ require_query_when_using_db_source: [--rounding-digits ROUNDINGDIGITS] [--significant-digits SIGNIFICANTDIGITS] [--split-ways MAXNODESPERWAY] [--id ID] [--idfile IDFILE] - [--saveid SAVEID] [-o OUTPUT] [-f] [--pbf] [--no-upload-false] - [--never-download] [--never-upload] [--locked] [--add-bounds] - [--suppress-empty-tags] [--max-tag-length MAXTAGLENGTH] - [--add-z-value-tag TAGNAME] + [--saveid SAVEID] [--positive-id] [-o OUTPUT] [-f] [--pbf] + [--no-upload-false] [--never-download] [--never-upload] + [--locked] [--add-bounds] [--suppress-empty-tags] + [--max-tag-length MAXTAGLENGTH] [--add-z-value-tag TAGNAME] + [--add-version] [--add-timestamp] DATASOURCE ogr2osm: error: ERROR: You must specify a query with --sql when using a database source [2] @@ -144,10 +155,11 @@ duplicatefile: [--rounding-digits ROUNDINGDIGITS] [--significant-digits SIGNIFICANTDIGITS] [--split-ways MAXNODESPERWAY] [--id ID] [--idfile IDFILE] - [--saveid SAVEID] [-o OUTPUT] [-f] [--pbf] [--no-upload-false] - [--never-download] [--never-upload] [--locked] [--add-bounds] - [--suppress-empty-tags] [--max-tag-length MAXTAGLENGTH] - [--add-z-value-tag TAGNAME] + [--saveid SAVEID] [--positive-id] [-o OUTPUT] [-f] [--pbf] + [--no-upload-false] [--never-download] [--never-upload] + [--locked] [--add-bounds] [--suppress-empty-tags] + [--max-tag-length MAXTAGLENGTH] [--add-z-value-tag TAGNAME] + [--add-version] [--add-timestamp] DATASOURCE ogr2osm: error: ERROR: output file '.*basic_geometries.osm' exists (re) [2]