-----Messaggio originale-----
Da: Martin Desruisseaux [mailto:[EMAIL PROTECTED]
Inviato: sabato 6 ottobre 2007 19.15
A: Jacopo Boari
Cc: 'Jody Garnett'; '[email protected]'
Oggetto: Re: R: [Geotools-gt2-users] How to convert from EPSG:4326 to EPSG:23032
Le vendredi 05 octobre 2007 à 18:44 +0200, Jacopo Boari a écrit :
> I'm now using your suggestion to make the transformation, but this operatio
> in too slow.
> This is my source code:
>
> CoordinateOperationFactory coFactory =
> FactoryFinder.getCoordinateOperationFactory(null);
> CoordinateOperation co =
> coFactory.createOperation(CRS.decode("EPSG:4326"),
> CRS.decode("EPSG:3003")); MathTransform trans = co.getMathTransform();
>
>
>>Which part is slow? The above lines get the MathTransform, but don't use it
>>for applying the transformation.
>>The MathTransform should be obtained only once and used for every points to
>>transform between a given pair of source CRS and target CRS. Getting the
>>MathTransform for every point would be slow.
Hi Martin, sorry I've missed to paste a part of my source code.
CoordinateOperationFactory coFactory =
FactoryFinder.getCoordinateOperationFactory(lenientDatumHint);
CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:4326");
CoordinateReferenceSystem targetCRS = CRS.decode(srs);
CoordinateOperation co = coFactory.createOperation(sourceCRS, targetCRS);
MathTransform trans = co.getMathTransform();
DirectPosition sW = new GeneralDirectPosition(measures[0],measures[1]);
DirectPosition nE = new GeneralDirectPosition(measures[2],measures[3]);
sW = trans.transform(sW, null);
nE = trans.transform(nE, null);
> Whatching the debug console I've seen two error messages:
>
> 1 - Bursa Wolf Parameter Required
> 2 -
>
> AVVERTENZA: Can't load a service for category DataSource.
> java.lang.NoClassDefFoundError:
> org/geotools/referencing/factory/epsg/DataSource
>>
>>Which JAR do you have in your classpath? Try to put "epsg-hsql.jar" and to
>>remove any other "epsg-*.jar" file from the classpath.
>>
>> Martin
Now in my classpath there are these JAR files: gt2-api , gt2-epsg-wkt ,
gt2-main , gt2-referencing, gt2-render , gt2-wfs , gt2-wms
Thanks in advance.
Jacopo
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users