I guess if you want to keep the behaviour consistent with epsg-wkt
you'll have to do CRS.decode("epsg:4326", true) instead.

Note for the epsg-hsql case you're getting lat/lon axis order, while for
the epsg-wkt case you're getting lon/lat.

Cheers,
Gabriel
On Wed, 2011-06-15 at 10:14 -0500, Brian Clements wrote:
> Hello, I've been using the epsg-wkt component for a few years and have
> a decent amount of code written around it. I'm currently trying to
> switch over to the epsg-hsql component since it has better support for
> polar stereographic projections. 
> 
> 
> While doing this I ran into an issue with epsg:4326. I'll use the
> following code to illustrate:
> 
> 
> 
> 
> import org.geotools.referencing.CRS;
> import org.junit.Assert;
> import org.junit.Test;
> import org.opengis.referencing.crs.CoordinateReferenceSystem;
> import org.opengis.referencing.cs.CoordinateSystem;
> 
> 
> 
> 
> public class EpsgTest {
> 
> 
> @Test
> public void CrsTest(){ 
> try {
> CoordinateReferenceSystem crs = CRS.decode("epsg:4326");
> CoordinateSystem cs = crs.getCoordinateSystem();
> System.out.println(cs);
> } catch (Exception e) {
> e.printStackTrace();
> Assert.fail();
> } 
> }
> 
> 
> }
> 
> 
> Case 1
> pom.xml dependencies:
>    <dependency>
>    <groupId>org.geotools</groupId>
>    <artifactId>gt-referencing</artifactId>
>    <version>2.7.1</version>
>    <type>jar</type>
>    <scope>compile</scope>
>    </dependency>
>    <dependency>
>    <groupId>org.geotools</groupId>
>    <artifactId>gt-epsg-hsql</artifactId>
>    <version>2.7.1</version>
>    <type>jar</type>
>    <scope>compile</scope>
>    </dependency>
> 
> 
> Output:
> EllipsoidalCS["Ellipsoidal 2D CS. Axes: latitude, longitude.
> Orientations: north, east. UoM: degree", 
>   AXIS["Geodetic latitude", NORTH], 
>   AXIS["Geodetic longitude", EAST], 
>   AUTHORITY["EPSG","6422"]]
> 
> 
> Case 2
> pom.xml dependencies:
>    <dependency>
>    <groupId>org.geotools</groupId>
>    <artifactId>gt-referencing</artifactId>
>    <version>2.7.1</version>
>    <type>jar</type>
>    <scope>compile</scope>
>    </dependency>
>    <dependency>
>    <groupId>org.geotools</groupId>
>    <artifactId>gt-epsg-wkt</artifactId>
>    <version>2.7.1</version>
>    <type>jar</type>
>    <scope>compile</scope>
>    </dependency>
> 
> 
> Output:
> EllipsoidalCS["WGS 84", 
>   AXIS["Geodetic longitude", EAST], 
>   AXIS["Geodetic latitude", NORTH], 
>   AUTHORITY["EPSG","4326"]]
> 
> 
> I get different math transforms when converting epsg:4326 coordinates
> to coordinates in a lambert conformal projected crs in the two cases.
> The math transforms I get in case 1 produce NaN pairs instead of the
> correct coordinates I get using the crs in case 2.
> 
> 
> Please let me know if this is expected with the epsg-hsql component,
> if I am doing something wrong or if you need more information. Thanks!
> 
> 
> -Brian
> ------------------------------------------------------------------------------
> EditLive Enterprise is the world's most technically advanced content
> authoring tool. Experience the power of Track Changes, Inline Image
> Editing and ensure content is compliant with Accessibility Checking.
> http://p.sf.net/sfu/ephox-dev2dev
> _______________________________________________ Geotools-gt2-users mailing 
> list [email protected] 
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

-- 
Gabriel Roldan
[email protected]
Expert service straight from the developers


------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to