[gdal-dev] RFC28 OGR SQL Expressions now in trunk

Frank Warmerdam warmerdam at pobox.com
Tue Sep 14 21:00:15 EDT 2010


Smith, Michael ERDC-CRREL-NH wrote:
> Frank,
> 
> I was testing accesing the OGR_STYLE value from a kmz file using the LIBKML
> driver. Previously this had worked.
> 
> u4rt9mds at maps:/htdocs/dhs/marine$ ogr2ogr -f OCI
> oci:"user/pass at tns:marinetest MarineTraffic.kmz -nln MArineTest3 -lco dim=2
> -lco srid-8265 -lco launder=yes -lco precision=no -sql "select *, ogr_style
> from 0"
> OGR: OGROpen(MarineTraffic.kmz/0x13bb63a0) succeeded as LIBKML.
> ERROR 1: SQL Expression Parsing Error: syntax error

Mike,

The problem seems to be the table named 0 rather than the ogr_style
portion.  Currently well formed identifiers must start with a letter or
an underscore, not a numeric digit.  You can however quote it.

So 'select *, ogr_style from "0"' should work.

This is definitely a backward compatability issue, but it isn't clear to me
whether I ought to try and change it or not.  Thoughts welcome.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list