From: Paulm <pau...@sa...> - 2009-02-09 15:27:41
|
Paulm wrote: > > Hi! > I´ve tried Abels example code for creating CRS, but this row: > MathTransformFactory mtFactory = > FactoryFinder.getMathTransformFactory(null) > > flags error: "The method getMathTransformFactory(null) is undefined for > the type FactoryFinder" > Have I missed something? > > I´m using GeoTools 2.5.1 > and I´ve imported the following packages: > import org.geotools.factory.FactoryFinder; > import org.geotools.referencing.factory.ReferencingFactoryContainer; > import org.opengis.parameter.ParameterValueGroup; > import org.opengis.referencing.crs.CoordinateReferenceSystem; > import org.opengis.referencing.crs.GeographicCRS; > import org.opengis.referencing.crs.ProjectedCRS; > import org.opengis.referencing.cs.CartesianCS; > import org.opengis.referencing.operation.MathTransformFactory; > > > /Paul > > -----Original Message----- > From: Martin Desruisseaux [mailto:mar...@ge...] > Sent: den 18 december 2008 15:14 > To: Malm Paul > Cc: geo...@li... > Subject: Re: [Geotools-gt2-users] userdefined CoordinateReferenceSystem > > Malm Paul a écrit : >> Is there any example how to create a userdefined >> CoordinateReferenceSystem with elippsoid and projection parameters as >> input? > > First, you need to create a GeographicCRS from your Ellipsoid. You can use > org.opengis.referencing.crs.CRSFactory for this purpose (this approach is > implementation-independant), or instantiate DefaultGeographicCRS directly > (easier, but specific to GeoTools implementation). > > Next, you need to create a MathTransform from your parameters. Use > MathTransformFactory for that. First invoke getDefaultParameter with the > projection name in arguments, then set your parameter values using > group.parameter("a parameter name").setValue(aValue). Finally pass the > parameters to MathTransformFactory.createParameterizedTransform. > > Finally, you can create a ProjectedCRS from the two above piece. Again you > can use the CRSFactory (implementation-independant) or instantiate > DefaultProjectedCRS directly (slightly easier - it has a convenience > method expecting directly a MathTransform). > > Martin > > ------------------------------------------------------------------------------ > Check out the new SourceForge.net Marketplace. > It is the best place to buy or sell services for > just about anything Open Source. > http://p.sf.net/sfu/Xq1LFB > _______________________________________________ > Geotools-gt2-users mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > > -- View this message in context: http://n2.nabble.com/userdefined-CoordinateReferenceSystem-tp1943427p2297730.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. |