Hi all,
I took Martin's advice, and was able to get the WGS84 (thank you again, Martin). However, when I created the transformation operation, I got an exception:
org.opengis.referencing.operation.OperationNotFoundException: Bursa wolf parameters required.
Can anybody give me any suggestion on what was wrong or what I should have done?
Thank you all.
--------------------------------
This is the code that I use (the exception was thrown when line [3] got called:
[1] CoordinateReferenceSystem currentCoordinateSystem = curLayer.getFeatureType().getDefaultGeometry().getCoordinateSystem();
[2] CoordinateReferenceSystem wgs84System = org.geotools.referencing.crs.GeographicCRS.WGS84;
........
try{
[3]CoordinateOperation c = (new CoordinateOperationFactory()).createOperation(selectedCS, currentCoordinateSystem);
.....
}catch(OperationNotFoundException ex){
ErrorDialog.handleException("Cannot create the transfromation operation from " + selectedCS.getName().toString() + " to " +
currentCoordinateSystem.getName().toString(), ex);
return;
}catch(FactoryException ex){
ErrorDialog.handleException(ex);
return;
}catch(TransformException ex){
ErrorDialog.handleException("Cannot transfrom from " + selectedCS.getName().toString() + " to " + currentCoordinateSystem.getName().toString(), ex);
return;
}
And the "currentCoordinateSystem" that I got in lien [1] has the following toString() value:
ProjectedCRS["NAD_1927_StatePlane_Colorado_South_FIPS_0503",
GeographicCRS["GCS_North_American_1927",
GeodeticDatum["D_North_American_1927",
Ellipsoid["Clarke_1866", 6378206.4, 294.9786982]],
PrimeMeridian["Greenwich", 0.0],
Unit["degree", 0.017453292519943295],
CoordinateSystemAxis["Longitude", EAST],
CoordinateSystemAxis["Latitude", NORTH]],
OperationMethod["Lambert_Conformal_Conic_2SP"],
PARAMETER["semi_major", 20925832.164],
PARAMETER["semi_minor", 20854892.017163325],
PARAMETER["central_meridian", -105.5],
PARAMETER["latitude_of_origin", 36.666666666666664],
PARAMETER["standard_parallel_1", 37.233333333333334],
PARAMETER["standard_parallel_2", 38.43333333333333],
PARAMETER["false_easting", 2000000.0],
PARAMETER["false_northing", 0.0],
Unit["[m*0.3048006096012192]", 0.3048006096012192],
CoordinateSystemAxis["x", EAST],
CoordinateSystemAxis["y", NORTH]]
This is the exception trace:
org.opengis.referencing.operation.OperationNotFoundException: Bursa wolf parameters required.
at org.geotools.referencing.operation.CoordinateOperationFactory.createOperationStep(CoordinateOperationFactory.java:1109)
at org.geotools.referencing.operation.CoordinateOperationFactory.createOperationStep(CoordinateOperationFactory.java:927)
at org.geotools.referencing.operation.CoordinateOperationFactory.createOperationStep(CoordinateOperationFactory.java:1010)
at org.geotools.referencing.operation.CoordinateOperationFactory.createOperation(CoordinateOperationFactory.java:202)
at tyler.gis.client.tool.GisPickCoordinateAction.actionPerformed(GisPickCoordinateAction.java:91)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1778)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
at org.geotools.referencing.operation.CoordinateOperationFactory.createOperationStep(CoordinateOperationFactory.java:1109)
at org.geotools.referencing.operation.CoordinateOperationFactory.createOperationStep(CoordinateOperationFactory.java:927)
at org.geotools.referencing.operation.CoordinateOperationFactory.createOperationStep(CoordinateOperationFactory.java:1010)
at org.geotools.referencing.operation.CoordinateOperationFactory.createOperation(CoordinateOperationFactory.java:202)
at tyler.gis.client.tool.GisPickCoordinateAction.actionPerformed(GisPickCoordinateAction.java:91)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1778)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
---------------------------------------------------------
Martin Desruisseaux <[EMAIL PROTECTED]> wrote:
Martin Desruisseaux <[EMAIL PROTECTED]> wrote:
Trung Dinh a écrit :
> x = DefaultGeographicCRS.WGS84
>
> However, when I try it, my Java editor (Eclipse) informed me that it
> cannot find DefaultGeographicCRS in any of my geotools packages.
>
> Can anybody tell me what I should do?
Maybe upgrating to Geotools 2.2 would help. If you wish to stay with Geotools
2.1, I think that the class name was GeographicCRS, which was quite confusing
since the GeoAPI interface name was also GeographicCRS.
Martin.
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1¢/min.
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Geotools-gt2-users mailing list Geotools-gt2-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users