Changes between Version 111 and Version 112 of WKTRaster/SpecificationWorking01


Ignore:
Timestamp:
Feb 10, 2010, 10:30:53 AM (14 years ago)
Author:
pracine
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • WKTRaster/SpecificationWorking01

    v111 v112  
    248248 Variant 1: ST_AsPolygon(raster) -> geomval set -- default to band # 1
    249249
    250  Variant 2: ST_AsPolygon(raster, integer, 'CONTIGUOUS')[[BR]]
     250 Variant 2: ST_AsPolygon(raster, integer, 'CONTIGUOUS')[[BR]] -- the second parameter is the raster band number
    251251 Variant 3: ST_AsPolygon(raster, 'CONTIGUOUS') -- default to band # 1
    252252
     
    258258 
    259259 This function is at the base of the first version of ST_Intersection which compute the intersection between a raster and a geometry.
     260
     261 The "CONTIGUOUS" version could be implemented by "dumping" (see geometry_dump in PostGIS) the complex polygon into separate simple polygons.
    260262
    261263 To avoid linking directly with PostGIS (see "Why avoid to link with PostGIS?" below) It should be implemented as a SQL wrapper around ST_AsWKTPolygon() looking something like this:
     
    276278'''ST_AsWKTPolygon(raster, integer) -> wktgeomval set''' - Returns a set of "geomval" value, one for each group of pixel sharing the same value for the provided band.
    277279
    278  This is a set-returning function (SRF). A "wktgeomval " value is a complex type composed of a the wkt representation of a geometry (one for each group of pixel sharing the same value) and the value associated with this geometry. These values are always returned as a value of type double precision. The shape of each polygon follow pixels edges.
     280 Variant 1: ST_AsWKTPolygon(raster) -> wktgeomval set -- default to band # 1
     281
     282 This is a set-returning function (SRF). A "wktgeomval " value is a complex type composed of a the wkt representation of a geometry (one for each group of pixel sharing the same value) and the value associated with this geometry. These values are always returned as a value of type double precision. The shape of each polygon follow pixels edges. Areas with NODATA values are not included in the resulting set.
    279283
    280284 This function should be used with precaution on raster with float pixel type as it could return one "geomval" (or polygon) per pixel. This kind of raster should be reclassified (using the planned ST_Reclassify(raster,...) function) before using ST_AsWKTPolygon().
     
    289293
    290294
    291 '''ST_Intersects(raster, integer, geometry) -> boolean''' - Returns TRUE if the geometry and the raster "spatially intersect" - (share any portion of space) and FALSE if they don't (they are Disjoint).
     295'''ST_Intersects(raster, integer, geometry) -> boolean''' - Returns TRUE if the geometry and the raster "spatially intersect" - (share any portion of space) and FALSE if they don't (they are disjoint).
    292296
    293297 Variant 1: ST_Intersects(geometry, raster, integer) -> boolean -- the third parameter is the raster band number
     
    305309 2) If the first test returns TRUE, it checks if the geometry returned by ST_ConvexHull(raster) intersects with the geometry.
    306310
    307  3) If the second test returns TRUE, it checks if the geometry returned by ST_Shape(raster) intersects with the geometry. This test is slower since it involve the computation of the raster shape and it might involve the geometry shape.
     311 3) If the second test returns TRUE, it checks if the geometry returned by ST_Shape(raster, integer) intersects with the geometry. This test is slower since it involve the computation of the raster shape and it might involve the geometry shape. This test takes NODATA values into account. i.e. A geometry intersecting only with a NODATA value area of a raster is NOT actually not intersecting with this raster. This behavior may be controled by limiting the test to certain conditions as stated below.
    308312
    309313 Variant 4 proceeds in a very similar way except that convex hulls of both rasters are computed and compared in step 2) and both shape of raster are computed and compared in step 3).