[raster] raster2pgqsql option for defining a grouping ID (like filename but integer)
|Reported by:||rmorelli||Owned by:||dustymugs|
I've been dealing with loading a bunch of rasters in a table using -F option. When coming to play with mapserver postgis raster LAYER definition(s) (ie DATA statement) I've found that using WHERE clause on the "filename" field is really a mess because escaping doesn't work (1).
Querying an integer data type field (as in the 2nd example in http://postgis.net/docs/RT_FAQ.html#idp61699792) works smoothly.
So, could you consider adding a cli option in order to add a new column of integer data type? Maybe casting filename (text) into id (int)? eg. my workaround has been: adding a new integer column and then use "UPDATE raster.dem SET id=CAST(substring(filename FROM '_(.*?)\.') AS integer);"
Hope this was clear. Regards Raffaele
PS really don't know if this should be also reported to mapserver devs, anyway knwoledge is useful.
(1) DATA "PG:host=localhost port=5432 dbname='xxx' user='xxx' password='xxx' schema='raster' table='dem' where='filename=\'dem20_12.tif\ mode='2'"
Change History (15)
comment:14 Changed 2 years ago by
|Milestone:||PostGIS 2.1.6 → PostGIS 2.2.0|
|Summary:||[raster] raster2pgqsql → [raster] raster2pgqsql option for defining a grouping ID (like filename but integer)|
|Version:||2.1.x → trunk|