Changes between Version 123 and Version 124 of WKTRaster/SpecificationWorking03


Ignore:
Timestamp:
Jun 16, 2011, 11:15:34 AM (13 years ago)
Author:
pracine
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • WKTRaster/SpecificationWorking03

    v123 v124  
    2525
    2626'''ST_Intersects(raster, raster)'''[[BR]]
    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.
    3232 * Each geometry of a table is rasterized as one raster. To produce a global unique raster including all the geometries of a table (loosing overlaps by the way), a user must use the planned ST_Union aggregate function to merge all the rasters together optionally in a GROUP BY query grouping some rows together.
    3333
    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.
    4040
    4141 * Alignment can be optionally specified as:[[BR]]
    4242 -A x and a y world coordinates specifying an arbitrary pixel corner. Although it can be, it IS NOT necessarily the coordinates of the upper left corner pixel.[[BR]]
    4343 -A ulx and a uly world coordinates specifying the upperleft corner of the raster. This IS NECESSARILY the upper left corner of the upperleft pixel. In this case a width and a height must also be provided.[[BR]]
    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()).
    4646
    4747 * Pixelsize can be optionally specified as:[[BR]]
    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]]
    5151 -Default is the smallest of the width or height of the extent of the source geometry divided by 250. If the smallest of the width or height of the extent of the source geometry is zero then a warning is reported an no NULL is returned.
    5252
    5353 '''Variants'''
    5454
    55  * There are many variant because we are creating a raster from scratch and we want to make it easy (serie one and four) and at the same time be flexible on the control of the raster properties (series two, three)
     55 * There are many variants because we are creating a raster from scratch. We want to make it easy (serie one and four) to convert geometries to raster and at the same time we want to have flexibility to control the resulting raster properties (series two and three).
    5656 * Variant 3, 5 and 13 are the most useful.
    5757 * Variant 6, 7, 8, 9, 10, 11, 12 are also useful.
    58  * Variant 1, 2, 4 are for useful for table containing only one raster.
    59  * All variant should be pl/pgsql variant on variant 9 which is the only which need to be implemented as a rt_pg functions..
     58 * Variant 1, 2, 4 are useful for quick conversion.
     59 * All variant should be pl/pgsql variant of variant 9 which is the only one needing to be implemented as a rt_pg functions.
    6060
    6161 * The '''first series of variant''' get their alignment from the extent of the geometry.