Hi all,
After playing a bit with the gt-referencing and knowing a little bit more
about this module, I think that the CRS class needs a bit of improve. 

Back to my very first post of testing codes:
 
            defaultcrs = CRS.decode("EPSG:4957"); //as HARN geographic 3D
            targetcrs = CRS.decode("EPSG:4956"); //as HARN geocentric

            MathTransform transform = CRS.findMathTransform(defaultcrs,
targetcrs);

            source = new DirectPosition3D(defaultcrs,lat,lon,this.height);
            result = new DirectPosition3D(targetcrs,lat,lon,this.height);

            transform.transform(source, result);

(posted in the user group at
http://n2.nabble.com/gt-referencing-questions-from-a-newbie-td4294766.html#a4294766)

I got this error message instead of a result when converting a geodetic
position to geocentric coordinates on the NAD83(HARN):

WARNING: Can't load a service for category "MathTransformProvider". Cause is
"NoClassDefFoundError: javax/media/jai/WarpAffine".
org.opengis.referencing.operation.OperationNotFoundException: No
transformation available from system "CartesianCS[Geocentric]" to
"CartesianCS[Earth centred, earth fixed, righthanded 3D coordinate system,
consisting of 3 (...) positive Z-axis parallel to mean earth rotation axis
and pointing towards North Pole. UoM: m.]".

- The first warning caused by NoClassDefFound: the JAI stuff
- The second is the main cause: Operation not found

I think this is a bug in CRS class because my test above is on the same
ellipsoid GRS80 and on the same datum NAD83(HARN). The problem thus shall be
recognized as coordinate transform from geodetic postion (lat long height)
to geocentric (X, Y, Z) and therefore the GeocentricTransform should be
assigned as the math transform. However the CRS class couldn't find the
appropriate math transform.

As I checked with the EPSG registry, the geocentric/geodetic projection
conversion is listed in the EPSG:4957 - the NAD83(HARN) geocentric. The
conversion code number is 15592.

Similarly, Geotools cann't transform between WGS84 geographic 3D (EPSG:4979)
and WGS84 geocentric (EPSG4978). 

Is this type of transform really needed?

Yes, especially when converting among the ellipsoidal datums such as ITRFxx,
WGSxx, i.e the world geographic coordinate systems, and between this group
to other datums such as any local datums. 

My suggestion is that somewhere in the CRS class code, when finding the math
transform from the sourceCRS to the targetCRS, there should be a filter like
this:

- if the source and target are on the same ellipsoid, same datum but
different coordinate system, the math transform shall be considered purely
as reprojecting or coordinate transforms, for example from UTM to geodetic
or like in my test from geodetic to geocentric. (I later found out that the
projection transform such as UTM is detectable by geotools, demonstration
below)

I hope this makes some sense to you. Have a nice day!

~b.l


--------------------------------------------------

Hi all,
Well.. In this test, a math transform is found:

sourcecrs = CRS.decode("EPSG:4152"); //as HARN geographic 2D
targetcrs = CRS.decode("EPSG:3748"); //as ProjectedCRS NAD83(HARN) UTM zone
19N
MathTransform transform = CRS.findMathTransform(sourcecrs, targetcrs);

source = new DirectPosition2D(sourcecrs, lat, lon);
result = new DirectPosition2D(targetcrs, lat, lon);

transform.transform(source, result);

System.out.println("easting = " + result.getOrdinate(0));
System.out.println("northing = " + result.getOrdinate(1));      

Here is the answer:      
Input:
Latitude: 43.301
Longitude: -77.626667

Output:
easting = 286948.19530716917
northing = 4797591.73809354

-----
I have Windows XP Professional, broadband internet connection, and Internet
Explorer 6.0.2900.  It’s pretty hard to imagine that I’m the only one who
has this negative experience.
:working:
Dear M'am,
IE7 was released on October, 2006 and IE8 was released on March 2009. Yes
it’s pretty hard to know that you are the only one who has this negative
experience.
-- 
View this message in context: 
http://n2.nabble.com/gt-referencing-suggestion-to-improve-the-CRS-class-tp4513683p4513683.html
Sent from the geotools-devel mailing list archive at Nabble.com.

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to