Ticket #501 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

[wktraster] Implement a ST_Value based on world coordinates instead of raster coordinates

Reported by: pracine Owned by: pracine
Priority: medium Milestone: WKTRaster 0.1.6
Component: raster Version: trunk
Keywords: Cc: robe

Description

The existing ST_Value function accept x and y as the raster coordinate of the pixel. It would be usefull to be able to return the value of the pixel based on world coordintes expressed in the coordinate system of the raster.

Change History

Changed 3 years ago by pracine

  • cc robe added

Any good name for this new function?

Should it be just an overload of ST_Value with float parameters:

st_value(rast raster, band integer, x float, y float)

and we understand that these params are world coordinate, not raster coordinates?

Changed 3 years ago by pracine

There will be a st_value(rast raster, band integer, pt geometry) as well...

Changed 3 years ago by robe

Pierre,

Not sure what you mean. st_value(rast raster, band integer, pt geometry)

would be the one I would use for world coordinates. The other one is totally unnecessary.

The common use case is

SELECT r.value,st_value(r.rasst, 1, ptgeom) as val FROM rastetable INNER JOIN geomtable ON ST_Intersects(rastertable.rast,1, geomtable.ptgeom);

Can't really think why one would ever want a

st_value(rast raster, band integer, x float, y float)

It would just add unnecessary confusion and function bloat to me.

Changed 3 years ago by pracine

  • status changed from new to closed
  • resolution set to fixed

Fixed in r5661

Note: See TracTickets for help on using tickets.