I've been working on reprojecting GridCoverages from a "custom" Lambert Conformal Conic projection into WGS84 using the 2.5M2 release. I reproject the data like so...

GridCoverage2D reproj = (GridCoverage2D) Operations.DEFAULT.resample(originalGC, targetCRS);

I retrieve the GeneralEnvelope of the reprojected coverage, and then get the upper and lower DirectPositions. The problem I have is that the X/Y order of the DirectPosition appears to change. I do this...

GeneralEnvelope genEnv = (GeneralEnvelope) reproj.getEnvelope();
DirectPosition upper = genEnv.getUpperCorner();
System.out.println("Upper: " + upper.getOrdinate(0) + "/" + upper.getOrdinate(1));

Sometimes the print comes out in Y/X order, sometimes in X/Y order. The values are always correct, but the order changes. I have also been printing the minimal and maximal coordinates of the original (projected) GridCoverage, and their order never changes.

Anyone have any ideas how this could occur?  I'm at a loss.

--
Do not go where the path may lead; go instead where there is no path and leave 
a trail.
-- Ralph Waldo Emerson

begin:vcard
fn:Matt Foster - N0EYE
n:Foster;Matt
org:;NWS Forecast Office - Norman OK
email;internet:[EMAIL PROTECTED]
title:Information Technology Officer
tel;work:(405) 325-3406
x-mozilla-html:TRUE
version:2.1
end:vcard

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to