I was too hasty...apparently running the GeoTools through the server DOES
in fact still mess up the CRS. I’m again posting the output from Jody’s
code snippet that outputs the AuthoritiesFactory. This is after loading the
full WAR to the server. I could easily have missed something in the package
I built – anyone have any suggestions?



                Bruce



*From:* Jody Garnett [mailto:jody.garn...@gmail.com]
*Sent:* Thursday, January 5, 2017 8:32 PM
*To:* bikelheimer <br...@acousticanalytics.com>
*Cc:* GeoTools Users <geotools-gt2-users@lists.sourceforge.net>
*Subject:* Re: [Geotools-gt2-users] MathTransform changes on app type



I have not seen this problem on a server; but did run into a similar
problem when working on an OSGi desktop appl



There is however a magic "what the heck is going on" call you can make to
print out what factories are available and what priorities they have. Let
me find the snippet - it prints a tree out of what is going on.



See
https://github.com/locationtech/udig-platform/blob/master/plugins/org.locationtech.udig.libs/src/org/locationtech/udig/libs/internal/Activator.java#L454


--

Jody Garnett



On 5 January 2017 at 10:35, bikelheimer <br...@acousticanalytics.com> wrote:

Happy New Year to all! I've got a frustrating problem. I've created a Java
application that reads in data from a GeoTiff and then finds points on that
GeoTiff by converting a Lat/Long coordinate into the local coordinates in
the GeoTiff. This is accomplished by reading the CRS from the GeoTiff and
building a MathTransform between that and Lat/Long using the following
lines:

        //Get the native coordinate system from the GeoTiff file
        this.CRSin = reader.getCoordinateReferenceSystem();

        //This is the standard WGS 84 CRS
        CoordinateReferenceSystem latlongCRS = CRS.decode("EPSG:4326 ");
//WGS 84 Lat/Long

        //Create the transform from the GeoTiff CRS to Lat/Long
        this.LatLong2tif = CRS.findMathTransform(latlongCRS, this.CRSin,
true);

I have managed to convert my local java app into a server based app. 99% of
the code is exactly the same, including all aspects of dealing with the
coordinate transform. However, when the code runs on the server, it chooses
a different (and clearly incorrect) MathTransform. I've tried to debug this
all the way down to the CRS class, but I can't figure out why it should do
something different.

Both versions correctly identify both CRSs and pass along the exact same
inputs to find the MathTransform, but they produce different results. Has
anyone seen this problem?




--
View this message in context:
http://osgeo-org.1560.x6.nabble.com/MathTransform-changes-on-app-type-tp5302177.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Coordinate Reference System definitions supplied by:
DefaultAuthorityFactory["All"] (crs, buffered)
????ManyAuthoritiesFactory["All"] (crs, cs, datum, operation, optional)
    ????FallbackAuthorityFactory.All["EPSG"] (crs, cs, datum, operation, 
optional)
    ?   ????ThreadedHsqlEpsgFactory["EPSG"] (crs, cs, datum, operation, 
buffered, optional, registered)
    ?   ?   ????FactoryUsingHSQL["EPSG"] (crs, cs, datum, operation)
    ?   ?       ????ReferencingObjectFactory[direct] (crs, cs, 
datum, buffered, registered)
    ?   ?       ????DatumAliases[direct] (datum, registered)
    ?   ????FallbackAuthorityFactory.CRS["EPSG"] (crs, optional)
    ?       ????CartesianAuthorityFactory["EPSG"] (crs, registered)
    ?       ?   ????ReferencingObjectFactory[direct] (crs, cs, 
datum, buffered, registered)
    ?       ?   ????DatumAliases[direct] (datum, registered)
    ?       ????AuthorityFactoryAdapter["EPSG"] (optional)
    ?           ????EPSGCRSAuthorityFactory["EPSG"] (crs, 
registered)
    ????AutoCRSFactory["AUTO2", "AUTO"] (crs, registered)
    ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, 
registered)
    ?   ????DatumAliases[direct] (datum, registered)
    ????HTTP_URI_AuthorityFactory["http://www.opengis.net/def";] (crs, cs, 
datum, operation, optional, registered)
    ?   ????AllAuthoritiesFactory["All"] (crs, cs, datum, operation, 
optional)
    ?       ????FallbackAuthorityFactory.All["EPSG"] (crs, cs, 
datum, operation, optional)
    ?       ?   ????ThreadedHsqlEpsgFactory["EPSG"] (crs, cs, 
datum, operation, buffered, optional, registered)
    ?       ?   ?   ????FactoryUsingHSQL["EPSG"] (crs, cs, 
datum, operation)
    ?       ?   ?       
????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
    ?       ?   ?       ????DatumAliases[direct] (datum, 
registered)
    ?       ?   ????FallbackAuthorityFactory.CRS["EPSG"] (crs, 
optional)
    ?       ?       ????CartesianAuthorityFactory["EPSG"] 
(crs, registered)
    ?       ?       ?   
????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
    ?       ?       ?   ????DatumAliases[direct] (datum, 
registered)
    ?       ?       ????AuthorityFactoryAdapter["EPSG"] 
