Changes between Version 34 and Version 35 of frmts_wtkraster.html
- Timestamp:
- Oct 29, 2010, 7:51:21 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
frmts_wtkraster.html
v34 v35 74 74 == '''3.1 - Loading raster data in the database''' == 75 75 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:76 The 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: 77 77 78 78 {{{ … … 90 90 }}} 91 91 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 aconsole:92 In 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: 93 93 94 94 {{{ … … 96 96 }}} 97 97 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. 99 99 100 100 '''Example 2''': 101 101 102 Load [http://dl.dropbox.com/u/6599273/katrina.tif this RGB image] (katrina.tif) on PostGIS usingloader script:102 Load [http://dl.dropbox.com/u/6599273/katrina.tif this RGB image] (katrina.tif) in PostGIS using the loader script: 103 103 104 104 {{{ … … 106 106 }}} 107 107 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: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 stored in one row of the raster table. To execute the code, type: 109 109 110 110 {{{ … … 115 115 '''Example 3''': 116 116 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.117 Using the second image (katrina.tif), you can load a lower resolution overview of the image (containing only a quarter of the pixels) in PostGIS. 118 118 119 119 {{{ … … 121 121 }}} 122 122 123 The key concepts hereare:124 * The '''-V''' flag. This flag allows loader scriptto 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.123 The 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. 125 125 * 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. 126 126 … … 140 140 }}} 141 141 142 Note that the string, u ntil the part that startswith "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).142 Note 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). 143 143 144 144 The "table" option requires the name of a WKT Raster table. This table only can be created by using the script ''gdal2tiles'', by now.