[postgis-users] PostGIS Raster efficient enough to get height given coords from a large DEM?
Bborie Park
bkpark at ucdavis.edu
Fri Dec 2 08:46:33 PST 2011
On Fri, Dec 2, 2011 at 8:15 AM, Stefan Keller <sfkeller at gmail.com> wrote:
> In a server side program I'd like to get the height given a 2D lat/lon
> coordinate.
>
> The area covered is smaller than Europe with a resolution of at least
> 25m. We'll take ASTER or SRTM as DEM/DTM data.
>
> I know there are webservices like geonames' Elevation API (e.g.
> http://api.geonames.org/astergdem?lat=50.01&lng=10.2&username=demo ).
> But I'd like to know if this is feasible using PostgreSQL.
>
> Is PostGIS Raster efficient enough to process and query such an amount of data?
> Any experiences?
>
Stefan,
Assuming you test to see what the ideal (or "good-enough") tile size
is for the elevation rasterset, you should see good performance using
ST_Value(rast, ST_SetSRID(ST_MakePoint(long, lat), srid))
You could eliminate the ST_SetSRID and ST_MakePoint by passing a
correct EWKT instead
ST_Value(rast, 'YOUREWKT'::geometry)
The question of tile size comes because the serialized raster data is
stored in TOAST, which may compress the data.
-bborie
--
Bborie Park
Programmer
Center for Vectorborne Diseases
UC Davis
530-752-8380
bkpark at ucdavis.edu
More information about the postgis-users
mailing list