Nice turtles all the way down reference.

I figured this out once for a change request, it has diagrams if that helps
you find your way:

http://docs.codehaus.org/display/GEOTOOLS/Improve+CRSAuthority+Concurrency+Caching+and+Connection+Use

The indirection is mostly caused by a "need for speed" - they can be
expensive to create so we cache everything we can with weak references, but
that was not good enough so we hard reference the most popular 10 or
something ...

I did not look carefully at MathTransformFactory use, I would recommend
stepping through with a debugger (a great way to figure things out when
there is this much setup and indirection involved). Note some of the other
CoordinateReferenceSystems end up being backed by their own large datasets
(Grid Shift files). I have never registered an additional MathTransform
myself, but the design does allow for it.


Jody Garnett


On Tue, Jun 24, 2014 at 1:38 AM, Eric W. Anderson <ander...@cs.cmu.edu>
wrote:

> Hi All,
>
> Thanks for the help.  I looked at this a bit, and I'm trying to figure out
> exactly what's going on.  There seems to be a nearly-endless chain of
> indirection here, looking for providers of implementations of pools of
> registries of sets of plugins of finders of factories of ...
>
> Is there somewhere -- either in the code or the documentation -- where the
> logic of "how to find or construct a transform from coordinate system A to
> coordinate system B" is located, or is it turtles all the way down?
> DefaultCoordinateOperationFactory is the closest thing I've found.
>
> Thanks,
> Eric
>
>
>
> Thus spake Jody Garnett (jody.garn...@gmail.com):
>
> >    There is a bunch of factories for this stuff:
> >    [1]
> 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.
> >    - [2]http://docs.geotools.org/latest/userguide/tutorial/function.html
> >    - [3]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 <[4]
> 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 ([5]andrea.a...@geo-solutions.it):
> >      >    On Fri, Jun 13, 2014 at 10:36 PM, Eric W. Anderson
> >      >    <[1][6]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][7]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: [8]+39 0584 962313
> >      >    fax: [9]+39 0584 1660272
> >      >    mob: [10]+39  339 8844549
> >      >    [3][11]http://www.geo-solutions.it
> >      >    [4][12]http://twitter.com/geosolutions_it
> >      >    -------------------------------------------------------
> >      >
> >      > References
> >      >
> >      >    Visible links
> >      >    1. mailto:[13]ander...@cs.cmu.edu
> >      >    2. [14]http://goo.gl/NWWaa2
> >      >    3. [15]http://www.geo-solutions.it/
> >      >    4. [16]http://twitter.com/geosolutions_it
> >      --
> >      Eric W. Anderson                             Computer Science
> Department
> >      [17]ander...@cs.cmu.edu                           Carnegie Mellon
> >      University
> >      phone: [18]+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
> >      [19]http://p.sf.net/sfu/hpccsystems
> >      _______________________________________________
> >      GeoTools-GT2-Users mailing list
> >      [20]GeoTools-GT2-Users@lists.sourceforge.net
> >      [21]https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
> >
> > References
> >
> >    Visible links
> >    1.
> http://docs.geotools.org/latest/userguide/library/referencing/internal.html
> >    2. http://docs.geotools.org/latest/userguide/tutorial/function.html
> >    3. http://docs.geotools.org/latest/userguide/tutorial/process.html
> >    4. mailto:ander...@cs.cmu.edu
> >    5. mailto:andrea.a...@geo-solutions.it
> >    6. mailto:ander...@cs.cmu.edu
> >    7. http://goo.gl/NWWaa2
> >    8. file:///tmp/tel:%2B39%200584%20962313
> >    9. file:///tmp/tel:%2B39%200584%201660272
> >   10. file:///tmp/tel:%2B39%20%C2%A0339%208844549
> >   11. http://www.geo-solutions.it/
> >   12. http://twitter.com/geosolutions_it
> >   13. mailto:ander...@cs.cmu.edu
> >   14. http://goo.gl/NWWaa2
> >   15. http://www.geo-solutions.it/
> >   16. http://twitter.com/geosolutions_it
> >   17. mailto:ander...@cs.cmu.edu
> >   18. file:///tmp/tel:%2B1-412-268-1908
> >   19. http://p.sf.net/sfu/hpccsystems
> >   20. mailto:GeoTools-GT2-Users@lists.sourceforge.net
> >   21. https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
> --
> 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
>
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to