Skip to content

Commit

Permalink
Idrisi: Add support of Cylindrical Equal Area (OSGeo#3750)
Browse files Browse the repository at this point in the history
  • Loading branch information
hmcoco-dev authored Apr 28, 2021
1 parent 206af6c commit 12469d3
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions gdal/frmts/idrisi/IdrisiDataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2756,7 +2756,7 @@ CPLErr IdrisiGeoReference2Wkt( const char* pszFilename,
// Oblique Stereographic
// Albers Equal Area Conic
// Sinusoidal
//
// Cylindrical Equal Area

if( EQUAL( pszProjName, "Mercator" ) )
{
Expand Down Expand Up @@ -2815,6 +2815,10 @@ CPLErr IdrisiGeoReference2Wkt( const char* pszFilename,
{
oSRS.SetSinusoidal( dfCenterLong, dfFalseEasting, dfFalseNorthing );
}
else if( EQUAL( pszProjName, "CylindricalEA") || EQUAL( pszProjName, "Cylindrical Equal Area" ))
{
oSRS.SetCEA( dfStdP1, dfCenterLong, dfFalseEasting, dfFalseNorthing );
}
else
{
CPLError( CE_Warning, CPLE_NotSupported,
Expand Down Expand Up @@ -3113,9 +3117,13 @@ CPLErr IdrisiDataset::Wkt2GeoReference( const char *pszProjString,
{
pszProjectionOut = "Alber's Equal Area Conic" ;
}
else if( EQUAL( pszProjName, SRS_PT_CYLINDRICAL_EQUAL_AREA ) )
{
pszProjectionOut = "Cylindrical Equal Area" ;
}

// ---------------------------------------------------------
// Failure, Projection system not suppotted
// Failure, Projection system not supported
// ---------------------------------------------------------

if( pszProjectionOut == nullptr )
Expand Down Expand Up @@ -3167,7 +3175,15 @@ CPLErr IdrisiDataset::Wkt2GeoReference( const char *pszProjString,
dfFalseEasting = oSRS.GetProjParm( SRS_PP_FALSE_EASTING, 0.0, nullptr );
dfScale = oSRS.GetProjParm( SRS_PP_SCALE_FACTOR, 0.0, nullptr );
dfStdP1 = oSRS.GetProjParm( SRS_PP_STANDARD_PARALLEL_1, -0.1, nullptr );
dfStdP2 = oSRS.GetProjParm( SRS_PP_STANDARD_PARALLEL_2, -0.1, nullptr );
if ( EQUAL(pszProjectionOut, "Cylindrical Equal Area") )
{
dfStdP2 = -dfStdP1;
dfScale = 1.0;
}
else
{
dfStdP2 = oSRS.GetProjParm( SRS_PP_STANDARD_PARALLEL_2, -0.1, nullptr );
}
if( dfStdP1 != -0.1 )
{
nParameters = 1;
Expand Down

0 comments on commit 12469d3

Please sign in to comment.