]> granicus.if.org Git - postgis/commitdiff
break raste loder into its own data management chapter -- this chapter will expand...
authorRegina Obe <lr@pcorp.us>
Tue, 13 Dec 2011 19:15:37 +0000 (19:15 +0000)
committerRegina Obe <lr@pcorp.us>
Tue, 13 Dec 2011 19:15:37 +0000 (19:15 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@8391 b70326c6-7e19-0410-871a-916f4a2858ee

doc/Makefile.in
doc/postgis.xml
doc/reference_raster.xml
doc/using_raster_dataman.xml [new file with mode: 0644]

index 2034ef6487f6a42590b436c9331c2f443c097dbf..6c0cc2f130261e63257a3485584d7b17492168ea 100644 (file)
@@ -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
index bd5571ec119fcfec027f7b95c7203303ac05bf5b..6a1aca9e6fd0f87b00860b60437114b540271080 100644 (file)
@@ -22,6 +22,7 @@
 <!ENTITY installation SYSTEM "installation.xml">
 <!ENTITY faq SYSTEM "faq.xml">
 <!ENTITY using_postgis_dataman SYSTEM "using_postgis_dataman.xml">
+<!ENTITY using_postgis_dataman SYSTEM "using_raster_dataman.xml">
 <!ENTITY using_postgis_app SYSTEM "using_postgis_app.xml">
 <!ENTITY performance_tips SYSTEM "performance_tips.xml">
 <!ENTITY reference SYSTEM "reference.xml">
   &installation;
   &faq;
   &using_postgis_dataman;
+  &using_raster_dataman;
   &using_postgis_app;
   &performance_tips;
   &reference;
index ec2fcb9cd1fbdced2350f9bb6b56efd5eb2601af..e03ee08d4f177d00673d235bb150bddd03ba9707 100644 (file)
@@ -7,224 +7,8 @@
   functions to the raster objects which are not of use to a general
   user.</para>
   <para><varname>raster</varname> is a new PostGIS type for storing and analyzing raster data. </para>
-  <para>For more information about Raster, please refer to <ulink url="http://trac.osgeo.org/postgis/wiki/WKTRaster">PostGIS Raster Home Page</ulink>.</para>  
-  <sect1 id="RT_Loading_Rasters"> 
-    <title>Loading and Creating Rasters</title>
-    <para>For most use cases, you will create PostGIS rasters by loading existing raster files using the packaged <varname>raster2pgsql</varname> raster loader.</para>
-
-    <para>
-        The <varname>raster2pgsql.py</varname> 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 <ulink url="http://trac.osgeo.org/gdal/wiki/frmts_wtkraster.html">GDAL PostGIS Raster Driver Usage</ulink> 
-    </para>
-        
-    <variablelist>
-         <varlistentry>
-          <term>--help, -h</term>
-          <listitem>
-            <para>
-              Display help screen.
-            </para>
-          </listitem>
-        </varlistentry>
-        
-        <varlistentry>
-          <term>(c|a|d) These are mutually exclusive options:</term>
-          <listitem>
-            <para>
-              <variablelist>
-                <varlistentry>
-                  <term>-c</term>
-                  <listitem>
-                    <para>
-                      Create new table and populate it with raster(s), <emphasis>this is the default mode</emphasis>
-                    </para>
-                  </listitem>
-                </varlistentry>
-    
-                <varlistentry>
-                  <term>-a</term>
-                  <listitem>
-                    <para>
-                      Append raster(s) to an existing table.
-                    </para>
-                  </listitem>
-                </varlistentry>
-    
-                <varlistentry>
-                  <term>-d</term>
-                  <listitem>
-                    <para>
-                      Drop table, create new one and populate it with raster(s)
-                    </para>
-                  </listitem>
-                </varlistentry>
-              </variablelist>
-            </para>
-          </listitem>
-        </varlistentry>
-        
-        <varlistentry>
-            <term>-o OUTPUT, --output=OUTPUT</term>
-            <listitem><para>Specify output file, otherwise send to stdout.</para></listitem>
-        </varlistentry>
-        
-       <varlistentry>
-          <term>--version</term>
-          <listitem>
-            <para>
-              Shows program version
-            </para>
-          </listitem>
-        </varlistentry>
-        
-        <varlistentry>
-          <term>Mandatory parameters:</term>
-          <listitem>
-            <para>
-              <variablelist>
-                <varlistentry>
-                  <term>-r RASTER, --raster=RASTER</term>
-                  <listitem>
-                    <para>
-                     Append raster to list of input files, at least one raster file required. You may use wildcards (?,*) for specifying multiple files.
-                    </para>
-                  </listitem>
-                </varlistentry>
-        
-                <varlistentry>
-                  <term> -t TABLE, --table=TABLE</term>
-                  <listitem>
-                    <para>
-                        Raster destination in form of [&lt;schema&gt;.]&lt;table&gt; or base raster table for overview level>1, required
-                    </para>
-                  </listitem>
-                </varlistentry>
-              </variablelist>
-            </para>
-          </listitem>
-        </varlistentry>
-        
-        
-        <varlistentry>
-          <term>Raster processing: Optional parameters used to manipulate input raster dataset</term>
-          <listitem>
-            <para>
-              <variablelist>
-                <varlistentry>
-                    <term>-s &lt;SRID&gt;</term>
-                    <listitem>
-                        <para>
-                            Assign output raster with specified SRID.
-                        </para>
-                    </listitem>
-                </varlistentry>
-                
-                <varlistentry>
-                    <term>-b BAND, --band=BAND</term>
-                    <listitem>
-                        <para>
-                            Specify number of band to be extracted from raster.  If not specified all bands are added.
-                        </para>
-                    </listitem>
-                </varlistentry>
-                
-                <varlistentry>
-                    <term>-k BLOCK_SIZE, --block-size=BLOCK_SIZE</term>
-                    <listitem>
-                        <para>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.</para>
-                        <para>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.</para>
-                    </listitem>
-                </varlistentry>
-                
-                <varlistentry>
-                    <term>-R, --register</term>
-                    <listitem>
-                        <para>Register the raster as a filesystem (out-db) raster.</para>
-                        <para>Only the metadata of the raster and path location to the raster is stored in the database (not the pixels).</para>
-                    </listitem>
-                </varlistentry>
-                
-                <varlistentry>
-                    <term>-l OVERVIEW_LEVEL, --overview-level=OVERVIEW_LEVEL</term>
-                    <listitem><para> create overview tables named as
-                         o_&lt;LEVEL&gt;_&lt;RASTER_TABLE&gt; and populate with GDAL-provided overviews (regular blocking only)</para>
-                    </listitem>
-                </varlistentry>
-              </variablelist>
-            </para>
-          </listitem>
-        </varlistentry>
-        
-        <varlistentry>
-          <term>Optional parameters used to manipulate database objects</term>
-          <listitem>
-            <para>
-              <variablelist>            
-                <varlistentry>
-                  <term>-f COLUMN, --field=COLUMN</term>
-                  <listitem>
-                    <para>Specify name of destination raster column, default is 'rast'
-                    </para>
-                  </listitem>
-                </varlistentry>
-                
-                <varlistentry>
-                  <term>-F, --filename</term>
-                  <listitem>
-                    <para>Add a column with the name of the file</para>
-                  </listitem>
-                </varlistentry>
-                
-                <varlistentry>
-                  <term>-I</term>
-                  <listitem>
-                    <para>
-                      Create a GiST index on the raster column.
-                    </para>
-                  </listitem>
-                </varlistentry>
-                
-                <varlistentry>
-                  <term>-M, --vacuum</term>
-                  <listitem>
-                    <para>
-                      Vacuum analyze the raster table.
-                    </para>
-                  </listitem>
-                </varlistentry>
-                
-                <varlistentry>
-                  <term>-V, --create-raster-overviews</term>
-                  <listitem>
-                    <para>Create RASTER_OVERVIEWS table used to store overviews metadata.</para>
-                  </listitem>
-                </varlistentry>  
-              </variablelist>
-            </para>
-          </listitem>
-        </varlistentry>
-    
-        <varlistentry>
-            <term>-e ENDIAN, --endian=ENDIAN</term>
-            <listitem><para>Control endianness of generated binary output of raster; specify 0 for XDR and 1 for NDR (default); only NDR output is supported now</para></listitem>
-        </varlistentry>
-        
-        <varlistentry>
-            <term>-v, --verbose</term>
-            <listitem><para>Specify output file, otherwise send to stdout verbose mode. Useful for debugging</para></listitem>
-        </varlistentry>
-    </variablelist>    
-    <para>An example session using the loader to create an input file and uploading it might look like this:</para>
-        
-    <programlisting>python raster2pgsql.py -s 4269 -I -r *.tif -F -t myschema.demelevation -o elev.sql
-psql -d gisdb -f elev.sql</programlisting>
-        
-    <para>A conversion and upload can be done all in one step using UNIX pipes:</para>
-        
-    <programlisting>python raster2pgsql.py -s 4269 -I -r *.tif -F -t myschema.demelevation | psql -d gisdb</programlisting>
-    
-    
+  <para>For loading rasters from raster files please refere to <xref linkend="RT_Loading_Rasters" /></para>  
+   
     <para>For the examples in this reference we will be using a raster table of dummy rasters - Formed with the following code </para>
 <programlisting>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);</programlisting>
