Opened 16 years ago
Closed 16 years ago
#2171 closed enhancement (fixed)
Support for OGR SQL type cast and field name alias
Reported by: | tamas | Owned by: | tamas |
---|---|---|---|
Priority: | normal | Milestone: | 1.6.0 |
Component: | OGR_SF | Version: | unspecified |
Severity: | normal | Keywords: | sql |
Cc: | warmerdam |
Description (last modified by )
These changes will support to change the name and the type of the fields in the results of the OGR SQL query. A patch will be attached with the implementation details.
I suspect gdal/ogr/ogr_sql.dox still needs to be updated to reflect this change.
Attachments (6)
Change History (15)
comment:1 by , 16 years ago
comment:3 by , 16 years ago
Cc: | added |
---|---|
Description: | modified (diff) |
Keywords: | sql added |
I have added a minimal sort of sql cast operator test in ogr_sql_test.py as r13888 in trunk.
follow-up: 6 comment:5 by , 16 years ago
I have noticed that it is not possible to use the 'AS' construct within an SQL argument to ogr2ogr.
Here is the incantation: ogr2ogr -t_srs '+proj=latlong +datum=WGS84' \ -f GPX -dsco GPX_USE_EXTENSIONS=YES \ veg_points.gpx veg_points.shp \ -sql "SELECT cat AS name FROM veg_points"
The data involved is attached.
follow-up: 7 comment:6 by , 16 years ago
I've tried this using the trunk on Windows but it have been working the result attached. Might it be a platform dependent issue?
Tamas
Replying to dylan:
I have noticed that it is not possible to use the 'AS' construct within an SQL argument to ogr2ogr.
Here is the incantation: ogr2ogr -t_srs '+proj=latlong +datum=WGS84' \ -f GPX -dsco GPX_USE_EXTENSIONS=YES \ veg_points.gpx veg_points.shp \ -sql "SELECT cat AS name FROM veg_points"
The data involved is attached.
comment:7 by , 16 years ago
It looks like it works for Tamas on Windows. I am using Linux x86, and here is the output from svn info:
URL: http://svn.osgeo.org/gdal/branches/1.5 Repository Root: http://svn.osgeo.org/gdal Repository UUID: f0d54148-0727-0410-94bb-9a71ac55c965
Am I not using the latest and greatest GDAL?
Replying to tamas:
I've tried this using the trunk on Windows but it have been working the result attached. Might it be a platform dependent issue?
Tamas
Replying to dylan:
I have noticed that it is not possible to use the 'AS' construct within an SQL argument to ogr2ogr.
Here is the incantation: ogr2ogr -t_srs '+proj=latlong +datum=WGS84' \ -f GPX -dsco GPX_USE_EXTENSIONS=YES \ veg_points.gpx veg_points.shp \ -sql "SELECT cat AS name FROM veg_points"
The data involved is attached.
comment:8 by , 16 years ago
Apologies- I was using the 1.5 stable branch. I can confirm the this functionality works on x86 Linux with GDAL-trunk. Thanks.
comment:9 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I believe this ticket can be closed for now.
The corresponding RFC can be found here: http://trac.osgeo.org/gdal/wiki/rfc21_ogrsqlcast