[postgis-users] FW: Spoke too soon
Darrel Maddy
darrel.maddy at newcastle.ac.uk
Sun Feb 5 07:57:50 PST 2012
Sorry Andy, I seem to have sent the reply to your personal email - was wondering why it had not appeared. D
-----Original Message-----
From: Darrel Maddy
Sent: 05 February 2012 15:49
To: 'Andy Colson'
Subject: RE: [postgis-users] Spoke too soon
Thanks for trying, unfortunately I tried this (actually It was one of the options I already tried) just now but to no avail, it produces the same error
C:\Temp>download.bat
ERROR 1: Error browsing database for PostGIS Raster properties GDALOpen failed - 1 Error browsing database for PostGIS Raster properties
I should confirm that running this as an sql query inside PG does select the tiles requested so there is no error in the filename or the 'filename' column name. The rest of the gdal call works fine with the rid clause.
All very curious.
Darrel
-----Original Message-----
From: Andy Colson [mailto:andy at squeakycode.net]
Sent: 05 February 2012 15:30
To: PostGIS Users Discussion
Cc: Darrel Maddy
Subject: Re: [postgis-users] Spoke too soon
On 02/05/2012 09:13 AM, Darrel Maddy wrote:
> I would be grateful if someone could help me with the syntax for
> filenames when using the WHERE clause in gdal_translate
>
> I have
> gdal_translate -of GTiff "PG:host=localhost port=5432 dbname=testcuda
> user=postgres password=H$%£"! schema=public table=rast100
> where='filename="Heights_11_10.tif"' mode=2" Height10.tif
>
> I tried various forms of the 'filename=' clause (and simplifying the filename to H10.tif) but without success (the form given on the FAQ does not work in windows either). What does work is:
>
> gdal_translate -of GTiff "PG:host=localhost port=5432 dbname=testcuda
> user=postgres password= H$%£"! schema=public table=rast100
> where='rid>someno AND rid<someno' mode=2" Height10.tif
>
> Obviously I can work with the latter but it requires me to know the start and end rid (or do a query to find it). Ideally I would like to be able to just download the image via the filename.
>
> Thanks in anticipation of your help.
>
> Darrel
>
>
>
sql uses single quote for a string, and double quote for column names.
where='filename="Heights_11_10.tif"'
that probably meant: if column filename matched column Heights_11_10.tif.
Try switching the quotes:
where="filename='Heights_11_10.tif' "
-Andy
More information about the postgis-users
mailing list