From: Regina Obe Date: Fri, 6 Jan 2012 16:29:39 +0000 (+0000) Subject: example of AddRasterConstraint that takes listing of constraints to apply X-Git-Tag: 2.0.0alpha1~188 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4e2fc4245d919ab88c21c14da4e7378e8d136078;p=postgis example of AddRasterConstraint that takes listing of constraints to apply git-svn-id: http://svn.osgeo.org/postgis/trunk@8687 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference_raster.xml b/doc/reference_raster.xml index 442233dce..31824e393 100644 --- a/doc/reference_raster.xml +++ b/doc/reference_raster.xml @@ -372,7 +372,20 @@ VALUES (1, table. raster2pgsql loader uses this function to register raster tables - + Valid constraint names to pass in: refer to for more details. + + blocksize sets both x and y blocksize + blocksize_x sets x blocksize (width in pixels of each tile) + blocksize_y sets y blocksize (height in pixels of each tile) + extent computes extent of whole table and applys constraint all rasters must be withint that extent + + num_bands number of bands + pixel_types reads array of pixel types for each band ensure all band n have same pixel type + regular_blocking apply informational flag to denote all tiles are regularly blocked + same_alignment ensures they all have same alignment meanign any two tiles you compare will return true for Refer to + srid ensures all have same srid + More -- any listed as inputs into the above functions + 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. @@ -387,13 +400,13 @@ VALUES (1, - Examples + Examples: Apply all possible constraints on column based on data 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'); +SELECT AddRasterConstraints('myrasters'::name, 'rast'::name); -- verify it registered correctly in raster_columns -- @@ -405,12 +418,28 @@ SELECT srid, scale_x, scale_y, blocksize_x, blocksize_y, num_bands, pixel_types, ------+---------+---------+-------------+-------------+-----------+-------------+--------------- 4326 | 2 | 2 | 1000 | 1000 | 1 | {8BSI} | {0} + + + + Examples: Apply single constraint + + CREATE TABLE public.myrasters2(rid SERIAL primary key, rast raster); +INSERT INTO myrasters2(rast) +SELECT ST_AddBand(ST_MakeEmptyRaster(1000, 1000, 0.3, -0.3, 2, 2, 0, 0,4326), 1, '8BSI', -129, NULL); + +SELECT AddRasterConstraints('public'::name, 'myrasters2'::name, 'rast'::name,'regular_blocking', 'blocksize'); +-- get notice-- +NOTICE: Adding regular blocking constraint +INFO: The regular_blocking constraint is just a flag indicating that the column "rast" is regularly blocked. It is up to the end-user to ensure that the column is truely regularly blocked. +CONTEXT: PL/pgSQL function "addrasterconstraints" line 85 at assignment +NOTICE: Adding blocksize-X constraint +NOTICE: Adding blocksize-Y constraint See Also - , , , , + ,, , , ,