| | 430 | /* GetEPSGGeogCS() */ |
|---|
| | 431 | /* */ |
|---|
| | 432 | /* Try to establish what the EPSG code for this coordinate */ |
|---|
| | 433 | /* systems GEOGCS might be. Returns -1 if no reasonable guess */ |
|---|
| | 434 | /* can be made. */ |
|---|
| | 435 | /* */ |
|---|
| | 436 | /* TODO: We really need to do some name lookups. */ |
|---|
| | 437 | /************************************************************************/ |
|---|
| | 438 | |
|---|
| | 439 | static int ENVIGetEPSGGeogCS( OGRSpatialReference *poThis ) |
|---|
| | 440 | |
|---|
| | 441 | { |
|---|
| | 442 | const char *pszAuthName = poThis->GetAuthorityName( "GEOGCS" ); |
|---|
| | 443 | |
|---|
| | 444 | /* -------------------------------------------------------------------- */ |
|---|
| | 445 | /* Do we already have it? */ |
|---|
| | 446 | /* -------------------------------------------------------------------- */ |
|---|
| | 447 | if( pszAuthName != NULL && EQUAL(pszAuthName,"epsg") ) |
|---|
| | 448 | return atoi(poThis->GetAuthorityCode( "GEOGCS" )); |
|---|
| | 449 | |
|---|
| | 450 | /* -------------------------------------------------------------------- */ |
|---|
| | 451 | /* Get the datum and geogcs names. */ |
|---|
| | 452 | /* -------------------------------------------------------------------- */ |
|---|
| | 453 | const char *pszGEOGCS = poThis->GetAttrValue( "GEOGCS" ); |
|---|
| | 454 | const char *pszDatum = poThis->GetAttrValue( "DATUM" ); |
|---|
| | 455 | |
|---|
| | 456 | // We can only operate on coordinate systems with a geogcs. |
|---|
| | 457 | if( pszGEOGCS == NULL || pszDatum == NULL ) |
|---|
| | 458 | return -1; |
|---|
| | 459 | |
|---|
| | 460 | /* -------------------------------------------------------------------- */ |
|---|
| | 461 | /* Is this a "well known" geographic coordinate system? */ |
|---|
| | 462 | /* -------------------------------------------------------------------- */ |
|---|
| | 463 | int bWGS, bNAD; |
|---|
| | 464 | |
|---|
| | 465 | bWGS = strstr(pszGEOGCS,"WGS") != NULL |
|---|
| | 466 | || strstr(pszDatum, "WGS") |
|---|
| | 467 | || strstr(pszGEOGCS,"World Geodetic System") |
|---|
| | 468 | || strstr(pszGEOGCS,"World_Geodetic_System") |
|---|
| | 469 | || strstr(pszDatum, "World Geodetic System") |
|---|
| | 470 | || strstr(pszDatum, "World_Geodetic_System"); |
|---|
| | 471 | |
|---|
| | 472 | bNAD = strstr(pszGEOGCS,"NAD") != NULL |
|---|
| | 473 | || strstr(pszDatum, "NAD") |
|---|
| | 474 | || strstr(pszGEOGCS,"North American") |
|---|
| | 475 | || strstr(pszGEOGCS,"North_American") |
|---|
| | 476 | || strstr(pszDatum, "North American") |
|---|
| | 477 | || strstr(pszDatum, "North_American"); |
|---|
| | 478 | |
|---|
| | 479 | if( bWGS && (strstr(pszGEOGCS,"84") || strstr(pszDatum,"84")) ) |
|---|
| | 480 | return 4326; |
|---|
| | 481 | |
|---|
| | 482 | if( bWGS && (strstr(pszGEOGCS,"72") || strstr(pszDatum,"72")) ) |
|---|
| | 483 | return 4322; |
|---|
| | 484 | |
|---|
| | 485 | if( bNAD && (strstr(pszGEOGCS,"83") || strstr(pszDatum,"83")) ) |
|---|
| | 486 | return 4269; |
|---|
| | 487 | |
|---|
| | 488 | if( bNAD && (strstr(pszGEOGCS,"27") || strstr(pszDatum,"27")) ) |
|---|
| | 489 | return 4267; |
|---|
| | 490 | |
|---|
| | 491 | /* -------------------------------------------------------------------- */ |
|---|
| | 492 | /* If we know the datum, associate the most likely GCS with */ |
|---|
| | 493 | /* it. */ |
|---|
| | 494 | /* -------------------------------------------------------------------- */ |
|---|
| | 495 | pszAuthName = poThis->GetAuthorityName( "GEOGCS|DATUM" ); |
|---|
| | 496 | |
|---|
| | 497 | if( pszAuthName != NULL |
|---|
| | 498 | && EQUAL(pszAuthName,"epsg") |
|---|
| | 499 | && poThis->GetPrimeMeridian() == 0.0 ) |
|---|
| | 500 | { |
|---|
| | 501 | int nDatum = atoi(poThis->GetAuthorityCode("GEOGCS|DATUM")); |
|---|
| | 502 | |
|---|
| | 503 | if( nDatum >= 6000 && nDatum <= 6999 ) |
|---|
| | 504 | return nDatum - 2000; |
|---|
| | 505 | } |
|---|
| | 506 | |
|---|
| | 507 | return -1; |
|---|
| | 508 | } |
|---|
| | 509 | |
|---|
| | 510 | /************************************************************************/ |
|---|
| | 511 | /* WriteProjectionInfo() */ |
|---|
| | 512 | /************************************************************************/ |
|---|
| | 513 | |
|---|
| | 514 | void ENVIDataset::WriteProjectionInfo() |
|---|
| | 515 | |
|---|
| | 516 | { |
|---|
| | 517 | /* -------------------------------------------------------------------- */ |
|---|
| | 518 | /* Format the location (geotransform) portion of the map info */ |
|---|
| | 519 | /* line. */ |
|---|
| | 520 | /* -------------------------------------------------------------------- */ |
|---|
| | 521 | CPLString osLocation; |
|---|
| | 522 | |
|---|
| | 523 | osLocation.Printf( "1, 1, %.15g, %.15g, %.15g, %.15g", |
|---|
| | 524 | adfGeoTransform[0], adfGeoTransform[3], |
|---|
| | 525 | adfGeoTransform[1], fabs(adfGeoTransform[5]) ); |
|---|
| | 526 | |
|---|
| | 527 | /* -------------------------------------------------------------------- */ |
|---|
| | 528 | /* Minimal case - write out simple geotransform if we have a */ |
|---|
| | 529 | /* non-default geotransform. */ |
|---|
| | 530 | /* -------------------------------------------------------------------- */ |
|---|
| | 531 | if( pszProjection == NULL || strlen(pszProjection) == 0 ) |
|---|
| | 532 | { |
|---|
| | 533 | if( adfGeoTransform[0] != 0.0 || adfGeoTransform[1] != 1.0 |
|---|
| | 534 | || adfGeoTransform[2] != 0.0 || adfGeoTransform[3] != 0.0 |
|---|
| | 535 | || adfGeoTransform[4] != 0.0 || adfGeoTransform[5] != 1.0 ) |
|---|
| | 536 | { |
|---|
| | 537 | const char* pszHemisphere = "North"; |
|---|
| | 538 | VSIFPrintf( fp, "map info = {Unknown, %s, %d, %s}\n", |
|---|
| | 539 | osLocation.c_str(), 0, pszHemisphere); |
|---|
| | 540 | } |
|---|
| | 541 | return; |
|---|
| | 542 | } |
|---|
| | 543 | |
|---|
| | 544 | /* -------------------------------------------------------------------- */ |
|---|
| | 545 | /* Ingest WKT. */ |
|---|
| | 546 | /* -------------------------------------------------------------------- */ |
|---|
| | 547 | OGRSpatialReference oSRS; |
|---|
| | 548 | |
|---|
| | 549 | char *pszProj = pszProjection; |
|---|
| | 550 | |
|---|
| | 551 | if( oSRS.importFromWkt( &pszProj ) != OGRERR_NONE ) |
|---|
| | 552 | return; |
|---|
| | 553 | |
|---|
| | 554 | /* -------------------------------------------------------------------- */ |
|---|
| | 555 | /* Try to translate the datum and get major/minor ellipsoid */ |
|---|
| | 556 | /* values. */ |
|---|
| | 557 | /* -------------------------------------------------------------------- */ |
|---|
| | 558 | int nEPSG_GCS = ENVIGetEPSGGeogCS( &oSRS ); |
|---|
| | 559 | CPLString osDatum, osCommaDatum; |
|---|
| | 560 | double dfA, dfB; |
|---|
| | 561 | |
|---|
| | 562 | if( nEPSG_GCS == 4326 ) |
|---|
| | 563 | osDatum = "WGS-84"; |
|---|
| | 564 | else if( nEPSG_GCS == 4322 ) |
|---|
| | 565 | osDatum = "WGS-72"; |
|---|
| | 566 | else if( nEPSG_GCS == 4269 ) |
|---|
| | 567 | osDatum = "North America 1983"; |
|---|
| | 568 | else if( nEPSG_GCS == 4267 ) |
|---|
| | 569 | osDatum = "North America 1927"; |
|---|
| | 570 | else if( nEPSG_GCS == 4230 ) |
|---|
| | 571 | osDatum = "European 1950"; |
|---|
| | 572 | else if( nEPSG_GCS == 4277 ) |
|---|
| | 573 | osDatum = "Ordnance Survey of Great Britain '36"; |
|---|
| | 574 | else if( nEPSG_GCS == 4291 ) |
|---|
| | 575 | osDatum = "SAD-69/Brazil"; |
|---|
| | 576 | else if( nEPSG_GCS == 4283 ) |
|---|
| | 577 | osDatum = "Geocentric Datum of Australia 1994"; |
|---|
| | 578 | else if( nEPSG_GCS == 4275 ) |
|---|
| | 579 | osDatum = "Nouvelle Triangulation Francaise IGN"; |
|---|
| | 580 | |
|---|
| | 581 | if( osDatum != "" ) |
|---|
| | 582 | osCommaDatum.Printf( ",%s", osDatum.c_str() ); |
|---|
| | 583 | |
|---|
| | 584 | dfA = oSRS.GetSemiMajor(); |
|---|
| | 585 | dfB = oSRS.GetSemiMinor(); |
|---|
| | 586 | |
|---|
| | 587 | /* -------------------------------------------------------------------- */ |
|---|
| | 588 | /* Do we have unusual linear units? */ |
|---|
| | 589 | /* -------------------------------------------------------------------- */ |
|---|
| | 590 | CPLString osOptionalUnits; |
|---|
| | 591 | if( fabs(oSRS.GetLinearUnits()-0.3048) < 0.0001 ) |
|---|
| | 592 | osOptionalUnits = ", units=Feet"; |
|---|
| | 593 | |
|---|
| | 594 | /* -------------------------------------------------------------------- */ |
|---|
| | 595 | /* Handle UTM case. */ |
|---|
| | 596 | /* -------------------------------------------------------------------- */ |
|---|
| | 597 | const char *pszHemisphere; |
|---|
| | 598 | const char *pszProjName = oSRS.GetAttrValue("PROJECTION"); |
|---|
| | 599 | int bNorth; |
|---|
| | 600 | int iUTMZone; |
|---|
| | 601 | |
|---|
| | 602 | iUTMZone = oSRS.GetUTMZone( &bNorth ); |
|---|
| | 603 | if ( iUTMZone ) |
|---|
| | 604 | { |
|---|
| | 605 | if ( bNorth ) |
|---|
| | 606 | pszHemisphere = "North"; |
|---|
| | 607 | else |
|---|
| | 608 | pszHemisphere = "South"; |
|---|
| | 609 | |
|---|
| | 610 | VSIFPrintf( fp, "map info = {UTM, %s, %d, %s%s%s}\n", |
|---|
| | 611 | osLocation.c_str(), iUTMZone, pszHemisphere, |
|---|
| | 612 | osCommaDatum.c_str(), osOptionalUnits.c_str() ); |
|---|
| | 613 | } |
|---|
| | 614 | else if( oSRS.IsGeographic() ) |
|---|
| | 615 | { |
|---|
| | 616 | VSIFPrintf( fp, "map info = {Geographic Lat/Lon, %s%s}\n", |
|---|
| | 617 | osLocation.c_str(), osCommaDatum.c_str()); |
|---|
| | 618 | } |
|---|
| | 619 | else if( pszProjName == NULL ) |
|---|
| | 620 | { |
|---|
| | 621 | // what to do? |
|---|
| | 622 | } |
|---|
| | 623 | else if( EQUAL(pszProjName,SRS_PT_NEW_ZEALAND_MAP_GRID) ) |
|---|
| | 624 | { |
|---|
| | 625 | VSIFPrintf( fp, "map info = {New Zealand Map Grid, %s%s%s}\n", |
|---|
| | 626 | osLocation.c_str(), |
|---|
| | 627 | osCommaDatum.c_str(), osOptionalUnits.c_str() ); |
|---|
| | 628 | |
|---|
| | 629 | VSIFPrintf( fp, "projection info = {39, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g%s, New Zealand Map Grid}\n", |
|---|
| | 630 | dfA, dfB, |
|---|
| | 631 | oSRS.GetNormProjParm(SRS_PP_LATITUDE_OF_ORIGIN,0.0), |
|---|
| | 632 | oSRS.GetNormProjParm(SRS_PP_CENTRAL_MERIDIAN,0.0), |
|---|
| | 633 | oSRS.GetNormProjParm(SRS_PP_FALSE_EASTING,0.0), |
|---|
| | 634 | oSRS.GetNormProjParm(SRS_PP_FALSE_NORTHING,0.0), |
|---|
| | 635 | osCommaDatum.c_str() ); |
|---|
| | 636 | } |
|---|
| | 637 | else if( EQUAL(pszProjName,SRS_PT_TRANSVERSE_MERCATOR) ) |
|---|
| | 638 | { |
|---|
| | 639 | VSIFPrintf( fp, "map info = {Transverse Mercator, %s%s%s}\n", |
|---|
| | 640 | osLocation.c_str(), |
|---|
| | 641 | osCommaDatum.c_str(), osOptionalUnits.c_str() ); |
|---|
| | 642 | |
|---|
| | 643 | VSIFPrintf( fp, "projection info = {3, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g%s, Transverse Mercator}\n", |
|---|
| | 644 | dfA, dfB, |
|---|
| | 645 | oSRS.GetNormProjParm(SRS_PP_LATITUDE_OF_ORIGIN,0.0), |
|---|
| | 646 | oSRS.GetNormProjParm(SRS_PP_CENTRAL_MERIDIAN,0.0), |
|---|
| | 647 | oSRS.GetNormProjParm(SRS_PP_FALSE_EASTING,0.0), |
|---|
| | 648 | oSRS.GetNormProjParm(SRS_PP_FALSE_NORTHING,0.0), |
|---|
| | 649 | oSRS.GetNormProjParm(SRS_PP_SCALE_FACTOR,1.0), |
|---|
| | 650 | osCommaDatum.c_str() ); |
|---|
| | 651 | } |
|---|
| | 652 | else if( EQUAL(pszProjName,SRS_PT_LAMBERT_CONFORMAL_CONIC_2SP) |
|---|
| | 653 | || EQUAL(pszProjName,SRS_PT_LAMBERT_CONFORMAL_CONIC_2SP_BELGIUM) ) |
|---|
| | 654 | { |
|---|
| | 655 | VSIFPrintf( fp, "map info = {Lambert Conformal Conic, %s%s%s}\n", |
|---|
| | 656 | osLocation.c_str(), |
|---|
| | 657 | osCommaDatum.c_str(), osOptionalUnits.c_str() ); |
|---|
| | 658 | |
|---|
| | 659 | VSIFPrintf( fp, "projection info = {4, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g%s, Lambert Conformal Conic}\n", |
|---|
| | 660 | dfA, dfB, |
|---|
| | 661 | oSRS.GetNormProjParm(SRS_PP_LATITUDE_OF_ORIGIN,0.0), |
|---|
| | 662 | oSRS.GetNormProjParm(SRS_PP_CENTRAL_MERIDIAN,0.0), |
|---|
| | 663 | oSRS.GetNormProjParm(SRS_PP_FALSE_EASTING,0.0), |
|---|
| | 664 | oSRS.GetNormProjParm(SRS_PP_FALSE_NORTHING,0.0), |
|---|
| | 665 | oSRS.GetNormProjParm(SRS_PP_STANDARD_PARALLEL_1,0.0), |
|---|
| | 666 | oSRS.GetNormProjParm(SRS_PP_STANDARD_PARALLEL_2,0.0), |
|---|
| | 667 | osCommaDatum.c_str() ); |
|---|
| | 668 | } |
|---|
| | 669 | else if( EQUAL(pszProjName, |
|---|
| | 670 | SRS_PT_HOTINE_OBLIQUE_MERCATOR_TWO_POINT_NATURAL_ORIGIN) ) |
|---|
| | 671 | { |
|---|
| | 672 | VSIFPrintf( fp, "map info = {Hotine Oblique Mercator A, %s%s%s}\n", |
|---|
| | 673 | osLocation.c_str(), |
|---|
| | 674 | osCommaDatum.c_str(), osOptionalUnits.c_str() ); |
|---|
| | 675 | |
|---|
| | 676 | VSIFPrintf( fp, "projection info = {5, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g%s, Hotine Oblique Mercator A}\n", |
|---|
| | 677 | dfA, dfB, |
|---|
| | 678 | oSRS.GetNormProjParm(SRS_PP_LATITUDE_OF_ORIGIN,0.0), |
|---|
| | 679 | oSRS.GetNormProjParm(SRS_PP_LATITUDE_OF_POINT_1,0.0), |
|---|
| | 680 | oSRS.GetNormProjParm(SRS_PP_LONGITUDE_OF_POINT_1,0.0), |
|---|
| | 681 | oSRS.GetNormProjParm(SRS_PP_LATITUDE_OF_POINT_2,0.0), |
|---|
| | 682 | oSRS.GetNormProjParm(SRS_PP_LONGITUDE_OF_POINT_2,0.0), |
|---|
| | 683 | oSRS.GetNormProjParm(SRS_PP_FALSE_EASTING,0.0), |
|---|
| | 684 | oSRS.GetNormProjParm(SRS_PP_FALSE_NORTHING,0.0), |
|---|
| | 685 | oSRS.GetNormProjParm(SRS_PP_SCALE_FACTOR,1.0), |
|---|
| | 686 | osCommaDatum.c_str() ); |
|---|
| | 687 | } |
|---|
| | 688 | else if( EQUAL(pszProjName,SRS_PT_HOTINE_OBLIQUE_MERCATOR) ) |
|---|
| | 689 | { |
|---|
| | 690 | VSIFPrintf( fp, "map info = {Hotine Oblique Mercator B, %s%s%s}\n", |
|---|
| | 691 | osLocation.c_str(), |
|---|
| | 692 | osCommaDatum.c_str(), osOptionalUnits.c_str() ); |
|---|
| | 693 | |
|---|
| | 694 | VSIFPrintf( fp, "projection info = {6, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g%s, Hotine Oblique Mercator B}\n", |
|---|
| | 695 | dfA, dfB, |
|---|
| | 696 | oSRS.GetNormProjParm(SRS_PP_LATITUDE_OF_ORIGIN,0.0), |
|---|
| | 697 | oSRS.GetNormProjParm(SRS_PP_CENTRAL_MERIDIAN,0.0), |
|---|
| | 698 | oSRS.GetNormProjParm(SRS_PP_AZIMUTH,0.0), |
|---|
| | 699 | oSRS.GetNormProjParm(SRS_PP_FALSE_EASTING,0.0), |
|---|
| | 700 | oSRS.GetNormProjParm(SRS_PP_FALSE_NORTHING,0.0), |
|---|
| | 701 | oSRS.GetNormProjParm(SRS_PP_SCALE_FACTOR,1.0), |
|---|
| | 702 | osCommaDatum.c_str() ); |
|---|
| | 703 | } |
|---|
| | 704 | else if( EQUAL(pszProjName,SRS_PT_STEREOGRAPHIC) |
|---|
| | 705 | || EQUAL(pszProjName,SRS_PT_OBLIQUE_STEREOGRAPHIC) ) |
|---|
| | 706 | { |
|---|
| | 707 | VSIFPrintf( fp, "map info = {Stereographic (ellipsoid), %s%s%s}\n", |
|---|
| | 708 | osLocation.c_str(), |
|---|
| | 709 | osCommaDatum.c_str(), osOptionalUnits.c_str() ); |
|---|
| | 710 | |
|---|
| | 711 | VSIFPrintf( fp, "projection info = {7, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g%s, Stereographic (ellipsoid)}\n", |
|---|
| | 712 | dfA, dfB, |
|---|
| | 713 | oSRS.GetNormProjParm(SRS_PP_LATITUDE_OF_ORIGIN,0.0), |
|---|
| | 714 | oSRS.GetNormProjParm(SRS_PP_CENTRAL_MERIDIAN,0.0), |
|---|
| | 715 | oSRS.GetNormProjParm(SRS_PP_FALSE_EASTING,0.0), |
|---|
| | 716 | oSRS.GetNormProjParm(SRS_PP_FALSE_NORTHING,0.0), |
|---|
| | 717 | oSRS.GetNormProjParm(SRS_PP_SCALE_FACTOR,1.0), |
|---|
| | 718 | osCommaDatum.c_str() ); |
|---|
| | 719 | } |
|---|
| | 720 | else if( EQUAL(pszProjName,SRS_PT_ALBERS_CONIC_EQUAL_AREA) ) |
|---|
| | 721 | { |
|---|
| | 722 | VSIFPrintf( fp, "map info = {Albers Conical Equal Area, %s%s%s}\n", |
|---|
| | 723 | osLocation.c_str(), |
|---|
| | 724 | osCommaDatum.c_str(), osOptionalUnits.c_str() ); |
|---|
| | 725 | |
|---|
| | 726 | VSIFPrintf( fp, "projection info = {9, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g%s, Albers Conical Equal Area}\n", |
|---|
| | 727 | dfA, dfB, |
|---|
| | 728 | oSRS.GetNormProjParm(SRS_PP_LATITUDE_OF_ORIGIN,0.0), |
|---|
| | 729 | oSRS.GetNormProjParm(SRS_PP_CENTRAL_MERIDIAN,0.0), |
|---|
| | 730 | oSRS.GetNormProjParm(SRS_PP_FALSE_EASTING,0.0), |
|---|
| | 731 | oSRS.GetNormProjParm(SRS_PP_FALSE_NORTHING,0.0), |
|---|
| | 732 | oSRS.GetNormProjParm(SRS_PP_STANDARD_PARALLEL_1,0.0), |
|---|
| | 733 | oSRS.GetNormProjParm(SRS_PP_STANDARD_PARALLEL_2,0.0), |
|---|
| | 734 | osCommaDatum.c_str() ); |
|---|
| | 735 | } |
|---|
| | 736 | else if( EQUAL(pszProjName,SRS_PT_POLYCONIC) ) |
|---|
| | 737 | { |
|---|
| | 738 | VSIFPrintf( fp, "map info = {Polyconic, %s%s%s}\n", |
|---|
| | 739 | osLocation.c_str(), |
|---|
| | 740 | osCommaDatum.c_str(), osOptionalUnits.c_str() ); |
|---|
| | 741 | |
|---|
| | 742 | VSIFPrintf( fp, "projection info = {10, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g%s, Polyconic}\n", |
|---|
| | 743 | dfA, dfB, |
|---|
| | 744 | oSRS.GetNormProjParm(SRS_PP_LATITUDE_OF_ORIGIN,0.0), |
|---|
| | 745 | oSRS.GetNormProjParm(SRS_PP_CENTRAL_MERIDIAN,0.0), |
|---|
| | 746 | oSRS.GetNormProjParm(SRS_PP_FALSE_EASTING,0.0), |
|---|
| | 747 | oSRS.GetNormProjParm(SRS_PP_FALSE_NORTHING,0.0), |
|---|
| | 748 | osCommaDatum.c_str() ); |
|---|
| | 749 | } |
|---|
| | 750 | else if( EQUAL(pszProjName,SRS_PT_LAMBERT_AZIMUTHAL_EQUAL_AREA) ) |
|---|
| | 751 | { |
|---|
| | 752 | VSIFPrintf( fp, "map info = {Lambert Azimuthal Equal Area, %s%s%s}\n", |
|---|
| | 753 | osLocation.c_str(), |
|---|
| | 754 | osCommaDatum.c_str(), osOptionalUnits.c_str() ); |
|---|
| | 755 | |
|---|
| | 756 | VSIFPrintf( fp, "projection info = {11, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g%s, Lambert Azimuthal Equal Area}\n", |
|---|
| | 757 | dfA, dfB, |
|---|
| | 758 | oSRS.GetNormProjParm(SRS_PP_LATITUDE_OF_ORIGIN,0.0), |
|---|
| | 759 | oSRS.GetNormProjParm(SRS_PP_CENTRAL_MERIDIAN,0.0), |
|---|
| | 760 | oSRS.GetNormProjParm(SRS_PP_FALSE_EASTING,0.0), |
|---|
| | 761 | oSRS.GetNormProjParm(SRS_PP_FALSE_NORTHING,0.0), |
|---|
| | 762 | osCommaDatum.c_str() ); |
|---|
| | 763 | } |
|---|
| | 764 | else if( EQUAL(pszProjName,SRS_PT_AZIMUTHAL_EQUIDISTANT) ) |
|---|
| | 765 | { |
|---|
| | 766 | VSIFPrintf( fp, "map info = {Azimuthal Equadistant, %s%s%s}\n", |
|---|
| | 767 | osLocation.c_str(), |
|---|
| | 768 | osCommaDatum.c_str(), osOptionalUnits.c_str() ); |
|---|
| | 769 | |
|---|
| | 770 | VSIFPrintf( fp, "projection info = {12, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g%s, Azimuthal Equadistant}\n", |
|---|
| | 771 | dfA, dfB, |
|---|
| | 772 | oSRS.GetNormProjParm(SRS_PP_LATITUDE_OF_ORIGIN,0.0), |
|---|
| | 773 | oSRS.GetNormProjParm(SRS_PP_CENTRAL_MERIDIAN,0.0), |
|---|
| | 774 | oSRS.GetNormProjParm(SRS_PP_FALSE_EASTING,0.0), |
|---|
| | 775 | oSRS.GetNormProjParm(SRS_PP_FALSE_NORTHING,0.0), |
|---|
| | 776 | osCommaDatum.c_str() ); |
|---|
| | 777 | } |
|---|
| | 778 | else if( EQUAL(pszProjName,SRS_PT_POLAR_STEREOGRAPHIC) ) |
|---|
| | 779 | { |
|---|
| | 780 | VSIFPrintf( fp, "map info = {Polar Stereographic, %s%s%s}\n", |
|---|
| | 781 | osLocation.c_str(), |
|---|
| | 782 | osCommaDatum.c_str(), osOptionalUnits.c_str() ); |
|---|
| | 783 | |
|---|
| | 784 | VSIFPrintf( fp, "projection info = {31, %.16g, %.16g, %.16g, %.16g, %.16g, %.16g%s, Polar Stereographic}\n", |
|---|
| | 785 | dfA, dfB, |
|---|
| | 786 | oSRS.GetNormProjParm(SRS_PP_LATITUDE_OF_ORIGIN,90.0), |
|---|
| | 787 | oSRS.GetNormProjParm(SRS_PP_CENTRAL_MERIDIAN,0.0), |
|---|
| | 788 | oSRS.GetNormProjParm(SRS_PP_FALSE_EASTING,0.0), |
|---|
| | 789 | oSRS.GetNormProjParm(SRS_PP_FALSE_NORTHING,0.0), |
|---|
| | 790 | osCommaDatum.c_str() ); |
|---|
| | 791 | } |
|---|
| | 792 | else |
|---|
| | 793 | { |
|---|
| | 794 | VSIFPrintf( fp, "map info = {%s, %s}\n", |
|---|
| | 795 | pszProjName, osLocation.c_str()); |
|---|
| | 796 | } |
|---|
| | 797 | } |
|---|
| | 798 | |
|---|
| | 799 | |
|---|
| | 800 | /************************************************************************/ |
|---|