createParser(datumFactory, mtFactory); addHints(datumFactory); addHints(mtFactory);
/** * Creates a projected coordinate reference system from a set of parameters. If the {@code * "semi_major"} and {@code "semi_minor"} parameters are not explicitly specified, they will be * inferred from the {@linkplain Ellipsoid ellipsoid} and added to the {@code parameters}. This * method also checks for axis order and unit conversions. * * @param properties Name and other properties to give to the new object. * @param baseCRS Geographic coordinate reference system to base projection on. * @param method The operation method, or {@code null} for a default one. * @param parameters The parameter values to give to the projection. * @param derivedCS The coordinate system for the projected CRS. * @throws FactoryException if the object creation failed. * @deprecated Use {@link CRSFactory#createDefiningConversion} followed by {@link * CRSFactory#createProjectedCRS} instead. */ @Deprecated public ProjectedCRS createProjectedCRS( Map<String, ?> properties, GeographicCRS baseCRS, OperationMethod method, ParameterValueGroup parameters, CartesianCS derivedCS) throws FactoryException { final MathTransform mt = createBaseToDerived(baseCRS, parameters, derivedCS); if (method == null) { method = getLastUsedMethod(); } return ((ReferencingObjectFactory) getCRSFactory()) .createProjectedCRS(properties, method, baseCRS, mt, derivedCS); }
/** * Creates a coordinate reference system object from a string. * * @param wkt Coordinate system encoded in Well-Known Text format. * @throws FactoryException if the object creation failed. */ public synchronized CoordinateReferenceSystem createFromWKT(final String wkt) throws FactoryException { /* * Note: while this factory is thread safe, the WKT parser is not. * Since we share a single instance of this parser, we must synchronize. */ if (parser == null) { createParser(ReferencingFactoryFinder.getDatumFactory(null), getMathTransformFactory()); } try { return parser.parseCoordinateReferenceSystem(wkt); } catch (ParseException exception) { final Throwable cause = exception.getCause(); if (cause instanceof FactoryException) { throw (FactoryException) cause; } throw new FactoryException(exception); } }
MathTransform mt; final MathTransform existing = conversionFromBase.getMathTransform(); final MathTransformFactory mtFactory = getMathTransformFactory(); if (existing != null && mtFactory instanceof DefaultMathTransformFactory) {
final Ellipsoid ellipsoid = DefaultEllipsoid.WGS84; final PrimeMeridian meridian = DefaultPrimeMeridian.GREENWICH; DatumFactory factory = new ReferencingObjectFactory(); final Map<String, ?> properties = Collections.singletonMap("name", name1); GeodeticDatum datum = factory.createGeodeticDatum(properties, ellipsoid, meridian);
if (mt == null) { final ParameterValueGroup parameters = conversionFromBase.getParameterValues(); final MathTransformFactory mtFactory = getMathTransformFactory(); mt = mtFactory.createParameterizedTransform(parameters);