| | 477 | # support MapInformation for units (#1967) |
|---|
| | 478 | |
|---|
| | 479 | def hfa_mapinformation_units(): |
|---|
| | 480 | |
|---|
| | 481 | # NOTE: we depend on being able to open .aux files as a weak sort of |
|---|
| | 482 | # dataset. |
|---|
| | 483 | |
|---|
| | 484 | gdal.PushErrorHandler( 'CPLQuietErrorHandler' ) |
|---|
| | 485 | ds = gdal.Open( 'data/fg118-91.aux' ) |
|---|
| | 486 | gdal.PopErrorHandler() |
|---|
| | 487 | |
|---|
| | 488 | wkt = ds.GetProjectionRef() |
|---|
| | 489 | expected_wkt = """PROJCS["NAD83 / Virginia North", |
|---|
| | 490 | GEOGCS["NAD83", |
|---|
| | 491 | DATUM["North_American_Datum_1983", |
|---|
| | 492 | SPHEROID["GRS 1980",6378137,298.257222101, |
|---|
| | 493 | AUTHORITY["EPSG","7019"]], |
|---|
| | 494 | AUTHORITY["EPSG","6269"]], |
|---|
| | 495 | PRIMEM["Greenwich",0, |
|---|
| | 496 | AUTHORITY["EPSG","8901"]], |
|---|
| | 497 | UNIT["degree",0.01745329251994328, |
|---|
| | 498 | AUTHORITY["EPSG","9122"]], |
|---|
| | 499 | AUTHORITY["EPSG","4269"]], |
|---|
| | 500 | PROJECTION["Lambert_Conformal_Conic_2SP"], |
|---|
| | 501 | PARAMETER["standard_parallel_1",39.2], |
|---|
| | 502 | PARAMETER["standard_parallel_2",38.03333333333333], |
|---|
| | 503 | PARAMETER["latitude_of_origin",37.66666666666666], |
|---|
| | 504 | PARAMETER["central_meridian",-78.5], |
|---|
| | 505 | PARAMETER["false_easting",11482916.66666667], |
|---|
| | 506 | PARAMETER["false_northing",6561666.666666667], |
|---|
| | 507 | UNIT["us_survey_feet",0.3048006096012192]]""" |
|---|
| | 508 | |
|---|
| | 509 | if gdaltest.equal_srs_from_wkt( expected_wkt, wkt ): |
|---|
| | 510 | return 'success' |
|---|
| | 511 | else: |
|---|
| | 512 | return 'fail' |
|---|
| | 513 | |
|---|
| | 514 | ############################################################################### |
|---|