From 48b79012853212549ebbdd5130df666bbbf3aad4 Mon Sep 17 00:00:00 2001 From: Regina Obe Date: Wed, 14 Dec 2011 10:06:31 +0000 Subject: [PATCH] Get rid of removed AddRasterTable,Column etc and replace with newer AddRasterConstraints/DropRasterConstraints git-svn-id: http://svn.osgeo.org/postgis/trunk@8402 b70326c6-7e19-0410-871a-916f4a2858ee --- doc/reference_raster.xml | 300 +++++++++++--------------------- doc/xsl/postgis_aggs_mm.xml.xsl | 2 +- 2 files changed, 104 insertions(+), 198 deletions(-) diff --git a/doc/reference_raster.xml b/doc/reference_raster.xml index e03ee08d4..3b8ae2b75 100644 --- a/doc/reference_raster.xml +++ b/doc/reference_raster.xml @@ -145,7 +145,7 @@ VALUES (1, - + reclassarg A composite type used as input into the ST_Reclass function defining the behavior of reclassification. @@ -239,141 +239,100 @@ VALUES (1, Raster Management - + - AddRasterColumn + AddRasterConstraints - deprecated: Adds a raster column to an existing table and generates column constraint on the new column to enforce srid. + Adds raster constraints to a loaded raster table for a specific column that constrains spatial ref, scaling, blocksize, alignment, bands, band type and a flag to denote if raster column is regularly blocked. The table must be loaded with data for the constraints to be inferred. Returns true of the constraint setting was accomplished and if issues a notice. - text AddRasterColumn + boolean AddRasterContraints - varchar - table_name + name + rasttable - varchar - column_name + name + rastcolumn - integer + boolean srid - varchar[] - pixel_types - - boolean - out_db - boolean - regular_blocking - - double precision[] - no_data_values - - double precision scale_x - - double precision + + boolean scale_y - integer + boolean blocksize_x - integer + boolean blocksize_y - geometry - envelope - - - - text AddRasterColumn - varchar - schema_name - - varchar - table_name - - varchar - column_name - - integer - srid - - varchar[] - pixel_types - boolean - out_db + same_alignment boolean regular_blocking - - double precision[] - no_data_values - - double precision - scale_x - - double precision - scale_y - - integer - blocksize_x - - integer - blocksize_y - - geometry - envelope - text AddRasterColumn - - varchar - catalog_name + boolean AddRasterContraints + name + rastschema - varchar - schema_name + name + rasttable - varchar - table_name + text[] + VARIADIC constraints + + + + boolean AddRasterContraints + + name + rastschema + + name + rasttable - varchar - column_name + name + rastcolumn - integer - srid + boolean + srid=true - varchar[] - pixel_types + boolean + scale_x=true boolean - out_db + scale_y=true boolean - regular_blocking + blocksize_x=true - double precision[] - no_data_values - - double precision - scale_x + boolean + blocksize_y=true - double precision - scale_y + boolean + same_alignment=true - integer - blocksize_x + boolean + regular_blocking=true - integer - blocksize_y + boolean + num_bands=true + boolean + pixel_types=true - geometry - envelope + boolean + nodata_values=true + boolean + extent=true @@ -381,65 +340,65 @@ VALUES (1, Description - Adds a raster column to an existing table and also generates constraints on the new column. Currently only constrains the SRID. - The schema_name is the name of the table schema (unused - for pre-schema PostgreSQL installations). The srid + Generates constraints on a raster column that are used to display information in the raster_columns raster catalog. + The rastschema is the name of the table schema the table resides in. The srid must be an integer value reference to an entry in the SPATIAL_REF_SYS - table. The pixel_types must be an array of pixel types as described in , one for each band. - An error is thrown if the schemaname doesn't exist - (or not visible in the current search_path) or the specified SRID, - pixel types are invalid. + table. - raster2pgsql.py loader uses this function to register raster tables + raster2pgsql loader uses this function to register raster tables - This function is deprecated and will be removed in later versions. Instead just create a raster column - using CREATE TABLE .. or ALTER TABLE .. ADD COLUMN rast raster; and then use the AddRasterConstraints function. + This function infers the constraints from the data already present in the table. As such for it to work, you must create the raster column first + and then load it with data. + + + + If you need to load more data in your tables after you have already applied constraints, you may want to run the DropRasterConstraints + if the extent of your data has changed. + Availability: 2.0.0 Examples - SELECT AddRasterColumn('public', 'myrasters', 'rast',4326, - '{8BUI,8BUI,8BUI,8BUI}', -false, true, '{255,255,255,255}', 0.25,-0.25,200,300, null); - -public.myrasters.rast -srid:4326 pixel_types:{8BUI,8BUI,8BUI,8BUI} -out_db:false -regular_blocking:true -nodata_values:'{255,255,255,255}' -scale_x:'0.25' -scale_y:'-0.25' blocksize_x:'200' blocksize_y:'300' extent:NULL - ---- After loading the data, you can currect the geometry column -UPDATE raster_columns SET extent = (SELECT ST_Union(ST_Envelope(rast)) FROM myrasters) - WHERE r_table_schema = 'public' - AND r_table_name = 'myrasters' - AND r_column = 'rast'; + CREATE TABLE myrasters(rid SERIAL primary key, rast raster); +INSERT INTO myrasters(rast) +SELECT ST_AddBand(ST_MakeEmptyRaster(1000, 1000, 0.3, -0.3, 2, 2, 0, 0,4326), 1, '8BSI', -129, NULL); + +SELECT AddRasterConstraints('myrasters', 'rast'); + + +-- verify it registered correctly in raster_columns -- +SELECT srid, scale_x, scale_y, blocksize_x, blocksize_y, num_bands, pixel_types, nodata_values + FROM raster_columns + WHERE r_table_name = 'myrasters'; + + srid | scale_x | scale_y | blocksize_x | blocksize_y | num_bands | pixel_types| nodata_values +------+---------+---------+-------------+-------------+-----------+-------------+--------------- + 4326 | 2 | 2 | 1000 | 1000 | 1 | {8BSI} | {0} See Also - , , , , + , , , , - + - DropRasterColumn + DropRasterConstraints - Obsolete: just use sql ALTER TABLE DROP COLUMN: Removes a raster column from a table. + Drops PostGIS raster constraints that refer to a raster table column. Useful if you need to reload data or update your raster column data. - text DropRasterColumn + boolean DropRasterConstraints varchar table_name @@ -481,89 +440,36 @@ UPDATE raster_columns SET extent = (SELECT ST_Union(ST_Envelope(rast)) FROM myra Description - - Obsolete and will be removed in later versions. Instead just drop the column using standard SQL. + Drops PostGIS raster constraints that refer to a raster table column that were added by . Useful if you need to load more data or update your raster column data. + You do not need to do this if you want to get rid of a raster table or a raster column. + To drop a raster table use the standard DROP TABLE mytable + To drop justa araster column and leave the rest of the table, use standard SQL ALTER TABLE mytable DROP COLUMN rast + the table will disappear from the raster_columns catalog if the column or table is dropped. However if only the constraints are dropped, the + raster column will still be listed in the raster_columns catalog, but there will be no other information about it aside from the column name and table. + Availability: 2.0.0 Examples --- NOTE this is obsolete -SELECT DropRasterColumn ('my_schema','my_raster_table','rast'); +SELECT DropRasterConstraints ('myrasters','rast'); ----RESULT output --- -my_schema.my_raster_table.rast effectively removed. - - - -- Instead do -- -ALTER TABLE my_schema.my_raster_table DROP COLUMN rast; - - - See Also +t - , - - +-- verify change in raster_columns -- +SELECT srid, scale_x, scale_y, blocksize_x, blocksize_y, num_bands, pixel_types, nodata_values + FROM raster_columns + WHERE r_table_name = 'myrasters'; - - - DropRasterTable - - Obsolete: Instead use DROP TABLE mytable. Drops a table and all its references in - raster_columns. - - - - - - text DropRasterTable - - varchar - table_name - - - - text DropRasterTable - - varchar - schema_name - - varchar - table_name - - - - text DropRasterTable - varchar - catalog_name - varchar - schema_name - varchar - table_name - - - - - - Description - - Drops a table and all its references in raster_columns. Note: - uses current_schema() on schema-aware pgsql installations if schema is - not provided. - - - - Examples - - - SELECT DropRasterTable ('my_schema','my_raster_table'); - ----RESULT output --- - my_schema.my_raster_table dropped. + srid | scale_x | scale_y | blocksize_x | blocksize_y | num_bands | pixel_types| nodata_values +------+---------+---------+-------------+-------------+-----------+-------------+--------------- + 0 | | | | | | | See Also - , + diff --git a/doc/xsl/postgis_aggs_mm.xml.xsl b/doc/xsl/postgis_aggs_mm.xml.xsl index 75f412bf4..5480be697 100644 --- a/doc/xsl/postgis_aggs_mm.xml.xsl +++ b/doc/xsl/postgis_aggs_mm.xml.xsl @@ -445,7 +445,7 @@ New geometry types: TIN and Polyhedral surfaces was introduced in 2.0 Greatly improved support for Topology. Please refer to for more details. In PostGIS 2.0, raster type and raster functionality has been integrated. There are way too many new raster functions to list here and all are new so - please refer to for more details of the raster functions available. + please refer to for more details of the raster functions available. Earlier pre-2.0 versions had raster_columns/raster_overviews as real tables. These were changed to views before release. Functions such as ST_AddRasterColumn were removed and replaced with , as a result some apps that created raster tables may need changing. Tiger Geocoder upgraded to work with TIGER 2010 census data and now included in the core PostGIS documentation. A reverse geocoder function was also added. Please refer to for more details. -- 2.50.1