-  </sect1>
-  
+'EFCF9FBFDFEFEFDFCFAFEFEFE04004E627AADD16076B4F9FE6370A9F5FE59637AB0E54F58617087040046566487A1506CA2E3FA5A6CAFFBFE4D566DA4CB3E454C5665')::raster);</programlisting>  
   <sect1 id="Raster_Types">
            <title>Raster Support Data types</title>
            <sect1info>
diff --git a/doc/using_raster_dataman.xml b/doc/using_raster_dataman.xml
new file mode 100644 (file)
index 0000000..c35f4c8
--- /dev/null
@@ -0,0 +1,210 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="using_raster.xml">
+  <title>Raster Data Management and Queries</title>
+  <sect1 id="RT_Loading_Rasters"> 
+    <title>Loading and Creating Rasters</title>
+    <para>For most use cases, you will create PostGIS rasters by loading existing raster files using the packaged <varname>raster2pgsql</varname> raster loader.</para>
+
+    <para>
+        The <varname>raster2pgsql</varname> 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 <ulink url="http://trac.osgeo.org/gdal/wiki/frmts_wtkraster.html">GDAL PostGIS Raster Driver Usage</ulink> 
+    </para>
+        
+    <para>EXAMPLE USAGE: 
+       <programlisting>raster2pgsql <varname>raster_options_go_here</varname> <varname>raster_file</varname> <varname>someschema</varname>.<varname>sometable</varname> &gt; out.sql</programlisting>
+    </para>
+    <variablelist>
+         <varlistentry>
+          <term>-?</term>
+          <listitem>
+            <para>
+              Display help screen.  Help will also display if you don't pass in any arguments.
+            </para>
+          </listitem>
+        </varlistentry>
+        
+        <varlistentry>
+          <term>(c|a|d) These are mutually exclusive options:</term>
+          <listitem>
+            <para>
+              <variablelist>
+                <varlistentry>
+                  <term>-c</term>
+                  <listitem>
+                    <para>
+                      Create new table and populate it with raster(s), <emphasis>this is the default mode</emphasis>
+                    </para>
+                  </listitem>
+                </varlistentry>
+    
+                <varlistentry>
+                  <term>-a</term>
+                  <listitem>
+                    <para>
+                      Append raster(s) to an existing table.
+                    </para>
+                  </listitem>
+                </varlistentry>
+    
+                <varlistentry>
+                  <term>-d</term>
+                  <listitem>
+                    <para>
+                      Drop table, create new one and populate it with raster(s)
+                    </para>
+                  </listitem>
+                </varlistentry>
+              </variablelist>
+            </para>
+          </listitem>
+        </varlistentry>
+     
+        <varlistentry>
+          <term>Raster processing: Optional parameters used to manipulate input raster dataset</term>
+          <listitem>
+            <para>
+              <variablelist>
+               <varlistentry>
+                    <term>-C </term>
+                    <listitem>
+                        <para>
+                            Apply raster constraints -- srid, pixelsize etc. to ensure raster is properly registered in <varname>raster_columns</varname> view.
+                        </para>
+                    </listitem>
+                </varlistentry>
+                <varlistentry>
+                    <term>-s &lt;SRID&gt;</term>
+                    <listitem>
+                        <para>
+                            Assign output raster with specified SRID.
+                        </para>
+                    </listitem>
+                </varlistentry>
+                
+                <varlistentry>
+                    <term>-b BAND</term>
+                    <listitem>
+                        <para>
+                           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.
+                        </para>
+                    </listitem>
+                </varlistentry>
+                
+                <varlistentry>
+                    <term>-t TILE_SIZE</term>
+                    <listitem>
+                        Cut raster into tiles to be inserted one per table row.  <varname>TILE_SIZE</varname> is expressed as WIDTHxHEIGHT.
+                    </listitem>
+                </varlistentry>
+                
+                <varlistentry>
+                    <term>-R, --register</term>
+                    <listitem>
+                        <para>Register the raster as a filesystem (out-db) raster.</para>
+                        <para>Only the metadata of the raster and path location to the raster is stored in the database (not the pixels).</para>
+                    </listitem>
+                </varlistentry>
+                
+                <varlistentry>
+                    <term>-l <varname>OVERVIEW_FACTOR</varname></term>
+                    <listitem><para> -l <varname>overview factor</varname> Create overview of the raster.  For more than
+     one factor, separate with comma(,).  Overview table name follows
+     the pattern o_<varname>overview factor</varname>_<varname>table</varname>.  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.</para>
+                    </listitem>
+                </varlistentry>
+              </variablelist>
+            </para>
+          </listitem>
+        </varlistentry>
+        
+        <varlistentry>
+          <term>Optional parameters used to manipulate database objects</term>
+          <listitem>
+            <para>
+              <variablelist>  
+                 <varlistentry>
+                  <term>-q </term>
+                  <listitem>
+                    <para>Wrap PostgreSQL identifiers in quotes
+                    </para>
+                  </listitem>
+                </varlistentry>
+                <varlistentry>
+                  <term>-f COLUMN</term>
+                  <listitem>
+                    <para>Specify name of destination raster column, default is 'rast'
+                    </para>
+                  </listitem>
+                </varlistentry>
+                
+                <varlistentry>
+                  <term>-F</term>
+                  <listitem>
+                    <para>Add a column with the name of the file</para>
+                  </listitem>
+                </varlistentry>
+               
+                <varlistentry>
+                  <term>-I</term>
+                  <listitem>
+                    <para>
+                      Create a GiST index on the raster column.
+                    </para>
+                  </listitem>
+                </varlistentry>
+                
+                <varlistentry>
+                  <term>-M</term>
+                  <listitem>
+                    <para>
+                      Vacuum analyze the raster table.
+                    </para>
+                  </listitem>
+                </varlistentry>
+                
+                <varlistentry>
+                  <term>-T <varname>tablespace</varname></term>
+                  <listitem>
+                    <para>
+                      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.
+                    </para>
+                  </listitem>
+                </varlistentry>
+                
+              </variablelist>
+            </para>
+          </listitem>
+        </varlistentry>
+       
+        <varlistentry>
+            <term>-e</term>
+            <listitem><para>Execute each statement individually, do not use a transaction.</para></listitem>
+        </varlistentry>
+        
+        <varlistentry>
+            <term>-E ENDIAN</term>
+            <listitem><para>Control endianness of generated binary output of raster; specify 0 for XDR and 1 for NDR (default); only NDR output is supported now</para></listitem>
+        </varlistentry>
+       
+        <varlistentry>
+            <term>-V <varname>version</varname></term>
+            <listitem><para>Specify version of output format.  Default  is 0.  Only 0 is supported at this time.</para></listitem>
+        </varlistentry>
+    </variablelist>  
+    <para>An example session using the loader to create an input file and uploading it might look like this:</para>
+    <programlisting>raster2pgsql -s 4236 -I -C -M *.tif -F -t myschema.demelevation > elev.sql
+psql -d gisdb -f elev.sql</programlisting>
+        
+    <para>A conversion and upload can be done all in one step using UNIX pipes:</para>
+        
+    <programlisting>raster2pgsql -s 4236 -I -C -M *.tif -F -t myschema.demelevation | psql -d gisdb</programlisting>
+  </sect1>
+</chapter>