Opened 7 years ago
Closed 7 years ago
#7252 closed defect (invalid)
Spatial reference of raster displays incorrect standard parallel value
Reported by: | fluidmotion | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | GDAL_Raster | Version: | 2.2.1 |
Severity: | normal | Keywords: | gdal standard_1 projection epsg |
Cc: |
Description
It's very possible this issue does not lie within GDAL at all, but because it manifests itself in different software packages, it may be worth mentioning.
When creating a raster with projection specfied as EPSG 5070, the standard_1 parallel shows incorrectly in arcgis and the Central meridian shows incorrectly in global mapper. All projection parameters appear correct with gdalinfo.
this script was ran using: python 3.6.2 gdal 2.2.1 and also python 2.7.12 gdal 2.1.2
the resultant projection information of this raster shows an incorrect standard parallel 1 of 29.3 in arc desktop 10.5.0.6491 arc desktop 10.5.1.7333 arc pro 2.0.1
and it shows an incorrect central meridian of -93 in global mapper.
ESRI has created a bug for this (BUG-000112119), though the issue with global mapper causes some concern.
code used to create a test raster:
from osgeo import gdal, osr import numpy as np def generateRaster(): print('writing tiff...') res = 1000 ncol = 100 nrow = 100 grid = np.arange(0, nrow*ncol, 1) grid = grid.reshape((nrow, ncol)) geotransform = (179844., res, 0.0, 1605065., 0.0, -res) drv = gdal.GetDriverByName('GTiff') ds = drv.Create('test.tif', ncol, nrow, 1 ,gdal.GDT_Float32) band = ds.GetRasterBand(1) ds.SetGeoTransform(geotransform) targproj = osr.SpatialReference() targproj.ImportFromEPSG(5070) ds.SetProjection(targproj.ExportToWkt()) band.WriteArray(grid)
Thanks for the report, but the above code will just generate a GeoTIFF file with ProjectedCSTypeGeoKey = 5070, so it is up to the other software to properly resolve this EPSG code. I don't see why this would be a bug in GDAL.