[Gdal-dev] ogr2ogr -where options

Charlton Purvis cplist at earthlink.net
Wed Jul 20 10:27:17 EDT 2005


Hi, group:

Maybe I'm pressing my luck by asking another question, but I'm *this* close
to have a cutthroat app.

With some patience, the help of this list, and the help of the DODS list, I
have a DODS box that does 2 things:  it serves as a gateway to a non-DODS
JGOFS server; and it accepts OGR queries.  It works just fine and dandy, but
I'm running into a translation snafoo, I think.

I want something like this to fly:

ogr2ogr -f "CSV" test 'DODS:http://localhost/cgi-bin/nph-dods/test2?Yday'
-where 'Yday >= 365.861111'
ERROR 1: Attempt to use STRING field `Yday' with numeric comparison `>='.

Well, the error message makes sense and says it all.  (Doing a simple 'Yday
= 356' works fine.)  But perhaps my gateway approach is muddying the waters
by making the Yday field a string when it is really a float.  Maybe
something I could do in the DODS or JGOFS or metadata arena, but my OGR
question is, what kind of options do we have in the -where clause?  The
directions say it's like an SQL statement.  Is there any chance some kind of
basic functionality is built into the where clause, like the ability to mask
Yday as a float or to use some sort of regex to get around it?

Many thanks!

Charlton




More information about the Gdal-dev mailing list