0

I have a 9-band sentinel-2 surface reflectance image that I combined in ArcGIS. When I load it into a python script, dst.profile indicates that "CRS: None". However, when i run a gdalinfo command it indicates it has a projected coordinate system as below:

Coordinate System is:PROJCRS["WGS 84 / UTM zone 17N",
BASEGEOGCRS["WGS 84",
    DATUM["World Geodetic System 1984",
        ELLIPSOID["WGS 84",6378137,298.257223563,
            LENGTHUNIT["metre",1]]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433]]],
CONVERSION["UTM zone 17N",
    METHOD["Transverse Mercator",
        ID["EPSG",9807]],
    PARAMETER["Latitude of natural origin",0,
        ANGLEUNIT["degree",0.0174532925199433],
        ID["EPSG",8801]],
    PARAMETER["Longitude of natural origin",-81,
        ANGLEUNIT["degree",0.0174532925199433],
        ID["EPSG",8802]],
    PARAMETER["Scale factor at natural origin",0.9996,
        SCALEUNIT["unity",1],
        ID["EPSG",8805]],
    PARAMETER["False easting",500000,
        LENGTHUNIT["metre",1],
        ID["EPSG",8806]],
    PARAMETER["False northing",0,
        LENGTHUNIT["metre",1],
        ID["EPSG",8807]]],
CS[Cartesian,2],
    AXIS["(E)",east,
        ORDER[1],
        LENGTHUNIT["metre",1]],
    AXIS["(N)",north,
        ORDER[2],
        LENGTHUNIT["metre",1]],
USAGE[
    SCOPE["unknown"],
    AREA["World - N hemisphere - 84┬░W to 78┬░W - by country"],
    BBOX[0,-84,84,-78]],
ID["EPSG",32617]]

When I run this python snippet

sent_data = rasterio.open(image)
with rasterio.Env():
    sent_data.profile

I get the following result:

{'driver': 'GTiff', 'dtype': 'uint16', 'nodata': None, 'width': 5490, 'height': 5490, 'count': 9, 'crs': None, 'transform': Affine(20.0, 0.0, 399960.0,
   0.0, -20.0, 3900000.0), 'blockxsize': 128, 'blockysize': 128, 'tiled': True, 'compress': 'lzw', 'interleave': 'pixel'}

I have also tried

sent_data.gcps

And also tried using gdal python bindings as given in a few similar questions here, but still not working. I need to be able to obtain the CRS in order to apply it to another output raster so that it can be projected properly.

1 Answer 1

2

I guess this is a problem using the conda distribution for gdal > 3.

If it is possible for you, try to use gdal 2.4.3

Not the answer you're looking for? Browse other questions tagged or ask your own question.