We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This issue was discovered while using rasterio (rasterio/rasterio#2752) but it seems to be derived from gdal.
rasterio
gdal
I expected rasterio.CRS.from_user_input(my_wkt_string) to return the same result as rasterio.CRS.from_wkt(my_wkt_string) for a given WKT string.
rasterio.CRS.from_user_input(my_wkt_string)
rasterio.CRS.from_wkt(my_wkt_string)
Instead, for my input, rasterio.CRS.from_user_input(my_wkt_string) raises an error, but rasterio.CRS.from_wkt(my_wkt_string) is valid.
@snowman2 was able to replicate the error using osgeo.osr SetFromUserInput() and ImportFromWkt() (see repro below).
osgeo.osr
SetFromUserInput()
ImportFromWkt()
Repeating the minimal example from @snowman2 ...
>>> from osgeo import osr >>> osr.UseExceptions() >>> my_wkt_string = """ PROJCS["North_America_Albers_Equal_Area_Conic", GEOGCS["GCS_North_American_1983", DATUM["North_American_Datum_1983", SPHEROID["GRS_1980",6378137,298.257222101]], PRIMEM["Greenwich",0], UNIT["Degree",0.017453292519943295]], PROJECTION["Albers_Conic_Equal_Area"], PARAMETER["False_Easting",0], PARAMETER["False_Northing",0], PARAMETER["longitude_of_center",-96], PARAMETER["Standard_Parallel_1",20], PARAMETER["Standard_Parallel_2",60], PARAMETER["latitude_of_center",40], UNIT["Meter",1], AUTHORITY["EPSG","102008"]]""" >>> ref = osr.SpatialReference() >>> ref.SetFromUserInput(my_wkt_string) Traceback (most recent call last): File "<stdin>", line 1, in <module> File ".../lib/python3.9/site-packages/osgeo/osr.py", line 708, in SetFromUserInput return _osr.SpatialReference_SetFromUserInput(self, *args) RuntimeError: OGR Error: Corrupt data >>> ref.ImportFromWkt(my_wkt_string)
MacOS Ventura 13.0
GDAL 3.6.2 installed via Homebrew
The text was updated successfully, but these errors were encountered:
c821e9a
Merge pull request #7171 from rouault/fix_7170
8100a5a
OSRSpatialReference::SetFromUserInput(): skip leading white space (fixes #7170)
Thanks @rouault 👍
Sorry, something went wrong.
rouault
No branches or pull requests
Expected behavior and actual behavior.
This issue was discovered while using
rasterio
(rasterio/rasterio#2752) but it seems to be derived fromgdal
.I expected
rasterio.CRS.from_user_input(my_wkt_string)
to return the same result asrasterio.CRS.from_wkt(my_wkt_string)
for a given WKT string.Instead, for my input,
rasterio.CRS.from_user_input(my_wkt_string)
raises an error, butrasterio.CRS.from_wkt(my_wkt_string)
is valid.@snowman2 was able to replicate the error using
osgeo.osr
SetFromUserInput()
andImportFromWkt()
(see repro below).Steps to reproduce the problem.
Repeating the minimal example from @snowman2 ...
Operating system
MacOS Ventura 13.0
GDAL version and provenance
GDAL 3.6.2 installed via Homebrew
The text was updated successfully, but these errors were encountered: