13

I am trying to re-projected a .tiff file to EPSG:32638 with the following code.

Versions I have installed: Rasterio version 1.1.5 Numpy version 1.18.1

This is the code I am using:https://rasterio.readthedocs.io/en/latest/topics/reproject.html (Reprojecting a GeoTIFF dataset)

Error:

---------------------------------------------------------------------------
CPLE_BaseError                            Traceback (most recent call last)
rasterio/_crs.pyx in rasterio._crs._CRS.from_user_input()

rasterio/_err.pyx in rasterio._err.exc_wrap_ogrerr()

CPLE_BaseError: OGR Error code 6

During handling of the above exception, another exception occurred:

CRSError                                  Traceback (most recent call last)
<ipython-input-35-aa94757a1fc2> in <module>
      7 with rasterio.open('/home/DATA/Test.tif') as src:
      8     transform, width, height = calculate_default_transform(
----> 9         src.crs, dst_crs, src.width, src.height, *src.bounds)
     10     kwargs = src.meta.copy()
     11     kwargs.update({

~/anaconda3/envs/elsa/lib/python3.7/site-packages/rasterio/env.py in wrapper(*args, **kwds)
    380     def wrapper(*args, **kwds):
    381         if local._env:
--> 382             return f(*args, **kwds)
    383         else:
    384             with Env.from_defaults():

~/anaconda3/envs/elsa/lib/python3.7/site-packages/rasterio/warp.py in calculate_default_transform(src_crs, dst_crs, width, height, left, bottom, right, top, gcps, resolution, dst_width, dst_height)
    468 
    469     dst_affine, dst_width, dst_height = _calculate_default_transform(
--> 470         src_crs, dst_crs, width, height, left, bottom, right, top, gcps
    471     )
    472 

rasterio/_warp.pyx in rasterio._warp._calculate_default_transform()

rasterio/_base.pyx in rasterio._base._osr_from_crs()

~/anaconda3/envs/elsa/lib/python3.7/site-packages/rasterio/crs.py in from_user_input(cls, value, morph_from_esri_dialect)
    457         elif isinstance(value, string_types):
    458             obj = cls()
--> 459             obj._crs = _CRS.from_user_input(value, morph_from_esri_dialect=morph_from_esri_dialect)
    460             return obj
    461         else:

rasterio/_crs.pyx in rasterio._crs._CRS.from_user_input()

CRSError: The WKT could not be parsed. OGR Error code 6

ecd
  • 165
  • 1
  • 7
  • 4
    I got the same error... did you get this solved? – Erin Li Jul 11 '20 at 21:59
  • 1
    I got the same error over and over again even when I create a new environment and reinstall all the packages. – Dylan_w Aug 20 '20 at 07:43
  • Could you provide the output of `gdalinfo Test.tif`? – ashnair1 Feb 01 '21 at 05:45
  • The error has happened to me on `rasterio 1.1.5` in a Conda environment. This might be related (and should be fixed in `rasterio 1.2.0`): https://github.com/mapbox/rasterio/issues/2079 – Stefan_EOX Feb 02 '21 at 11:36
  • 1
    had the same error, switched from a `conda` environment to another one, reinstalled `rioxarray` and it worked.. FWIW – Rafael Oct 27 '22 at 16:57

0 Answers0