From a59ccb741b77b63705662f11b450e12917484152 Mon Sep 17 00:00:00 2001 From: Regina Obe Date: Tue, 13 Dec 2011 19:15:37 +0000 Subject: [PATCH] break raste loder into its own data management chapter -- this chapter will expand in time. Get rid of how to use old raster2pgsql.py and replace with instructions on using raster2pgsql executable. git-svn-id: http://svn.osgeo.org/postgis/trunk@8391 b70326c6-7e19-0410-871a-916f4a2858ee --- doc/Makefile.in | 2 +- doc/postgis.xml | 2 + doc/reference_raster.xml | 224 +---------------------------------- doc/using_raster_dataman.xml | 210 ++++++++++++++++++++++++++++++++ 4 files changed, 216 insertions(+), 222 deletions(-) create mode 100644 doc/using_raster_dataman.xml diff --git a/doc/Makefile.in b/doc/Makefile.in index 2034ef648..6c0cc2f13 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -88,7 +88,7 @@ tiger_geocoder_comments.sql: ./xsl/tiger_geocoder_comments.sql.xsl postgis.xml p tiger_geocoder_cheatsheet.html: ./xsl/tiger_geocoder_cheatsheet.html.xsl postgis.xml postgis_aggs_mm.xml $(XSLTPROC) ./xsl/tiger_geocoder_cheatsheet.html.xsl postgis.xml > $@ -postgis-out.xml: postgis.xml introduction.xml installation.xml faq.xml using_postgis_dataman.xml using_postgis_app.xml performance_tips.xml reference.xml reference_management.xml reference_constructor.xml reference_accessor.xml reference_editor.xml reference_output.xml reference_operator.xml reference_measure.xml reference_processing.xml reference_lrs.xml reference_transaction.xml reference_misc.xml reference_exception.xml extras.xml extras_topology.xml extras_tigergeocoder.xml extras_historytable.xml postgis_aggs_mm.xml reference_raster.xml faq_raster.xml reporting.xml release_notes.xml ../Version.config +postgis-out.xml: postgis.xml introduction.xml installation.xml faq.xml using_postgis_dataman.xml using_raster_dataman.xml using_postgis_app.xml performance_tips.xml reference.xml reference_management.xml reference_constructor.xml reference_accessor.xml reference_editor.xml reference_output.xml reference_operator.xml reference_measure.xml reference_processing.xml reference_lrs.xml reference_transaction.xml reference_misc.xml reference_exception.xml extras.xml extras_topology.xml extras_tigergeocoder.xml extras_historytable.xml postgis_aggs_mm.xml reference_raster.xml faq_raster.xml reporting.xml release_notes.xml ../Version.config cat $< | sed "s/@@LAST_RELEASE_VERSION@@/${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}/g" > $@ chunked-html: postgis-out.xml images diff --git a/doc/postgis.xml b/doc/postgis.xml index bd5571ec1..6a1aca9e6 100644 --- a/doc/postgis.xml +++ b/doc/postgis.xml @@ -22,6 +22,7 @@ + @@ -140,6 +141,7 @@ &installation; &faq; &using_postgis_dataman; + &using_raster_dataman; &using_postgis_app; &performance_tips; &reference; diff --git a/doc/reference_raster.xml b/doc/reference_raster.xml index ec2fcb9cd..e03ee08d4 100644 --- a/doc/reference_raster.xml +++ b/doc/reference_raster.xml @@ -7,224 +7,8 @@ functions to the raster objects which are not of use to a general user. raster is a new PostGIS type for storing and analyzing raster data. - For more information about Raster, please refer to PostGIS Raster Home Page. - - - Loading and Creating Rasters - For most use cases, you will create PostGIS rasters by loading existing raster files using the packaged raster2pgsql raster loader. - - - The raster2pgsql.py is a raster loader python script that utilizes Python, PyGDAL, and NumPy to convert any GDAL supported raster format into sql suitable for loading into a PostGIS raster table. - It is capable of loading folders of raster files as well as creating overviews of rasters. More usage examples can be found at GDAL PostGIS Raster Driver Usage - - - - - --help, -h - - - Display help screen. - - - - - - (c|a|d) These are mutually exclusive options: - - - - - -c - - - Create new table and populate it with raster(s), this is the default mode - - - - - - -a - - - Append raster(s) to an existing table. - - - - - - -d - - - Drop table, create new one and populate it with raster(s) - - - - - - - - - - -o OUTPUT, --output=OUTPUT - Specify output file, otherwise send to stdout. - - - - --version - - - Shows program version - - - - - - Mandatory parameters: - - - - - -r RASTER, --raster=RASTER - - - Append raster to list of input files, at least one raster file required. You may use wildcards (?,*) for specifying multiple files. - - - - - - -t TABLE, --table=TABLE - - - Raster destination in form of [<schema>.]<table> or base raster table for overview level>1, required - - - - - - - - - - - Raster processing: Optional parameters used to manipulate input raster dataset - - - - - -s <SRID> - - - Assign output raster with specified SRID. - - - - - - -b BAND, --band=BAND - - - Specify number of band to be extracted from raster. If not specified all bands are added. - - - - - - -k BLOCK_SIZE, --block-size=BLOCK_SIZE - - Cut raster(s) into tiles to be inserted one by table row.BLOCK_SIZE is expressed as WIDTHxHEIGHT. Incomplete tiles are completed with nodata values. - Each tile is stored as a separate record in the raster table. If no block size is specified, then each raster file is brought in as an individual record. - - - - - -R, --register - - Register the raster as a filesystem (out-db) raster. - Only the metadata of the raster and path location to the raster is stored in the database (not the pixels). - - - - - -l OVERVIEW_LEVEL, --overview-level=OVERVIEW_LEVEL - create overview tables named as - o_<LEVEL>_<RASTER_TABLE> and populate with GDAL-provided overviews (regular blocking only) - - - - - - - - - Optional parameters used to manipulate database objects - - - - - -f COLUMN, --field=COLUMN - - Specify name of destination raster column, default is 'rast' - - - - - - -F, --filename - - Add a column with the name of the file - - - - - -I - - - Create a GiST index on the raster column. - - - - - - -M, --vacuum - - - Vacuum analyze the raster table. - - - - - - -V, --create-raster-overviews - - Create RASTER_OVERVIEWS table used to store overviews metadata. - - - - - - - - - -e ENDIAN, --endian=ENDIAN - Control endianness of generated binary output of raster; specify 0 for XDR and 1 for NDR (default); only NDR output is supported now - - - - -v, --verbose - Specify output file, otherwise send to stdout verbose mode. Useful for debugging - - - An example session using the loader to create an input file and uploading it might look like this: - - python raster2pgsql.py -s 4269 -I -r *.tif -F -t myschema.demelevation -o elev.sql -psql -d gisdb -f elev.sql - - A conversion and upload can be done all in one step using UNIX pipes: - - python raster2pgsql.py -s 4269 -I -r *.tif -F -t myschema.demelevation | psql -d gisdb - - + For loading rasters from raster files please refere to + For the examples in this reference we will be using a raster table of dummy rasters - Formed with the following code CREATE TABLE dummy_rast(rid integer, rast raster); INSERT INTO dummy_rast(rid, rast) @@ -257,9 +41,7 @@ VALUES (1, -- Raster: 5 x 5 pixels, 3 bands, PT_8BUI pixel type, NODATA = 0 (2, ('01000003009A9999999999A93F9A9999999999A9BF000000E02B274A' || '41000000007719564100000000000000000000000000000000FFFFFFFF050005000400FDFEFDFEFEFDFEFEFDF9FAFEF' || -'EFCF9FBFDFEFEFDFCFAFEFEFE04004E627AADD16076B4F9FE6370A9F5FE59637AB0E54F58617087040046566487A1506CA2E3FA5A6CAFFBFE4D566DA4CB3E454C5665')::raster); - - +'EFCF9FBFDFEFEFDFCFAFEFEFE04004E627AADD16076B4F9FE6370A9F5FE59637AB0E54F58617087040046566487A1506CA2E3FA5A6CAFFBFE4D566DA4CB3E454C5665')::raster); Raster Support Data types diff --git a/doc/using_raster_dataman.xml b/doc/using_raster_dataman.xml new file mode 100644 index 000000000..c35f4c8d9 --- /dev/null +++ b/doc/using_raster_dataman.xml @@ -0,0 +1,210 @@ + + + Raster Data Management and Queries + + Loading and Creating Rasters + For most use cases, you will create PostGIS rasters by loading existing raster files using the packaged raster2pgsql raster loader. + + + The raster2pgsql is a raster loader executable that loads GDAL supported raster formats into sql suitable for loading into a PostGIS raster table. + It is capable of loading folders of raster files as well as creating overviews of rasters. + + Note that the older version of this tool waas a python script. The executable has replaced the python script. If you still find the need for the Python script + Examples of the pyhton one can be found at GDAL PostGIS Raster Driver Usage + + + EXAMPLE USAGE: + raster2pgsql raster_options_go_here raster_file someschema.sometable > out.sql + + + + -? + + + Display help screen. Help will also display if you don't pass in any arguments. + + + + + + (c|a|d) These are mutually exclusive options: + + + + + -c + + + Create new table and populate it with raster(s), this is the default mode + + + + + + -a + + + Append raster(s) to an existing table. + + + + + + -d + + + Drop table, create new one and populate it with raster(s) + + + + + + + + + + Raster processing: Optional parameters used to manipulate input raster dataset + + + + + -C + + + Apply raster constraints -- srid, pixelsize etc. to ensure raster is properly registered in raster_columns view. + + + + + -s <SRID> + + + Assign output raster with specified SRID. + + + + + + -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 + + Register the raster as a filesystem (out-db) raster. + Only the metadata of the raster and path location to the raster is stored in the database (not the pixels). + + + + + -l OVERVIEW_FACTOR + -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. Note that your generated sql file will contain both the main table and overview tables. + + + + + + + + + Optional parameters used to manipulate database objects + + + + + -q + + Wrap PostgreSQL identifiers in quotes + + + + + -f COLUMN + + Specify name of destination raster column, default is 'rast' + + + + + + -F + + Add a column with the name of the file + + + + + -I + + + Create a GiST index on the raster column. + + + + + + -M + + + Vacuum analyze the raster table. + + + + + + -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. + + + + + + + + + + + -e + Execute each statement individually, do not use a transaction. + + + + -E ENDIAN + Control endianness of generated binary output of raster; specify 0 for XDR and 1 for NDR (default); only NDR output is supported now + + + + -V version + Specify version of output format. Default is 0. Only 0 is supported at this time. + + + An example session using the loader to create an input file and uploading it might look like this: + raster2pgsql -s 4236 -I -C -M *.tif -F -t myschema.demelevation > elev.sql +psql -d gisdb -f elev.sql + + A conversion and upload can be done all in one step using UNIX pipes: + + raster2pgsql -s 4236 -I -C -M *.tif -F -t myschema.demelevation | psql -d gisdb + + + -- 2.40.0