Changeset 15841


Ignore:
Timestamp:
Nov 28, 2008 10:03:15 AM (8 years ago)
Author:
warmerdam
Message:

added updated equirectngular testing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autotest/osr/osr_esri.py

    r15397 r15841  
    301301
    302302###############################################################################
    303 # Verify Plate_Carree handling.
     303# Verify Plate_Carree handling. 
    304304
    305305def osr_esri_10():
     
    319319        return 'fail'
    320320
    321     expected = 'PROJCS["Sphere_Plate_Carree",GEOGCS["GCS_Sphere",DATUM["D_Sphere",SPHEROID["Sphere",6371000.0,0.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.017453292519943295]],PROJECTION["Plate_Carree"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",0.0],UNIT["Meter",1.0]]'
     321    expected = 'PROJCS["Sphere_Plate_Carree",GEOGCS["GCS_Sphere",DATUM["D_Sphere",SPHEROID["Sphere",6371000.0,0.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.017453292519943295]],PROJECTION["Equidistant_Cylindrical"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",0.0],UNIT["Meter",1.0]]'
    322322   
    323323    srs.MorphToESRI()
     
    327327        print 'Got:      ', wkt
    328328        print 'Expected: ', expected
    329         gdaltest.post_reason( 'Did not get expected Plate_Caree SRS after morphToESRI' )
     329        gdaltest.post_reason( 'Did not get expected Equidistant_Cylindrical SRS after morphToESRI' )
    330330        return 'fail'
    331331
     
    494494    return 'success'
    495495
     496###############################################################################
     497# Verify translation of equirectngular to equidistant cylindrical with
     498# cleanup of parameters.
     499
     500def osr_esri_16():
     501
     502    srs = osr.SpatialReference()
     503    srs.SetFromUserInput('+proj=eqc +lat_0=0 +lat_ts=-10 +lon_0=2 +x=100000 +y_0=200000 +ellps=sphere')
     504
     505    expected = 'PROJCS["Equidistant_Cylindrical",GEOGCS["Normal Sphere (r=6370997)",DATUM["D_unknown",SPHEROID["sphere",6370997,0]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Equidistant_Cylindrical"],PARAMETER["central_meridian",2],PARAMETER["standard_parallel_1",-10],PARAMETER["false_easting",0],PARAMETER["false_northing",200000],UNIT["Meter",1]]'
     506   
     507    srs.MorphToESRI()
     508    wkt = srs.ExportToWkt()
     509
     510    if expected != wkt:
     511        print wkt
     512        gdaltest.post_reason( 'Did not get expected equidistant cylindrical.' )
     513        return 'fail'
     514
     515    return 'success'
     516   
     517   
    496518###############################################################################
    497519
     
    512534    osr_esri_14,
    513535    osr_esri_15,
     536    osr_esri_16,
    514537    None ]
    515538
Note: See TracChangeset for help on using the changeset viewer.