Hey Jody,

Martin's gone to bed so here's an interim, re-explanation of what he
explained to me earlier today.

All 3D, other than ellipsoidal 3D, are compound 2D+1, a vertical. 

To turn those into 2D you can simply throw out the vertical axis. (Okay,
that's not pedantically what you want to do in all cases, for example
with a geoidal CRS we ought to use a model geoid and follow the
gravitational curve to the 0 surface, but that's more than most folk
will expect so the quick-and-easy will work fine for the near future.)
So for our needs we can merely grab the separate structure to get the
2D. Most importantly, we don't need to create any new pieces, merely
recuperate the 2D element.

For ellipsoidal 3D you have one structure with 3 axes of which two are
the ones you want (you can't be sure which two, you have to look for the
axis direction). So tearing it appart to get the pieces you want is
doable. However, you've then got to build a new piece, a new 2D
ellipsoidal CRS. That's where Martin hits a road bump; factory creation
can lead to exceptions.

make sense?

--adrian


On Thu, 2008-02-28 at 12:37 -0800, Jody Garnett wrote:
> So Martin I am stuck on this one - what should I do? If you explain the 
> problem well enough I do not mind trying my hand at an implementation. 
> As I understand it any CRS with more than two axis is fatal right now?
> 
> Jody
> > Andrea Aime a écrit :
> >> Martin, how hard would it be to make that method work with ellipsoidal
> >> height?
> >
> > Not really hard. At the difference of other cases, the 3D Ellipsoid 
> > case requires the instantation of new objects.
> >
> > We need to add in CRS.getHorizontalCRS(...) a special test for the 
> > GeographicCRS 3D case. We need to get its EllipsoidalCS, inspect the 
> > axis and retains the ones that are not height (may be at any index - 
> > checking the direction should be okay). Then we create a new 
> > EllipsoidalCS with those axis, and a new GeographicCRS with that CS.
> >
> > We may need to handle a FactoryException. Adding this throws clause 
> > would be compatibility break. We may decide that it is acceptable, or 
> > we may also decide that we could log it and returns null since it is 
> > documented as a valid return value when the 2D part can't be obtained 
> > for some reason...
> >
> >     Martin
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Geotools-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-devel


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to