[postgis-devel] [PostGIS] #502: [raster] Optimize ST_Intersection to return ST_Value when intersecting with points
PostGIS
trac at osgeo.org
Thu Jan 13 12:03:43 PST 2011
#502: [raster] Optimize ST_Intersection to return ST_Value when intersecting with
points
-----------------------------+----------------------------------------------
Reporter: pracine | Owner: pracine
Type: enhancement | Status: assigned
Priority: low | Milestone: PostGIS 2.0.0
Component: postgis raster | Version: trunk
Resolution: | Keywords:
-----------------------------+----------------------------------------------
Comment(by pracine):
For this we need ST_Value to behave like ST_Intersection by returning a
SET OF 2 or 4 values when the requested coordinated fall between two
pixels or four pixels.
Actually it is more the opposite: The ST_Value variant taking a point
geometry should be "downtimized" (only 3 occurrence in Google !!) as a
wrapper around ST_Intersection so that when a point located the
intersection of 2 or 4 pixels is passed, the function returns 2 or 4
values since the right behavior is the one of ST_Intersection in this
case. For sure this would make this variant of ST_Value much slower since
ST_Intersection has to polygonize the tile first which ST_Value do not do
right now (it converts the point to a x and a y raster coordinate and
returns the value at this coordinate).
To make it to be fast, we must then first optimize ST_Intersection by
being able to polygonize a subregion of the tile (the one intersecting
with the geometry). This would generally optimize ST_Intersection for any
geometry. In the case of ST_Value this region would reduce to a maximum of
4 pixels and hence would be quite fast.
It is already possible to pass a mask to the GDAL polygonize function.
That mean we could construct a mask with the area we want to polygonize.
Would this be fast? For sure it would be more efficient to be able to just
pass x1,y2, x2,y2 to the function to delimitate this area. To see with
GDAL people.
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/502#comment:8>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-devel
mailing list