Opened 16 years ago
Last modified 16 years ago
#2498 closed defect
OGRSpatialReference::Validate does not return correct error code in Python — at Initial Version
Reported by: | Mateusz Łoskot | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.6.0 |
Component: | OGR_SRS | Version: | svn-trunk |
Severity: | normal | Keywords: | python validate |
Cc: | hobu |
Description
I'm trying to use the Validate method of osgeo.osr.SpatialReference class but I'm experiencing strange problem. Regardless of what WKT is validated - valid or invalid - the Validate() function always returns Zero.
Simple test:
wkt = ... # invalid WKT srs = osr.SpatialReference() srs.ImportFromWkt(wkt) print srs.Validate() # always returns Zero
To be 100% of that, I patched the C++ implementation of OGRSpatialReference::Validate to always return OGRERR_CORRUPT_DATA (integer value 5), regardless of WKT being validated.
Testing the patched GDAL has confirmed that Zero is returned, always.
Note:
See TracTickets
for help on using tickets.
Patch used to test and confirm that Python bindings of OGRSpatialReference::Validate function always return Zero, even if original implementation returns different error code