[Tile-serving] [openstreetmap/osm2pgsql] Update help output. osm2pgsql doesn't accept PGPASS variable, but accepts PGPASSWORD. (#952)

Maxim Snesarev notifications at github.com
Sat Sep 21 10:07:36 UTC 2019


Oh, sorry

I'm running Debian:
```
  Operating System: Debian GNU/Linux bullseye/sid
            Kernel: Linux 5.2.0-2-amd64
      Architecture: x86-64
```

And installed osm2pgsql from Debian repo:
```
osm2pgsql --version
osm2pgsql version 1.0.0 (64 bit id space)

Compiled using the following library versions:
Libosmium 2.15.2
Lua 5.2.4

```

I think output of `osm2pgsql` with `-h` and `-h -v` is a bit misleading about environmental variable for database password: 

<details>
<summary>osm2pgsql -h</summary>

	osm2pgsql -h

	osm2pgsql version 1.0.0 (64 bit id space)
	
	Usage:
		osm2pgsql [options] planet.osm
		osm2pgsql [options] planet.osm.{pbf,gz,bz2}
		osm2pgsql [options] file1.osm file2.osm file3.osm
	
	This will import the data from the OSM file(s) into a PostgreSQL database
	suitable for use by the Mapnik renderer.
	
	    Common options:
	       -a|--append      Add the OSM file into the database without removing
	                        existing data.
	       -c|--create      Remove existing data from the database. This is the
	                        default if --append is not specified.
	       -l|--latlong     Store data in degrees of latitude & longitude.
	       -m|--merc        Store data in proper spherical mercator (default).
	       -E|--proj num    Use projection EPSG:num.
	       -s|--slim        Store temporary data in the database. This greatly
	                        reduces the RAM usage but is much slower. This switch is
	                        required if you want to update with --append later.
	       -S|--style       Location of the style file. Defaults to
	                        /usr/share/osm2pgsql/default.style.
	       -C|--cache       Use up to this many MB for caching nodes (default: 800)
	       -F|--flat-nodes  Specifies the flat file to use to persistently store node 
	                        information in slim mode instead of in PostgreSQL.
	                        This file is a single > 40Gb large file. Only recommended
	                        for full planet imports. Default is disabled.
	    
	    Database options:
	       -d|--database    The name of the PostgreSQL database to connect to.
	       -U|--username    PostgreSQL user name (specify passsword in PGPASS
	                        environment variable or use -W).
	       -W|--password    Force password prompt.
	       -H|--host        Database server host name or socket location.
	       -P|--port        Database server port.
	
	A typical command to import a full planet is
	    osm2pgsql -c -d gis --slim -C <cache size> -k \
	      --flat-nodes <flat nodes> planet-latest.osm.pbf
	where
	    <cache size> is 50000 on machines with 64GB or more RAM 
	      or about 75% of memory in MB on machines with less
	    <flat nodes> is a location where a 50+GB file can be saved.
	
	A typical command to update a database imported with the above command is
	    osmosis --rri workingDirectory=<osmosis dir> --simc --wxc - \
	      | osm2pgsql -a -d gis --slim -k --flat-nodes <flat nodes> -r xml -
	where
	    <flat nodes> is the same location as above.
	    <osmosis dir> is the location osmosis replication was initialized to.
	
	Run osm2pgsql --help --verbose (-h -v) for a full list of options.


</details>

