Changes between Version 34 and Version 35 of frmts_wtkraster.html


Ignore:
Timestamp:
Oct 29, 2010, 7:51:21 AM (13 years ago)
Author:
pracine
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • frmts_wtkraster.html

    v34 v35  
    7474== '''3.1 - Loading raster data in the database''' ==
    7575
    76 The GDAL PostGIS Raster driver isn't able to load raster data yet. For this, you'll have to use '''raster2pgsql''' script. This loader script is included with the PostGIS installation, in the ''raster/scripts/python'' subdirectory. To check the syntax of the script, execute this command from that subdirectory:
     76The GDAL PostGIS Raster driver does not support writing raster to the database yet. For this, you'll have to use the '''raster2pgsql''' python script. This script is included with the PostGIS installation in the ''raster/scripts/python'' subdirectory. To check the syntax of the script, execute this command from that subdirectory:
    7777
    7878{{{
     
    9090}}}
    9191
    92 In this example, the script generates a SQL output (redirected to the file ''utm.sql''). This SQL code adds the image ''utm.tif'' to PostGIS, using a regular blocking arrangement with blocks of 64x64px. A new raster table will be created and each image block will be a row of the raster table. To execute the code, you must run this command from a console:
     92In this example, the script generates a SQL output (redirected to the file ''utm.sql''). This SQL code, when executed in PostgreSQL create a new table with the image ''utm.tif''. It will be tiled as regular blocking arrangement with blocks of 64x64px. Each image block will be a row of the raster table. To execute the code in PostgreSQL, you must run this command from the console:
    9393
    9494{{{
     
    9696}}}
    9797
    98 The ''raster_database'' must be a PostgreSQL database with PostGIS Raster extension enabled. The user ''user'' must have privileges to create tables and insert values in the database.
     98''raster_database'' must be a PostgreSQL database with the PostGIS Raster extension enabled. ''user'' must have privileges to create tables and insert values in the database.
    9999
    100100'''Example 2''':
    101101
    102 Load [http://dl.dropbox.com/u/6599273/katrina.tif this RGB image] (katrina.tif) on PostGIS using loader script:
     102Load [http://dl.dropbox.com/u/6599273/katrina.tif this RGB image] (katrina.tif) in PostGIS using the loader script:
    103103
    104104{{{
     
    106106}}}
    107107
    108 As in ''Example 1'', this code generates a SQL file, called ''katrina.sql'' with the SQL code to add the image ''katrina.tif'' to PostGIS using a regular blocking arrangement with blocks of 64x64px. Again, a new raster table will created and each image block will be a row of the raster table. To execute the code, again run:
     108As in ''Example 1'', this code generates a SQL file, called ''katrina.sql'' with the SQL code to add the image ''katrina.tif'' to PostGIS using a regular blocking arrangement with blocks of 64x64px. Again, a new raster table will created and each image block will be stored in one row of the raster table. To execute the code, type:
    109109
    110110{{{
     
    115115'''Example 3''':
    116116
    117 Using the second image (katrina.tif), let's create an overview of the image of half size (meaning image dimensions, not file size) in PostGIS.
     117Using the second image (katrina.tif), you can load a lower resolution overview of the image (containing only a quarter of the pixels) in PostGIS.
    118118
    119119{{{
     
    121121}}}
    122122
    123 The key concepts here are:
    124  * The '''-V''' flag. This flag allows loader script to create a new table to store the overviews' metadata. If you want to load several images with overviews, you'll have to use this flag '''only the first time''' the loader script is called, to create the overviews' metadata table only once.
     123The key options are:
     124 * The '''-V''' flag. This flag makes the loader to create a new table to store the overviews' metadata. If you want to load several images with overviews, you'll have to use this flag '''only the first time''' the loader script is called, to create the overviews' metadata table only once.
    125125 * The '''-l 2''' flag. This flag forces the loader script to create a table with a GDAL-provided overview of the original file, with an overview factor of 2. This is, half size.
    126126
     
    140140}}}
    141141
    142 Note that the string, until the part that starts with "table='" is a libpq-style [http://www.gdal.org/ogr/drv_pg.html connection string]. That means that you can leave out unnecessary fields (like password, in some cases).
     142Note that the string, up to the part starting with "table='" is a libpq-style [http://www.gdal.org/ogr/drv_pg.html connection string]. That means that you can leave out unnecessary fields (like password, in some cases).
    143143
    144144The "table" option requires the name of a WKT Raster table. This table only can be created by using the script ''gdal2tiles'', by now.