Jim,

        Thanks for getting back to me! I did include gt-epsg-hsql, but not
gt-epsg-wkt in my MAVEN pom, and I'm using version 16.0. And I did not set
up GeoServer - that part frightens me!
        CRS is clearly working from the correct EPSG codes - it just all
changes when it goes to compute the MathTransform. When a project is built
as a Java application it all works, but when a project is built for a
server it produces a different (and incorrect) MathTansform. All built
with Eclipse...

        Bruce

-----Original Message-----
From: Jim Hughes [mailto:jn...@ccri.com]
Sent: Thursday, January 5, 2017 4:37 PM
To: geotools-gt2-users@lists.sourceforge.net
Subject: Re: [Geotools-gt2-users] MathTransform changes on app type

Hi Bruce,

Great question.  I believe CRS.decode calls out to the classes which
lookup the EPSG codes.  Are you including gt-epsg-wkt or gt-epsg-hsql in
the projects?  Also, which version of GeoTools are you using?  Lastly, is
the server running GeoServer?

Cheers,

Jim

On 01/05/2017 01:35 PM, bikelheimer 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



--------------------------------------------------------------------------
----
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

------------------------------------------------------------------------------
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

Reply via email to