[Gdal-dev] Quick Fix Issues

Grabowski, Hank hgrabows at stk.com
Thu Jan 8 15:51:07 EST 2004


Well, as luck wouldn't have it, sometimes those are the right keywords.
WTF?  Anyway, this below code I believe correctly maps between all the
ESRI and OGR discrepancies:

	if( pszProjection != NULL &&
		(EQUAL(pszProjection,"Albers") ||
		 EQUAL(pszProjection,"Equidistant_Conic") ||
		 EQUAL(pszProjection,"Azimuthal_Equidistant") ||
		 EQUAL(pszProjection,"Lambert_Azimuthal_Equal_Area") ||
		 EQUAL(pszProjection,"Miller_Cylindrical") ||
		 EQUAL(pszProjection,"Robinson") ||
		 EQUAL(pszProjection,"Sinusoidal")))
	{
        GetRoot()->applyRemapper( 
            "PARAMETER", apszAlbersMapping + 0, apszAlbersMapping + 1, 2
);
	}

Now.  The last issue I seem to have is that the World Mercator
projection produced by ESRI includes the parameter
SRS_PP_STANDARD_PARALLEL_1, but OGR doesn't like that (ESRI sets the
value to 0.0 anyway btw).  In the validate code, it checks to make sure
additional parameters aren't used.  I'm not sure what to do except
recommend that customers hand edit the projection file and remove this
parameter.

Hank Grabowski
hgrabowski at stk.com
1-610-578-1000
------------------------------------------------------------------------
----------
Get an opportunity to win an iQue PDA/GPS handheld system by inviting
your friends and colleagues to join the STK user community at
http://www.stk.com/referral. "Share The Knowledge!"


-----Original Message-----
From: Grabowski, Hank 
Sent: Thursday, January 08, 2004 2:18 PM
To: gdal-dev at remotesensing.org
Subject: [Gdal-dev] Quick fix works preliminarily


In morphFromESRI there was code that looked like:

    if( pszProjection != NULL && EQUAL(pszProjection,"Albers") )
        GetRoot()->applyRemapper( 
            "PARAMETER", apszAlbersMapping + 0, apszAlbersMapping + 1, 2
);

To read:

    if( pszProjection != NULL)
        GetRoot()->applyRemapper( 
            "PARAMETER", apszAlbersMapping + 0, apszAlbersMapping + 1, 2
);

This appears to help this issue.  Perhaps it is just a bandaid though.
Does not limiting the parameter conversion process to Albers projections
make sense generally?

Hank Grabowski
hgrabowski at stk.com
1-610-578-1000
------------------------------------------------------------------------
----------
Get an opportunity to win an iQue PDA/GPS handheld system by inviting
your friends and colleagues to join the STK user community at
http://www.stk.com/referral. "Share The Knowledge!"


-----Original Message-----
From: Frank Warmerdam [mailto:warmerdam at pobox.com] 
Sent: Thursday, January 08, 2004 2:03 PM
To: gdal-dev at remotesensing.org
Subject: Re: [Gdal-dev] Projection Parameters


Grabowski, Hank wrote:
> Hey Frank,
> 
> I was just using the Validate method in a preliminary pass.
> Unfortunately if I simply ignore that step and let OGR try and 
> reproject the data anyway, I don't get a valid reprojection.  From 
> what I can tell the importFromESRI function is calling the 
> morphFromESRI function, but it isn't successfully remapping the 
> parameters.  The projection I'm trying to import is a World Mercator 
> projection.  Is there a csv datafile, that I see references to in the 
> code, that I should have installed?  I'm thinking the answer is no, 
> because the IsAliasFor method used in ValidateProjection has all the 
> necessary values.  At one point are these parameters supposed to be 
> swapped or re-interpreted during the morphFromESRI or importFromESRI 
> function?

Hank,

The corresponding aliasing logic in actual use is embedded as code in
the GetProjParm() method.  There, for instance, if Latitude of Origin is
requested but not found, it will also try latitude of center.

I see that the rules in this method don't exactly match the alias list
in the validate code, but likely should.  If you can submit a bug report
with the original ESRI .prj file I can try to track down what is
happening and generalize the logic.

Code that converts to other formats, such as PROJ.4, use GetProjParm()
with the expectation that it will know something about common aliases.

Best regards,

-- 
---------------------------------------+--------------------------------
---------------------------------------+------
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent


_______________________________________________
Gdal-dev mailing list
Gdal-dev at remotesensing.org
http://remotesensing.org/mailman/listinfo/gdal-dev
_______________________________________________
Gdal-dev mailing list
Gdal-dev at remotesensing.org
http://remotesensing.org/mailman/listinfo/gdal-dev



More information about the Gdal-dev mailing list