jle ha scritto:
> I have searched the mailing list about Lat/Long to TransverseMercator (UTM)
> however what other had asked were not like my issue.
>
> I am trying to do a quick projection transform from Lat/Long to UTM and
> would like not to use the CRS class.
>
> try {
> MathTransformFactory mtFactory =
> ReferencingFactoryFinder.getMathTransformFactory(null);
> ParameterValueGroup parameters =
> mtFactory.getDefaultParameters("Transverse_Mercator");
>
> parameters.parameter("semi_major").setValue(DefaultEllipsoid.WGS84.getSemiMajorAxis());
>
> parameters.parameter("semi_minor").setValue(DefaultEllipsoid.WGS84.getSemiMinorAxis());
> parameters.parameter("scale_factor").setValue(0.9996);
> parameters.parameter("false_easting").setValue(500000);
> parameters.parameter("false_northing").setValue(0);
>
> MathTransform toUTM = new
> org.geotools.referencing.operation.projection.TransverseMercator(parameters);
>
> } catch (NoSuchIdentifierException e) {
> e.printStackTrace();
> }
>
> However, TransverseMercator has protected access in the gt-referencing so
> the code above doesn't work. Any suggestion to deal with this error?
You have the factory there, use it :-)
MathTransform toUTM = mtFactory.createParameterizedTransform(parameters);
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users