Changes between Version 34 and Version 35 of WKTRasterTutorial01
- Timestamp:
- 06/11/10 10:53:55 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WKTRasterTutorial01
v34 v35 100 100 The -k option specify the size of the tiles we want to load in PostGIS. Every input raster will be split into 100x100 tiles. This dimension is a good compromise allowing efficient raster/vector analysis. It is better if the size of the tiles is a divider of the size of each raster. Otherwise the last colomns and rows of tiles of each raster will be filled with nodata values. This might have an impact on performance but not on the result since WKT Raster analysis functions ignore nodata values. 101 101 102 The -I option tells the loader to create a spatial index on the raster tile table. If you forget to add this option you can always add the index afterward by executing a SQL command similar to this one in pgAdmin III: 102 The -I option tells the loader to create a spatial index on the raster tile table. The index is very important as it allow PostGIS WKT Raster to restrict his computing efforts only to the tiles involved in a spatial operation. In this tutorial for example, the intersection operations will be performed only on the tiles that actually intersects with the caribou points and it is much faster to search for those tiles if they are spatially indexed than try them one after the other sequentially in the raster table. 103 104 The result of the gdal2wktraster.py command is a 1.8 GB .sql file produced in about one minute (on my brand new Lenovo X201 labtop - Intel Core i5, 1.17 GHz, 3GB of RAM :-). 105 106 The same way we loaded the caribou point sql command file, we will load this sql file using "psql": 107 108 {{{ 109 >"C:/Program Files/PostgreSQL/8.4/bin/psql" -f C:\Temp\TutData\SRTM\srtm.sql tutorial01 110 }}} 111 112 This process took less than 4 minutes. You can quickly verify the success of the loading operation by looking at the number of row present in the "srtm_tiled" table. There should be 46800 rows. 113 114 If you forgot to add the -I opion to gdal2wktraster.py, you can always add the index afterward by executing a SQL command similar to this one in pgAdmin III: 103 115 104 116 {{{ 105 117 CREATE INDEX srtm_tiled_gist_idx ON srtm_tiled USING GIST (ST_ConvexHull(rast)); 106 118 }}} 107 108 The result of the gdal2wktraster.py command is a 1.8 GB .sql file produced in about one minute (on my brand new Lenovo X201 labtop - Intel Core i5, 1.17 GHz, 3GB of RAM :-).109 110 The same way we loaded the caribou point sql command file, we will load this sql file using "psql":111 112 {{{113 >"C:/Program Files/PostgreSQL/8.4/bin/psql" -f C:\Temp\TutData\SRTM\srtm.sql tutorial01114 }}}115 116 This process took less than 4 minutes. You can quickly verify the success of the loading operation by looking at the number of row present in the "srtm_tiled" table. There should be 46800 rows.117 119 118 120 You can then visualize the extent of each of those 46800 raster tiles by typing the following command in the OpenJUMP "Run Datastore Query" dialog: