27 | | '''ST_AsRaster(geometry, pixelsize) -> raster''' |
28 | | |
29 | | * Rasterize the provided geometry to the specified raster. |
30 | | * Implemented as a wrapper around GDAL like DumpAsPolygons does. |
31 | | * ST_AsRaster is necessary to implement ST_Intersection(geometry, raster, band) -> raster and ST_ToRaster() where the provided geometry is first rasterized to the same alignment as the other raster involved. |
| 27 | '''ST_AsRaster(geometry, pixeltype, val, nodataval, ulx, uly, width, height, pixelsizex, pixelsizey, skewx, skewy) -> raster''' |
| 28 | |
| 29 | * Rasterize the provided geometry to a raster created using the specified parameters. |
| 30 | * Implemented as a wrapper around GDAL like ST_DumpAsPolygons() does. |
| 31 | * ST_AsRaster is necessary to implement ST_Intersection(geometry, raster, band) -> raster and an eventual ST_BurnToRaster(raster, geometry) -> raster where the provided geometry is first rasterized to the same alignment as the other raster involved. |
34 | | * The raster is burned with the specified value converted (or truncated with a warning) to the provided pixeltype. The hasnodatavalue flag is set and the nodatavalue is set to the provided value (expect in variant 10 and 12). |
35 | | |
36 | | * Alignment, width, height and pixelsize are computed:[[BR]] |
37 | | -From the extent of the geometry[[BR]] |
38 | | -Imposed[[BR]] |
39 | | -From another raster |
| 34 | * The raster is burned with the specified value converted (or truncated) with a warning to the provided pixeltype. The hasnodatavalue flag of the resulting raster must be set and the nodata value is set to the provided value (expect in variant 10 and 12). |
| 35 | |
| 36 | * Alignment, width, height and pixelsize are optionally computed:[[BR]] |
| 37 | -From the vector extent of the geometry,[[BR]] |
| 38 | -Imposed with parameters,[[BR]] |
| 39 | -From another provided raster. |
44 | | -An existing raster. The x and y are derived from the provided raster and the resulting raster has the same size as the provided raster.[[BR]] |
45 | | -Default is the upper left corner of the envelope of the geometry. This might result in table where all rasters are misaligned, but this is useful when reconverting to raster a set of polygons vectorized from rasters (with ST_DumpAsPolygon() or ST_Intersection()). |
| 44 | -An existing raster. The x and y are derived from the provided raster and the resulting raster has the same ulx, uly, width and height as the provided raster. A 'CROP' option allows cropping the resulting raster to the minimal extent of the geometry keeping the x and y alignment of the provided raster.[[BR]] |
| 45 | -Default alignment is the upper left corner of the envelope of the geometry. This might result in table where all rasters are misaligned, but this is useful when reconverting to raster a set of polygons vectorized from rasters (with ST_DumpAsPolygon() or ST_Intersection()). |
48 | | -One or two floating point numbers. If only one is provided, both x and y pixel sizes are assigned the same value.[[BR]] |
49 | | -A width and a height (integers). In this case the x pixelsize is the x extent divided by the provided width and the y pixelsize is the y extent divided by the provided height. This is usefull only when the alignment is specified as the upper left corner of the raster.[[BR]] |
50 | | -“FIRST_SEGMENT_LENGTH”. The pixelsize is set to the length of the first line segment encountered in the geometry. This is practical when reconverting to raster polygons vectorized from rasters (with ST_DumpAsPolygon or ST_Intersection). In this case, all segments are of the same length which is the original raster pixel size. This is useful only when alignment is not specified. If the geometry is a point, return an error.[[BR]] |
| 48 | -One or two floating point numbers. If only one is provided, both x and y pixelsizes are assigned the same value.[[BR]] |
| 49 | -A width and a height (integers). In this case the x pixelsize is the x extent divided by the provided width and the y pixelsize is the y extent divided by the provided height. This is useful only when the alignment is specified as the upper left corner of the raster.[[BR]] |
| 50 | -“FIRST_SEGMENT_LENGTH”. The pixelsize is set to the length of the first line segment encountered in the geometry. This is useful when reconverting to raster polygons vectorized from rasters (with ST_DumpAsPolygon() or ST_Intersection()). In this case, all segments are of the same length which is the original raster pixel size. This is useful only when alignment is not specified. If the geometry is a point, return an error.[[BR]] |