In the CRS utility class there is also a method to get a math transform where
you can set lenient to true; this tells it to proceed even if the correct
transform parameters are available.
Jody
On 19/05/2010, at 11:44 PM, Jean Marie wrote:
> Hello Jody
>
> I go back over spain mainland EPSG which is 2062 ;
> I notice that even if I use the library gt-epsg-hsql-2.6.3.jar (so the EPSG
> database),
> I am notified that Bursa Wolf are required !!
>
> is there a pb with the connection to the EPSG database ?
> (I tried other ESPG codes without any pb such as for instance French lambert
> codes)
>
> my following code is quite simple :
>
> EPSGsrc="EPSG:4326";
> EPSGdst="EPSG:2062";
> Longitude=-3.015; Latitude=39.89;
> CoordinateReferenceSystem crsSrc =
> ReferencingFactoryFinder.getCRSAuthorityFactory("EPSG",
> null).createCoordinateReferenceSystem(EPSGsrc);
> CoordinateReferenceSystem crsDest =
> ReferencingFactoryFinder.getCRSAuthorityFactory("EPSG",
> null).createCoordinateReferenceSystem(EPSGdst);
> CoordinateOperation op = coFactory.createOperation(crsSrc, crsDest);
> MathTransform mathtransform = op.getMathTransform();
> .....
>
> the error happens at line "op = coFactory.createOperation(crsSrc, crsDest);"
> org.opengis.referencing.operation.OperationNotFoundException: Les paramètres
> de Bursa Wolf sont requis.
> at
> org.geotools.referencing.operation.DefaultCoordinateOperationFactory.createOperationStep(DefaultCoordinateOperationFactory.java:1072)
> at
> org.geotools.referencing.operation.DefaultCoordinateOperationFactory.createOperationStep(DefaultCoordinateOperationFactory.java:1165)
> at
> org.geotools.referencing.operation.DefaultCoordinateOperationFactory.createOperationStep(DefaultCoordinateOperationFactory.java:882)
> at
> org.geotools.referencing.operation.DefaultCoordinateOperationFactory.createOperationStep(DefaultCoordinateOperationFactory.java:965)
> at
> org.geotools.referencing.operation.DefaultCoordinateOperationFactory.createOperation(DefaultCoordinateOperationFactory.java:243)
> at
> org.geotools.referencing.operation.BufferedCoordinateOperationFactory.createOperation(BufferedCoordinateOperationFactory.java:254)
> at TestGeoTools.transformEPSGsrcEPSGdst(TestGeoTools.java:98)
> where line 98 corresponds to "CoordinateOperation op =
> coFactory.createOperation(crsSrc, crsDest);"
>
> do you have an idea about where does the problem come from ?
>
> thanks in advance
>
> Jean-Marie
>
> Subject: Re: [Geotools-gt2-users] [Geotools-devel] how to get Bursa-Wolf
> parameters in WKT strings
> From: [email protected]
> Date: Wed, 19 May 2010 11:30:33 +1000
> CC: [email protected]
> To: [email protected]
>
> On 19/05/2010, at 12:18 AM, Jean Marie wrote:
>
> Thanks Jody for your suggestion
>
> Did the code example on that page work for you?
>
> at present, I just need a dozen of WKT strings but I already notice that,
> sometimes , it is hard to find the Bursa-Wolf parameters ; as I told
> you is that I must use a light library (gt-referencing-2.6.3.jar)
>
> And I always remind you gt-referencing does not do anything on its own :-)
> You need to feed i some definitions as well ... but I understand you do not
> want to use a database.
>
> for example if I consider Spain mainland the corresponding EPSG code is 2062
> and there is no TOWGS84 parameters in the WKT string ;
> http://spatialreference.org/ref/epsg/2062/ doesn't specify any TOWGS84[..]
> string as well
>
> as Geotools requires Bursa-Wolf parameters to work (when using just
> gt-referencing-2.6.3.jar), is there an official site providing them?
>
> The EPSG database is the official site (http://www.epsg.org/) who distribute
> their data in an Access database. Sometimes individual countries also provide
> official definitions as well). We set up GeoTools so you can configure it as
> needed for your data.
>
> if they are not required, is there a "trick" to set TOWGS84[..] to default
> values ?
>
> I am afraid all these numbers mean something and should be defined by a
> standards agency (as they represent an agreement between map makers).
>
> note : even when using gt-epsg-hsql-2.6.3.jar I have an error at :
> op = coFactory.createOperation(crsSrc, crsDest); // crsSrc created from the
> WKT string (4326), crsDest created from the WKT string (2062) saying that
> Bursa-Wolf parameters are required...
>
> I have another remark regarding the WKT format :
> if I use the OGC wkt definitions given by the site spatialreference.org with
> Geotools, none of them works fine (at least those I tried) ; the results are
> wrong (even if I invert latitude and longitude...)
> does it mean that the WKT format depends on the tools that processes it ?
>
> Not sure about that; there are many flavours of WKT (mostly it is
> organisations like Oracle that modify things a bit). There is a specific
> osgeo org mailing list on this topic (making sure the coordinate reference
> systems work well between projects).
>
> Jody
>
> Votre vie privée l'est-elle vraiment ? Internet Explorer 8 vous protège
> gratuitement !
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
------------------------------------------------------------------------------
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users