(optional)
    ?       ?           
????EPSGCRSAuthorityFactory["EPSG"] (crs, registered)
    ?       ????AutoCRSFactory["AUTO2", "AUTO"] (crs, registered)
    ?       ?   ????ReferencingObjectFactory[direct] (crs, cs, 
datum, buffered, registered)
    ?       ?   ????DatumAliases[direct] (datum, registered)
    ?       ????URN_AuthorityFactory["urn:ogc:def", "urn:x-ogc:def"] 
(crs, cs, datum, operation, optional, registered)
    ?       ????WebCRSFactory["CRS"] (crs, registered)
    ?       ?   ????ReferencingObjectFactory[direct] (crs, cs, 
datum, buffered, registered)
    ?       ?   ????DatumAliases[direct] (datum, registered)
    ?       ????HTTP_AuthorityFactory["http://www.opengis.net/gml";] 
(crs, cs, datum, operation, optional, registered)
    ????URN_AuthorityFactory["urn:ogc:def", "urn:x-ogc:def"] (crs, cs, 
datum, operation, optional, registered)
    ?   ????AllAuthoritiesFactory["All"] (crs, cs, datum, operation, 
optional)
    ?       ????FallbackAuthorityFactory.All["EPSG"] (crs, cs, 
datum, operation, optional)
    ?       ?   ????ThreadedHsqlEpsgFactory["EPSG"] (crs, cs, 
datum, operation, buffered, optional, registered)
    ?       ?   ?   ????FactoryUsingHSQL["EPSG"] (crs, cs, 
datum, operation)
    ?       ?   ?       
????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
    ?       ?   ?       ????DatumAliases[direct] (datum, 
registered)
    ?       ?   ????FallbackAuthorityFactory.CRS["EPSG"] (crs, 
optional)
    ?       ?       ????CartesianAuthorityFactory["EPSG"] 
(crs, registered)
    ?       ?       ?   
????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
    ?       ?       ?   ????DatumAliases[direct] (datum, 
registered)
    ?       ?       ????AuthorityFactoryAdapter["EPSG"] 
(optional)
    ?       ?           
????EPSGCRSAuthorityFactory["EPSG"] (crs, registered)
    ?       ????AutoCRSFactory["AUTO2", "AUTO"] (crs, registered)
    ?       ?   ????ReferencingObjectFactory[direct] (crs, cs, 
datum, buffered, registered)
    ?       ?   ????DatumAliases[direct] (datum, registered)
    ?       
????HTTP_URI_AuthorityFactory["http://www.opengis.net/def";] (crs, cs, datum, 
operation, optional, registered)
    ?       ????WebCRSFactory["CRS"] (crs, registered)
    ?       ?   ????ReferencingObjectFactory[direct] (crs, cs, 
datum, buffered, registered)
    ?       ?   ????DatumAliases[direct] (datum, registered)
    ?       ????HTTP_AuthorityFactory["http://www.opengis.net/gml";] 
(crs, cs, datum, operation, optional, registered)
    ????WebCRSFactory["CRS"] (crs, registered)
    ?   ????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, 
registered)
    ?   ????DatumAliases[direct] (datum, registered)
    ????HTTP_AuthorityFactory["http://www.opengis.net/gml";] (crs, cs, 
datum, operation, optional, registered)
        ????AllAuthoritiesFactory["All"] (crs, cs, datum, operation, 
optional)
            ????FallbackAuthorityFactory.All["EPSG"] (crs, cs, 
datum, operation, optional)
            ?   ????ThreadedHsqlEpsgFactory["EPSG"] (crs, cs, 
datum, operation, buffered, optional, registered)
            ?   ?   ????FactoryUsingHSQL["EPSG"] (crs, cs, 
datum, operation)
            ?   ?       
????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
            ?   ?       ????DatumAliases[direct] (datum, 
registered)
            ?   ????FallbackAuthorityFactory.CRS["EPSG"] (crs, 
optional)
            ?       ????CartesianAuthorityFactory["EPSG"] 
(crs, registered)
            ?       ?   
????ReferencingObjectFactory[direct] (crs, cs, datum, buffered, registered)
            ?       ?   ????DatumAliases[direct] (datum, 
registered)
            ?       ????AuthorityFactoryAdapter["EPSG"] 
(optional)
            ?           
????EPSGCRSAuthorityFactory["EPSG"] (crs, registered)
            ????AutoCRSFactory["AUTO2", "AUTO"] (crs, registered)
            ?   ????ReferencingObjectFactory[direct] (crs, cs, 
datum, buffered, registered)
            ?   ????DatumAliases[direct] (datum, registered)
            
????HTTP_URI_AuthorityFactory["http://www.opengis.net/def";] (crs, cs, datum, 
operation, optional, registered)
            ????URN_AuthorityFactory["urn:ogc:def", 
"urn:x-ogc:def"] (crs, cs, datum, operation, optional, registered)
            ????WebCRSFactory["CRS"] (crs, registered)
                ????ReferencingObjectFactory[direct] (crs, cs, 
datum, buffered, registered)
                ????DatumAliases[direct] (datum, registered)
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to