[gdal-dev] OGR PG Driver 1.8 to 1.9 undocumented functionality
change (bug?) with ExecuteSQL/GetSpatialRef
Even Rouault
even.rouault at mines-paris.org
Fri Dec 16 07:40:28 EST 2011
Selon Silas Parker <skyhisi at gmail.com>:
> Hello,
>
> I've found that the behaviour of the PG (Postgres/Postgis) driver has
> changed between 1.8 and 1.9 in ExecuteSQL that isn't listed in the
> NEWS file.
>
> The Spatial reference system of a SQL query can not be obtained (using
> GetSpatialRef) if the SQL query starts with white-space.
>
> This may be a bug, or an undocumented change in functionality!
At first sight, it would look rather to be a bug than a desired change. Could
you test if the following works with 1.8.0 and svn head ?
ogrinfo -ro -so -sql "PG:dbname=geocoder user=postgres password=postgres"
codepoint works
It could be also usefull if you could attach the result of those commands with
"--debug on" added on the command line.
>
> I am testing with trunk SVN rev 23573, on Ubuntu 10.04.
>
> The problem can be reproduced using ogrinfo, although I first observed
> this in a different application.
>
> In version 1.8.0:
>
> $ ogrinfo --version
> GDAL 1.8.0, released 2011/01/12
>
> $ ogrinfo -ro -so -sql " SELECT * FROM codepoint" "PG:dbname=geocoder
> user=postgres password=postgres"
> INFO: Open of `PG:dbname=geocoder user=postgres password=postgres'
> using driver `PostgreSQL' successful.
>
> Layer name: sql_statement
> Geometry: Unknown (any)
> Feature Count: 1689582
> Extent: (63215.000000, 8195.000000) - (655448.000000, 1213660.000000)
> Layer SRS WKT:
> PROJCS["OSGB 1936 / British National Grid",
> GEOGCS["OSGB 1936",
> DATUM["OSGB_1936",
> SPHEROID["Airy 1830",6377563.396,299.3249646,
> AUTHORITY["EPSG","7001"]],
> AUTHORITY["EPSG","6277"]],
> PRIMEM["Greenwich",0,
> AUTHORITY["EPSG","8901"]],
> UNIT["degree",0.01745329251994328,
> AUTHORITY["EPSG","9122"]],
> AUTHORITY["EPSG","4277"]],
> UNIT["metre",1,
> AUTHORITY["EPSG","9001"]],
> PROJECTION["Transverse_Mercator"],
> PARAMETER["latitude_of_origin",49],
> PARAMETER["central_meridian",-2],
> PARAMETER["scale_factor",0.9996012717],
> PARAMETER["false_easting",400000],
> PARAMETER["false_northing",-100000],
> AUTHORITY["EPSG","27700"],
> AXIS["Easting",EAST],
> AXIS["Northing",NORTH]]
> FID Column = ogc_fid
> Geometry Column = wkb_geometry
> postcode: String (0.0)
> countryc: String (0.0)
> countyc: String (0.0)
> districtc: String (0.0)
> wardc: String (0.0)
> nhsregionc: String (0.0)
> nhsareac: String (0.0)
> countrys: String (0.0)
> countys: String (0.0)
> districts: String (0.0)
> wards: String (0.0)
> nhsregions: String (0.0)
> nhsareas: String (0.0)
>
>
> In version 1.9:
>
> $ ogrinfo --version
> GDAL 1.9dev, released 2011/01/18
>
> $ ogrinfo -ro -so -sql " SELECT * FROM codepoint" "PG:dbname=geocoder
> user=postgres password=postgres"
> INFO: Open of `PG:dbname=geocoder user=postgres password=postgres'
> using driver `PostgreSQL' successful.
>
> Layer name: sql_statement
> Geometry: Unknown (any)
> Feature Count: 1689582
> Extent: (63215.000000, 8195.000000) - (655448.000000, 1213660.000000)
> Layer SRS WKT:
> (unknown)
> postcode: String (0.0)
> countryc: String (0.0)
> countyc: String (0.0)
> districtc: String (0.0)
> wardc: String (0.0)
> nhsregionc: String (0.0)
> nhsareac: String (0.0)
> countrys: String (0.0)
> countys: String (0.0)
> districts: String (0.0)
> wards: String (0.0)
> nhsregions: String (0.0)
> nhsareas: String (0.0)
>
> Thanks,
>
> Silas
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
More information about the gdal-dev
mailing list