Hi all,
I have code that does the following:
1. Grabs a feature from a WFS server
2. Converts the geometry to an oracle SDO_GEOMETRY using:
a. sdoGeomStruct = geometryConverter.toSDO(geometry, 4326);
3. Stores the sdo_geom in an oracle spatial geometry column
I am trying to re-project the geometry (between steps 1 and 2) from
whatever CRS it is in to EPSG:4326 and getting incorrect (or so it
seems) results. An example geometry:
(Geometry's native CRS is EPSG:4269, no transform operation has been
done on it.. just set the SRID to 4326 when creating the oracle geometry
object (so the coord array is actually still 4269):
MDSYS.SDO_GEOMETRY(2003,4326,null,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1,776
9,2003,1),MDSYS.SDO_ORDINATE_ARRAY(-122.90960799,38.32073901,-122.910741
99,38.32094501...
The above coordinate list is correct.
Now the same geometry but with the following code applied to it:
CoordinateReferenceSystem dataCRS =
simpleFeature.getFeatureType().getCoordinateReferenceSystem();
boolean lenient = true; // allow for some error due to different datums
MathTransform transform = CRS.findMathTransform(
CRS.decode("EPSG:4269"), CRS.decode("EPSG:4326"), lenient );
Geometry geomConverted = JTS.transform(geometry, transform);
And storing it in the oracle DB yields the point:
MDSYS.SDO_GEOMETRY(2003,4326,null,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1,776
9,2003,1),MDSYS.SDO_ORDINATE_ARRAY(-57.0903920409945,-141.67926099,-57.0
926290409912,-141.67983399...
The transformed point seems to be in the form: (-180 - (lat coord1),
180 + (lat coord2)) ... but 4269 and 4326 are very similar coordinate
systems and should barely differ when transformed. Am I doing something
wrong?
Thanks for the help!
Dan
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users