ST_Union automatically wrapped with ST_AsEWKB

28 views
Skip to first unread message

Dave Lipowitz

unread,
Aug 16, 2016, 5:52:47 AM8/16/16
to GeoAlchemy
Hello GeoAlchemy group,

I'm running into an issue with the following:

session.query(func.ST_Union(DEM.rast)).filter(DEM.file_name == '/data/raw_data/static/HI/HI_DEMa.tif')

The query above gets automatically translated into the statement below:

SELECT ST_AsEWKB(ST_Union(dem.rast)) AS "ST_Union_1"
FROM dem
WHERE dem
.file_name = :file_name_1

Because dem.rast is a raster and not a geometry, I get the following error:

ProgrammingError: (psycopg2.ProgrammingError) function st_asewkb(raster) does not exist
LINE
1: SELECT ST_AsEWKB(ST_Union(dem.rast)) AS "ST_Union_1"
               
^
HINT
:  No function matches the given name and argument types. You might need to add explicit type casts.
 
[SQL: 'SELECT ST_AsEWKB(ST_Union(dem.rast)) AS "ST_Union_1" \nFROM dem \nWHERE dem.file_name = %(file_name_1)s \n LIMIT %(param_1)s'] [parameters: {'param_1': 1, 'file_name_1': '/data/raw_data/static/HI/HI_DEMa.tif'}]

Is there a way to keep ST_Union from automatically being wrapped with the ST_AsEWKB function?


Cheers,
Dave



Reply all
Reply to author
Forward
0 new messages