| 275 | This is a set-returning function (SRF). It returns a set of "geomval" representing the point set intersection of the geometry and the areas of the raster sharing a common meaningfull value (NODATA values ARE taken into account). The raster is first polygonised using ST_DumpAsPolygons(raster) and ST_Intersection(geometry, geometry) is then performed between the provided geometry and all the geometries resulting from the polygonisation of the raster. |
| 276 | |
| 277 | If the geometries do not share any space (are disjoint), then an empty geometry collection is returned. |
| 278 | |
| 279 | 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. |
| 280 | |
| 281 | 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: |
| 282 | |
| 283 | ST_Intersection(ST_ConvexHull(raster), geometry) |
| 284 | |
| 285 | 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: |
| 286 | |
| 287 | ST_Intersection(ST_Polygon(raster), geometry) |
| 288 | |
285 | | 3) ST_Intersection(geometry, raster) -> geometry -- default to band # 1 |
286 | | |
287 | | |
288 | | This is a set-returning function (SRF). It returns a set of "geomval" representing the point set intersection of the geometry and the areas of the raster sharing a common meaningfull value (NODATA values ARE taken into account). The raster is first polygonised using ST_DumpAsPolygons(raster) and ST_Intersection(geometry, geometry) is then performed between the provided geometry and all the geometries resulting from the polygonisation of the raster. |
289 | | |
290 | | If the geometries do not share any space (are disjoint), then an empty geometry collection is returned. |
291 | | |
292 | | 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. |
293 | | |
294 | | 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: |
295 | | |
296 | | ST_Intersection(ST_ConvexHull(raster), geometry) |
297 | | |
298 | | 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: |
299 | | |
300 | | ST_Intersection(ST_Polygon(raster), geometry) |
| 295 | 3) ST_Intersection(geometry, raster) -> geometry |
| 296 | |
| 297 | Variants 1 and 2 default the band number to 1. |
314 | | '''ST_SetPixelSize(raster, pixelsize)''' |
315 | | |
316 | | '''Variants''' |
317 | | |
318 | | 1) ST_SetPixelSize(raster, pixelsize) |
319 | | |
320 | | 2) ST_SetPixelSize(raster, xsize, ysize) |
321 | | |
322 | | Sets the pixel size (cell size) on the specified raster. The base method sets the X and Y pixel size to the same value. Variant 2 sets the pixel sizes to the individually specified x and y sizes. |
| 311 | '''ST_SetPixelSize(raster, pixelsize) -> raster''' |
| 312 | |
| 313 | Sets the pixel size (cell size) on the specified raster. The base method sets the X and Y pixel size to the same value. |
| 314 | |
| 315 | '''Variants''' |
| 316 | |
| 317 | 1) ST_SetPixelSize(raster, xsize, ysize) -> raster |
| 318 | |
| 319 | Variant 1 sets the pixel sizes to the individually specified x and y sizes. |
328 | | '''ST_SetGeoReference(raster, georef)''' |
329 | | |
330 | | '''Variants''' |
331 | | |
332 | | 1) ST_SetGeoReference(raster, georef, format) |
333 | | |
334 | | 2) ST_SetGeoReference(raster, georef) |
335 | | |
336 | | Sets the georeference fields of the raster (pixel size, skew, upper left location) all in one pass. The 'format' parameter is optional, and defaults to 'GDAL' georeference format if it is not specified. |
| 325 | '''ST_SetGeoReference(raster, georef text, format text) -> raster''' |
| 326 | |
| 327 | Sets all the georeference fields of the raster (pixelsize X, pixelsize Y, skew X, skew Y, upper left X, upper left Y) using the specified string. Format might be 'GDAL' or 'ESRI'. The GDAL format expect the upper left X and Y to be the upperleft corner of the upper left pixel and the ESRI format expect the upper left X and Y to be the upperleft center of the upper left pixel. |
| 328 | |
| 329 | '''Variants''' |
| 330 | |
| 331 | 1) ST_SetGeoReference(raster, georef text) -> raster |
| 332 | |
| 333 | Variant 1 default format to 'GDAL'. |
340 | | '''ST_SetSkew(raster, skewx, skewy)''' |
341 | | |
342 | | '''Variants''' |
343 | | |
344 | | 1) ST_SetSkew(raster, skewx, skewy) |
345 | | |
346 | | 2) ST_SetSkew(raster, skew) |
347 | | |
348 | | Set the skewx and the skewy of the raster's georeference. Variant 2 sets the X and Y skew to the same value. |
349 | | |
350 | | '''ST_SetUpperLeft(raster, left, top)''' |
| 337 | '''ST_SetSkew(raster, skewx, skewy) -> raster''' |
| 338 | |
| 339 | Set the skewx and the skewy of the raster's georeference. |
| 340 | |
| 341 | '''Variants''' |
| 342 | |
| 343 | 1) ST_SetSkew(raster, skew) |
| 344 | |
| 345 | Variant 1 sets the X and Y skew to the same value. |
| 346 | |
| 347 | '''ST_SetUpperLeft(raster, left, top) -> raster''' |