<details>
<summary>osm2pgsql -h -v </summary>
	
		osm2pgsql -h -v 

		osm2pgsql version 1.0.0 (64 bit id space)
		
		Usage:
			osm2pgsql [options] planet.osm
			osm2pgsql [options] planet.osm.{pbf,gz,bz2}
			osm2pgsql [options] file1.osm file2.osm file3.osm
		
		This will import the data from the OSM file(s) into a PostgreSQL database
		suitable for use by the Mapnik renderer.
		
		    Common options:
		       -a|--append      Add the OSM file into the database without removing
		                        existing data.
		       -c|--create      Remove existing data from the database. This is the
		                        default if --append is not specified.
		       -l|--latlong     Store data in degrees of latitude & longitude.
		       -m|--merc        Store data in proper spherical mercator (default).
		       -E|--proj num    Use projection EPSG:num.
		       -s|--slim        Store temporary data in the database. This greatly
		                        reduces the RAM usage but is much slower. This switch is
		                        required if you want to update with --append later.
		       -S|--style       Location of the style file. Defaults to
		                        /usr/share/osm2pgsql/default.style.
		       -C|--cache       Use up to this many MB for caching nodes (default: 800)
		       -F|--flat-nodes  Specifies the flat file to use to persistently store node 
		                        information in slim mode instead of in PostgreSQL.
		                        This file is a single > 40Gb large file. Only recommended
		                        for full planet imports. Default is disabled.
		    
		    Database options:
		       -d|--database    The name of the PostgreSQL database to connect to.
		       -U|--username    PostgreSQL user name (specify passsword in PGPASS
		                        environment variable or use -W).
		       -W|--password    Force password prompt.
		       -H|--host        Database server host name or socket location.
		       -P|--port        Database server port.
		    
		    Hstore options:
		       -k|--hstore      Add tags without column to an additional hstore
		                        (key/value) column
		          --hstore-match-only   Only keep objects that have a value in one of
		                        the columns (default with --hstore is to keep all objects)
		       -j|--hstore-all  Add all tags to an additional hstore (key/value) column
		       -z|--hstore-column   Add an additional hstore (key/value) column containing
		                        all tags that start with the specified string, eg
		                        --hstore-column "name:" will produce an extra hstore
		                        column that contains all name:xx tags
		          --hstore-add-index    Add index to hstore column.
		    
		    Performance options:
		       -i|--tablespace-index    The name of the PostgreSQL tablespace where
		                        all indexes will be created.
		                        The following options allow more fine-grained control:
		          --tablespace-main-data    tablespace for main tables
		          --tablespace-main-index   tablespace for main table indexes
		          --tablespace-slim-data    tablespace for slim mode tables
		          --tablespace-slim-index   tablespace for slim mode indexes
		                        (if unset, use db's default; -i is equivalent to setting
		                        --tablespace-main-index and --tablespace-slim-index)
		          --drop        only with --slim: drop temporary tables after import 
		                        (no updates are possible).
		          --number-processes        Specifies the number of parallel processes 
		                        used for certain operations (default is 1).
		       -I|--disable-parallel-indexing   Disable indexing all tables concurrently.
		          --cache-strategy  Specifies the method used to cache nodes in ram.
		                        Available options are:
		                        dense: caching strategy optimised for full planet import
		                        chunk: caching strategy optimised for non-contiguous 
		                            memory allocation
		                        sparse: caching strategy optimised for small imports
		                        optimized: automatically combines dense and sparse 
		                            strategies for optimal storage efficiency. This may
		                            us twice as much virtual memory, but no more physical 
		                            memory.
		                        The default is "optimized"
		    
		    Expiry options:
		       -e|--expire-tiles [min_zoom-]max_zoom    Create a tile expiry list.
		                             Zoom levels must be larger than 0 and smaller
		                             than 32.
		       -o|--expire-output filename  Output filename for expired tiles list.
		          --expire-bbox-size Max size for a polygon to expire the whole polygon,
		                             not just the boundary.
		    
		    Other options:
		       -b|--bbox        Apply a bounding box filter on the imported data
		                        Must be specified as: minlon,minlat,maxlon,maxlat
		                        e.g. --bbox -0.5,51.25,0.5,51.75
		       -p|--prefix      Prefix for table names (default planet_osm)
		       -r|--input-reader    Input format.
		                        auto      - Detect file format. (default)
		                        o5m       - Parse as o5m format.
		                        xml       - Parse as OSM XML.
		                        pbf       - OSM binary format.
		       -O|--output      Output backend.
		                        pgsql - Output to a PostGIS database (default)
		                        multi - Multiple Custom Table Output to a PostGIS 
		                            database (requires style file for configuration)
		                        gazetteer - Output to a PostGIS database for Nominatim
		                        null - No output. Useful for testing. Still creates tables if --slim is specified.
		          --tag-transform-script  Specify a lua script to handle tag filtering and normalisation
		                        The script contains callback functions for nodes, ways and relations, which each
		                        take a set of tags and returns a transformed, filtered set of tags which are then
		                        written to the database.
		       -x|--extra-attributes
		                        Include attributes for each object in the database.
		                        This includes the username, userid, timestamp and version.
		                        Requires additional entries in your style file.
		       -G|--multi-geometry  Generate multi-geometry features in postgresql tables.
		       -K|--keep-coastlines Keep coastline data rather than filtering it out.
		                        By default natural=coastline tagged data will be discarded
		                        because renderers usually have shape files for them.
		          --reproject-area   compute area column using spherical mercator coordinates.
		       -h|--help        Help information.
		       -v|--verbose     Verbose output.


</details>

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/952#issuecomment-533785706
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20190921/57a141c1/attachment.html>


More information about the Tile-serving mailing list