Opened 10 years ago

# incorporate string format change in morphToESRI() method

Reported by: Owned by: yanchen warmerdam normal OGR_SRS 1.5.1 normal morphToESRI gaopeng, esrixz

### Description

Problem 1. the spatial reference is read as Albers Conical Equal Area, it should be North_America_Albers_Equal_Area_Conic. Seems all the parameters are already there, so in morphToESRI() method we need add "North_America_" in the front, changing empty space" " to underscore "_".

Problem 2. the name of the spatial reference should be ESRI style WGS_1984_UTM_Zone_59N", not " UTM Zone 11, Northern Hemisphere"

### Changed 10 years ago by yanchen

data for problem1

### Changed 10 years ago by yanchen

data for problem2

### comment:1 Changed 10 years ago by yanchen

Problem 3: It should return NAD_1927_UTM_Zone_10N, but it returns some strange string "Projection Name = UTM Units = meters GeoTIFF Units = meters". I'm not sure it is the same problem as the above 2.

### Changed 10 years ago by yanchen

data for problem3

### comment:2 Changed 9 years ago by warmerdam

Cc: gaopeng esrixz added; pgao@… removed default → OGR_SRS 1.5.4

I have reviewed these three cases and none of them are returning the desired coordinate system names yet in trunk or the 1.6-esri branch. The current results follow, as created by this script:

```from osgeo import osr, gdal
import sys

argv = gdal.GeneralCmdLineProcessor( sys.argv )
if argv is None:
sys.exit( 0 )

if len(argv) == 1:
print 'Usage: esri_rep.py <file>'
sys.exit( 1 )

file = argv[1]

ds = gdal.Open(file)

wkt = ds.GetProjectionRef()

srs = osr.SpatialReference(wkt)
srs.MorphToESRI()
wkt_esri = srs.ExportToPrettyWkt()

print wkt_esri
```

The problem one file reports:

```PROJCS["Albers_Conical_Equal_Area",
GEOGCS["GCS_North_American_1983",
DATUM["D_North_American_1983",
SPHEROID["GRS_1980",6378137,298.257222101]],
PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943295]],
PROJECTION["Albers"],
PARAMETER["standard_parallel_1",20],
PARAMETER["standard_parallel_2",60],
PARAMETER["latitude_of_origin",40],
PARAMETER["central_meridian",-96],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["meters",1]]
```

The second problem file reports this for the Imagine file:

```PROJCS["UTM_Zone_17_Northern_Hemisphere",
GEOGCS["GCS_Clarke_1866",
DATUM["D_Clarke_1866",
SPHEROID["Clarke_1866",6378206.4,294.9786982]],
PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943295]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",-81],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],
UNIT["Meter",1]]
```

and this for the TIFF file:

```PROJCS["UTM_Zone_17_Northern_Hemisphere",
GEOGCS["GCS_Clarke_1866",
DATUM["D_unknown",
SPHEROID["Clarke_1866",6378206.4,294.9786982]],
PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943295]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",-81],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],
UNIT["Meter",1]]
```

The third problem reports:

```PROJCS["UTM",
GEOGCS["GCS_North_American_1927",
DATUM["D_North_American_1927",
SPHEROID["Clarke_1866",6378206.4,294.9786982]],
PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943295]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",-123],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],
UNIT["meters",1]]
```

This is an improvement over the old case where the full imagine descriptive document was in the name, but is still not the intended "NAD_1927_UTM_Zone_10N".

I have added Xiuguang Zhou to the cc: list since he did lots of work on morphToESRI() for the 1.6-esri branch. I think we need to establish if we really need to force these cases to use the full ESRI style coordinate system name or not for compatability. If not, we can just close this ticket. If so, we may need a reasonably comprehensive strategy to do so.