Opened 13 years ago

Closed 13 years ago

#1297 closed task (fixed)

[raster] C version of raster2pgsql

Reported by: Bborie Park Owned by: Bborie Park
Priority: critical Milestone: PostGIS 2.0.0
Component: raster Version: master
Keywords: Cc:

Description

Write a replacement for the python-based raster2pgsql.py. Replacing the python version will eliminate raster's configure/build dependency on python, numpy and gdal's python bindings.

At least to get the loader into trunk before the code freeze (mid/end November), provide a loader without any overview support. Since raster2pgsql.py will still be available in raster/scripts/python, users have the option to use that script until overview building is available in SQL or in this C loader.

Change History (2)

comment:1 by Bborie Park, 13 years ago

Priority: highcritical

Usage flags for raster2pgsql.

USAGE: raster2pgsql [<options>] <raster>[ <raster>[ ...]] [[<schema>.]<table>]
OPTIONS:
  -s <srid> Set the raster's SRID. Defaults to 0.
  -b <band> Index (1-based) of band to extract from raster.  For more
      than one band index, separate with comma (,).  If unspecified,
      all bands of raster will be extracted.
  -t <tile size> Cut raster into tiles to be inserted one per
      table row.  <tile size> is expressed as WIDTHxHEIGHT.
  -R  Register the raster as an out-of-db (filesystem) raster.  Provided
      raster should have absolute path to the file
 (-d|a|c|p) These are mutually exclusive options:
     -d  Drops the table, then recreates it and populates
         it with current raster data.
     -a  Appends raster into current table, must be
         exactly the same table schema.
     -c  Creates a new table and populates it, this is the
         default if you do not specify any options.
     -p  Prepare mode, only creates the table.
  -f <column> Specify the name of the raster column
  -F  Add a column with the filename of the raster.
  -l <overview factor> Create overview of the raster.  For more than
      one factor, separate with comma(,).  Overview table name follows
      the pattern o_<overview factor>_<table>.  Created overview is
      stored in the database and is not affected by -R.
  -q  Wrap PostgreSQL identifiers in quotes.
  -I  Create a GIST spatial index on the raster column.  The ANALYZE
      command will automatically be issued for the created index.
  -M  Run VACUUM ANALYZE on the table of the raster column.  Most
      useful when appending raster to existing table with -a.
  -C  Set the standard set of constraints on the raster
      column after the rasters are loaded.  Some constraints may fail
      if one or more rasters violate the constraint.
  -x  Disable setting the max extent constraint.  Only applied if
      -C flag is also used.
  -r  Set the regular blocking constraint.  Only applied if -C flag is
      also used.
  -T <tablespace> Specify the tablespace for the new table.
      Note that indices (including the primary key) will still use
      the default tablespace unless the -X flag is also used.
  -X <tablespace> Specify the tablespace for the table's new index.
      This applies to the primary key and the spatial index if
      the -I flag is used.
  -N <nodata> Nodata value to use on bands without a nodata value.
  -E <endian> Control endianness of generated binary output of
      raster.  Use 0 for XDR and 1 for NDR (default).  Only NDR
      is supported at this time.
  -V <version> Specify version of output format.  Default
      is 0.  Only 0 is supported at this time.
  -e  Execute each statement individually, do not use a transaction.
  -Y  Use COPY statements instead of INSERT statements.
  -?  Display this help screen.

Flags were selected and named to maintain a middle-ground between those flags in raster2pgsql.py and the well-established flags of shp2pgsql.

comment:2 by Bborie Park, 13 years ago

Resolution: fixed
Status: newclosed

Committed in r8369.

Note: See TracTickets for help on using tickets.