There is a bunch of factories for this stuff:
http://docs.geotools.org/latest/userguide/library/referencing/internal.html
I am used to handling this as a geometry processing task in other systems
(rather than a math transform)....
i.e. use either a process or a function that geometry in and a DEM in, and
"Drapes" the geometry over the DEM returning a new geometry.
- http://docs.geotools.org/latest/userguide/tutorial/function.html
- http://docs.geotools.org/latest/userguide/tutorial/process.html
Those are worth going over anyways as they introduce how geotools factories
work.
--
Jody Garnett
On Wed, Jun 18, 2014 at 4:06 AM, Eric W. Anderson <ander...@cs.cmu.edu>
wrote:
> What would I have to do to add this? Or, put slightly differently, what's
> the
> current process by which findMathTransform() looks for conversions, and
> how can
> I tell it about a new one?
>
> (I know I could just hack in some code to do what I want, but that would be
> ugly.)
>
> Thanks,
> Eric
>
> Thus spake Andrea Aime (andrea.a...@geo-solutions.it):
>
> > On Fri, Jun 13, 2014 at 10:36 PM, Eric W. Anderson
> > <[1]ander...@cs.cmu.edu> wrote:
> >
> > Hi All,
> >
> > I'm using Geotools, and I need to convert coordinates between 2D
> and 3D
> > coordinate reference systems. I recognize that there's no
> > universally-correct way to do this: 2D -> 3D means "making up" a Z
> > coordinate, and 3D -> 2D means losing information. But, is there
> some
> > way to teach Geotools that, in my particular context, I want to use
> a
> > specific transformation. E.g.:
> >
> > +-----+ +-----+
> > | | --- Z = 15 ---> | |
> > | 2D | | 3D |
> > | | <-- drop Z ---- | |
> > +-----+ +-----+
> > I know I can transform any particular coordinate manually this way,
> but
> > I'd like to integrate it so this Just Works. e.g. I can do
> > CRS.findMathTranform(a, b) and if a is convertible to my 2D CRS,
> and my
> > 3D CRS is convertible to b, it works.
> >
> > No. The 3D -> 2D path is normally supported, but the 2D -> 3D never
> is as
> > far as I remember.
> > That said, if all you want is adding an extra static ordinate, it
> should
> > not be too hard to do it yourself.
> > I guess it could be interesting to have some tooling in geotools that
> > given a 2D geometry and a helper object, would add the 3rd ordinate,
> where
> > the helper might look like:
> > interface ElevationProvider() {
> > double getElevation(DirectPosition2D pos);
> > }
> > which then the client would implement in different ways, e.g., fixed
> > value, or DEM sampling.
> > As usual, it's a matter of one having enough time/funding to discuss
> the
> > evolution in the dev mailing list,
> > implement it, and merge it.
> > Cheers
> > Andrea
> >
> > --
> > ==
> > GeoServer Professional Services from the experts! Visit
> > [2]http://goo.gl/NWWaa2 for more information.
> > ==
> > Ing. Andrea Aime
> > @geowolf
> > Technical Lead
> > GeoSolutions S.A.S.
> > Via Poggio alle Viti 1187
> > 55054 Massarosa (LU)
> > Italy
> > phone: +39 0584 962313
> > fax: +39 0584 1660272
> > mob: +39 339 8844549
> > [3]http://www.geo-solutions.it
> > [4]http://twitter.com/geosolutions_it
> > -------------------------------------------------------
> >
> > References
> >
> > Visible links
> > 1. mailto:ander...@cs.cmu.edu
> > 2. http://goo.gl/NWWaa2
> > 3. http://www.geo-solutions.it/
> > 4. http://twitter.com/geosolutions_it
>
> --
> Eric W. Anderson Computer Science Department
> ander...@cs.cmu.edu Carnegie Mellon University
> phone: +1-412-268-1908 Gates-Hillmann Center 6005
>
> PGP key fingerprint:
> D3C5 D6FF EDED 9F1F C36D 53A3 74B7 53A6 3C74 5F12
>
>
> ------------------------------------------------------------------------------
> HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
> Find What Matters Most in Your Big Data with HPCC Systems
> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
> Leverages Graph Analysis for Fast Processing & Easy Data Exploration
> http://p.sf.net/sfu/hpccsystems
> _______________________________________________
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users