John,
I have attached a FORTRAN program that I think more or less duplicates your
problem and shows how to get around it. Also attached are the six graphics
frames that it produces.
I have used the routines "MSKRV1" and "MSKRV2", which are essentially single
precision versions of the routines that you are using. The output shows
three different curves, each of them on a cylindrical equidistant projection
(essentially, in lat/lon space), and on an orthographic projection. The
first curve is a 16-point circle centered at (63.75N,68.55W) and large
enough to pass close to the pole (as one changes the radius of this circle,
different effects are seen near the pole). The second curve is a 1000-point
circle obtained from the first by interpolating in lat/lon space and the
third curve is a 1000-point circle obtained from the first by projecting
the circle from lat/lon space to an appropriate map space, interpolating in
that space, and then mapping the interpolated points back to lat/lon space.
You will note that the final arguments in the two calls to "MSKRV1" are
different: in lat/lon space, there is no way to define the curve so that
it closes on itself. In map space, the curve does close on itself, so
you can tell the interpolator to use computed slopes there to make a
smooth join.
One might be able to write a more or less general piece of code to examine
a curve on the globe and decide for itself what map projection to use to get
an x/y space in which to do the interpolation (perhaps a Lambert Equal-area
with an appropriately chosen center point).
I have commented the program to make it clear what I'm doing (I hope).
Dave Kennison
On Tue, 21 Dec 2004 john.prinos@aero.bombardier.com wrote:
>
> Hello David,
>
> Thanks for the quick response.
>
> Sorry about that. Yes! Of course I mean "orthographic". That's what I get
> for rushing a letter about a topic I worked on months ago....
>
> The specific task is this: I have 16 points in Lat/Lon space which I then
> use KURVP1DP(), KURVP2DP() to fit using 1000 points. The curves generally
> represent wind adjusted aircraft range circles.
>
> I then use MAPTRN() to convert the coordinates to the 'drawing space' and
> draw it using CURVE().
>
>
> I have included a tiff graphic to show off the problem (PoleExample.tiff).
> On the curve in the diagram, points 'A' and 'O' represent the first and
> last points of the 16 given to the program. You can see that the
> KURVP(1/2)DP routines go out of their way to disclude the pole. I tested
> the South Pole point and saw the same effect. As well, I've tried other
> projections such as Mercator and still saw the effect.
>
>
> (See attached file: PoleExample.tiff)
>
> This is an extreme case. Normally, I see flattening of the curves at the
> northern section of the curve if the curves goes as far north as Greenland.
> His effect intensifies as the curve is pushed progressively north.
>
> Here's the input file showing for the given graphic showing the
> coordinates:
>
> 90.,90.,90.,90.
> YFB
> 63.750000,-68.550003
> "16 point circle"
> 0W
> 62.9166666666667,111.449997
> 59.6936943702805,73.9836996489689
> 51.8536444765147,44.7762915342244
> 42.1705610837585,22.3148511918753
> 32.3829327645868,3.22474438845749
> 23.5663421883416,-14.600801746486
> 16.5418122675628,-32.2740510853683
> 11.9940731094613,-50.2610135224664
> 10.4166666666667,-68.550003
> 11.9940731094613,-86.8389924775336
> 16.5418122675628,-104.825954914632
> 23.5663421883416,-122.499204253514
> 32.3829327645868,-140.324750388458
> 42.1705610837585,-159.414857191875
> 51.8536444765147,-181.876297534224
> 59.6936943702805,-211.083705648969
> CITIES
> Pole,90.,0.
> "A",62.9166666666667,111.449997
> "O",59.6936943702805,-211.083705648969
>
>
> I expect that the problem here, given what you said in your email, is that
> the KURVP(1/2)DP routines don't know they're working on a sphere. The first
> and last points' longitudes would certainly be confusing. This is an
> obvious case. When the entire curve is south of the pole, but near it, the
> problem still occurs. (see SouthOfNorthPoleProb.tif)
>
>
> (See attached file: SouthOfNorthPoleProb.tif)
>
> Are there routines to handle spherical coordinate based interpolations in
> NCARG? I see something called SCRIP but the website cannot be found.
>
> Any pointers would be appreciated
>
> John Prinos
> (416) 373-5590
> jprinos@dehavilland.ca
>
>
>
>
>
> Dave Kennison
> <kennison@ucar.ed To: john.prinos@aero.bombardier.com
> u> cc: Fred Clare <fred@ucar.edu>, Mary Haley <haley@ucar.edu>
> Subject: Re: [ncarg-talk] KURVP1DP, KURVP2DP, ezmaps and the North Pole
> 12/20/2004 05:59
> PM
>
>
>
>
>
>
>
> John,
>
>> I'm drawing closed curves pumped out of KURVP1DP, KURVP2DP onto
> orthogonal
>> projection maps drawn by EZMAP.
>
> I assume you mean an "orthographic projection" (code 'OR' in the call to
> MAPROJ), which shows a hemisphere as seen "from infinity" (using straight
> lines as opposed to the divergent lines of the "satellite-view
> projection")?
>
> Fred tells me that the routines you're using are just double-precision
> versions of some routines I know a little bit about. Are you doing the
> curve-fitting in lat/lon space? If so, I could imagine getting odd
> results near the pole, since the routines don't know they're working
> with points on a sphere.
>
>> Everything works great generally until the curves get close to the North
>> Pole (haven't tested the South Pole yet).
>> The curves bend out of the way of the pole. If the closed curve is
> supposed
>> to encompass the pole, it actually draws in such a way as to disclude the
>> North Pole. It is quite comical looking. I wish I could upload the images
>> because my description really isn't doing it justice.
>>
>> I've played around with the SIGMA variables to no avail. Has anyone else
>> encountered this? More importantly, has anyone found a fix?
>
> Can you send us a simple example illustrating this problem?
>
> Dave Kennison
>
>
>
This archive was generated by hypermail 2b29 : Wed Dec 22 2004 - 10:00:31 MST