Changes between Version 111 and Version 112 of WKTRaster/SpecificationWorking01
- Timestamp:
- Feb 10, 2010, 10:30:53 AM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WKTRaster/SpecificationWorking01
v111 v112 248 248 Variant 1: ST_AsPolygon(raster) -> geomval set -- default to band # 1 249 249 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 251 251 Variant 3: ST_AsPolygon(raster, 'CONTIGUOUS') -- default to band # 1 252 252 … … 258 258 259 259 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. 260 262 261 263 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: … … 276 278 '''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. 277 279 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. 279 283 280 284 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(). … … 289 293 290 294 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). 292 296 293 297 Variant 1: ST_Intersects(geometry, raster, integer) -> boolean -- the third parameter is the raster band number … … 305 309 2) If the first test returns TRUE, it checks if the geometry returned by ST_ConvexHull(raster) intersects with the geometry. 306 310 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. 308 312 309 313 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).