Changes between Version 98 and Version 99 of WKTRaster/SpecificationWorking01
- Timestamp:
- 01/05/10 13:25:27 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WKTRaster/SpecificationWorking01
v98 v99 243 243 [[Image(WKTRasterEnvelopeConvexHullAndShape.gif)]] 244 244 245 '''ST_ConvexHull(raster) -> polygon geometry''' - Returns the minimum convex geometry that encloses every significantpixel from the raster.246 247 The resulting polygon DOES NOT TAKE the NODATA values into account. The resulting polygon enclose every pixel, even those containing NODATA values. It can be rotated or not depending on the rotation of the raster. If the raster is not rotated ST_ConvexHull(geometry) is (almost) equivalent to ST_Envelope(raster).245 '''ST_ConvexHull(raster) -> polygon geometry''' - Returns the minimum convex geometry that encloses every pixel from the raster. 246 247 The resulting polygon DOES NOT TAKE the NODATA values into account. The resulting polygon enclose every pixel, even those containing NODATA values. The resulting polygon can be rotated or not depending on the rotation of the raster. If the raster is not rotated ST_ConvexHull(geometry) is (almost) equivalent to ST_Envelope(raster) (ST_Envelope floor the coordinates and hence add a little buffer around the raster). 248 248 249 249 '''Implementation details''' … … 259 259 This function could be roughly implemented as a SQL function looking like 'SELECT ST_Collect((ST_AsPolygon(raster)).geom)'. For sure a more specialised version could be faster than ST_AsPolygon. 260 260 261 '''ST_AsPolygon(raster) -> geomval set''' - Returns a set of "geomval" value, one for each contiguousgroup of pixel sharing the same value.262 263 This is a set-returning function (SRF). A "geomval" value is a complex type composed of a polygon geometry (one for each contiguousgroup 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.261 '''ST_AsPolygon(raster) -> geomval set''' - Returns a set of "geomval" value, one for each group of pixel sharing the same value. 262 263 This is a set-returning function (SRF). A "geomval" value is a complex type composed of a polygon 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. 264 264 265 265 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_AsPolygon(). … … 290 290 [[Image(WKTRasterAsPolygon.gif)]] 291 291 292 '''ST_AsWKTPolygon(raster) -> wktgeomval set''' - Returns a set of "geomval" value, one for each contiguousgroup of pixel sharing the same value.293 294 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 contiguousgroup 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.292 '''ST_AsWKTPolygon(raster) -> wktgeomval set''' - Returns a set of "geomval" value, one for each group of pixel sharing the same value. 293 294 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. 295 295 296 296 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(). … … 355 355 ST_Intersection in conjunction with ST_Intersects is very useful for clipping geometries such as in bounding box, buffer, region queries where you only want to return that portion of a geometry that sits in a country or region of interest. 356 356 357 If you only want to compute the intersection between the convex hull of the raster without polygonising it to group of contiguouspixels sharing a common value, do:357 If you only want to compute the intersection between the convex hull of the raster without polygonising it to group of pixels sharing a common value, do: 358 358 359 359 ST_Intersection(ST_ConvexHull(raster), geometry) 360 360 361 If you only want to compute the intersection between the shape of the raster without polygonising it to group of contiguouspixels sharing a common value, do:361 If you only want to compute the intersection between the shape of the raster without polygonising it to group of pixels sharing a common value, do: 362 362 363 363 ST_Intersection(ST_Shape(raster), geometry)