Fwd: [Proj4j] Aitoff projection

Martin Davis mbdavis at refractions.net
Tue Jun 8 12:37:42 EDT 2010


I'm reluctant to touch this code until there is a good set of unit tests 
for it (and for all paths thru it, which appears to be at least two).

I've never seen any use of the aitoff projection, so I"m not sure where 
these tests could be obtained.

Martin

Martin Davis wrote:
> fowarded to list
>
>
> ---------- Forwarded message ----------
> From: Martin Davis <mtnclimb at gmail.com>
> Date: Sun, Jun 6, 2010 at 8:40 PM
> Subject: Re: [Proj4j] Aitoff projection
> To: Fred Pospeschil <f.w.pospeschil.t.r at charter.net>
>
>
> Er - not 100% sure til I port it!  I'll have a crack at doing that soon...
>
> On Sun, Jun 6, 2010 at 7:58 PM, Fred Pospeschil
> <f.w.pospeschil.t.r at charter.net> wrote:
>   
>> So what does the below listed PROJ4 code look like in java?
>> From: Martin Davis
>> Sent: Sunday, June 06, 2010 6:52 PM
>> To: Fred Pospeschil
>> Subject: Re: [Proj4j] Aitoff projection
>> I'd vote for making the code identical to PROJ4:
>>
>> if (pj_param(P->params, "tlat_1").i)
>>         {
>> if ((P->cosphi1 = cos(pj_param(P->params, "rlat_1").f)) == 0.)
>> E_ERROR(-22)
>>         }
>> else /* 50d28' or acos(2/pi) */
>> P->cosphi1 = 0.636619772367581343;
>>
>>
>> (I have no idea about the logic behind this code - which is why I'm
>> not suggesting changing it!)
>>
>> M
>>
>> On Sun, Jun 6, 2010 at 6:40 AM, Fred Pospeschil
>> <f.w.pospeschil.t.r at charter.net> wrote:
>>     
>>> Martin,
>>>
>>> Jerry's initialization code has the following code:
>>>
>>>  public void initialize() {
>>>   super.initialize();
>>>   if (winkel) {
>>> //FIXME
>>> //   if (pj_param(P->params, "tlat_1").i)
>>> //    if ((cosphi1 = Math.cos(pj_param(P->params, "rlat_1").f)) == 0.)
>>> //     throw new IllegalArgumentException("-22")
>>> //   else /* 50d28' or acos(2/pi) */
>>>     cosphi1 = 0.636619772367581343;
>>>   }
>>>  }
>>>
>>> Based on my reading of the Proj4 manuals I changed it to read:
>>>
>>>  public void initialize() {
>>>   super.initialize();
>>>   if (winkel) {
>>> /*
>>> Winkel Tripel is the arithmetic mean of the Aitoff and
>>> Equidistant Cylindrical projections with the latter’s phi_ts
>>> (latitude of true scale) becoming phi_1. If lat_1=phi_1 is
>>> not specified, Winkel’s value ofphi _1 = cos-1(2/pi) or
>>> 50 27 35. is used. For Bartholomew’s variant, use lat_1=40.
>>> Proj4 Manual pg 17 fwp
>>>  */
>>>     cosphi1 = Math.cos(projectionLatitude);
>>>   }
>>>  }
>>> In addition, I added :
>>>
>>> projectionLatitude = 0.0;
>>>
>>> to the constructor.
>>>
>>> With these changes the code appears to generate graticules/maps which
>>> match
>>> those in Synders Album.
>>>
>>> How  do these changes look to you?
>>>
>>> Fred
>>>
>>>
>>> _______________________________________________
>>> Proj4j mailing list
>>> Proj4j at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/proj4j
>>>
>>>
>>>       
> _______________________________________________
> Proj4j mailing list
> Proj4j at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/proj4j
>
>   

-- 
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022



More information about the Proj4j mailing list