/** * Creates a projected coordinate reference system from a conversion. * * @param properties Name and other properties to give to the new object. * @param baseCRS Geographic coordinate reference system to base projection on. * @param conversionFromBase The {@linkplain DefiningConversion defining conversion}. * @param derivedCS The coordinate system for the projected CRS. * @throws FactoryException if the object creation failed. * @deprecated Moved to the {@link CRSFactory} interface. */ @Deprecated public ProjectedCRS createProjectedCRS( Map<String, ?> properties, final GeographicCRS baseCRS, final Conversion conversionFromBase, final CartesianCS derivedCS) throws FactoryException { return getCRSFactory() .createProjectedCRS(properties, baseCRS, conversionFromBase, derivedCS); }
/** Returns the direct {@linkplain Factory factory} dependencies. */ @Override Collection<? super AuthorityFactory> dependencies() { if (factories != null) { final Set<Object> dependencies = new LinkedHashSet<Object>(8); dependencies.add(factories.getCRSFactory()); dependencies.add(factories.getCSFactory()); dependencies.add(factories.getDatumFactory()); return dependencies; } return super.dependencies(); } }
/** * Forces the initialisation of all factories. Implementation note: we try to create the * factories in typical dependency order (CRS all because it has the greatest chances to depends * on other factories). */ private void initialize() { mtFactory = getMathTransformFactory(); datumFactory = getDatumFactory(); csFactory = getCSFactory(); crsFactory = getCRSFactory(); }
/** * Constructs a parser for the specified set of symbols using the specified set of factories. * * @param symbols The symbols for parsing and formatting numbers. * @param factories The factories to use. */ public Parser(final Symbols symbols, final ReferencingFactoryContainer factories) { this( symbols, factories.getDatumFactory(), factories.getCSFactory(), factories.getCRSFactory(), factories.getMathTransformFactory()); }
final CoordinateReferenceSystem crs = factories .getCRSFactory() .createGeographicCRS(properties, datum, DefaultEllipsoidalCS.GEODETIC_2D); if (crsMap.put(code, crs) != null) {
/** * 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); }
temporalCRS = NetCDFCRSUtilities.FACTORY_CONTAINER .getCRSFactory() .createTemporalCRS(crsMap, temporalDatum, timeCS); } catch (FactoryException e) {
verticalCRS = NetCDFCRSUtilities.FACTORY_CONTAINER .getCRSFactory() .createVerticalCRS(crsMap, verticalDatum, verticalCS);
/** * Creates a coordinate reference system from the specified code. The default implementation * creates a {@linkplain ParameterValueGroup parameter group} for the {@linkplain * #getClassification projection classification}, and then invokes {@link * #setProjectionParameters} in order to fill the parameter values. */ public final ProjectedCRS create(final Code code, final ReferencingFactoryContainer factories) throws FactoryException { final String classification = getClassification(); final ParameterValueGroup parameters; parameters = factories.getMathTransformFactory().getDefaultParameters(classification); setProjectionParameters(parameters, code); final String name = getName(); final DefiningConversion conversion = new DefiningConversion(name, parameters); return factories .getCRSFactory() .createProjectedCRS( Collections.singletonMap(IdentifiedObject.NAME_KEY, name), DefaultGeographicCRS.WGS84, conversion, DefaultCartesianCS.PROJECTED); }
temporalCRS = NetCDFCRSUtilities.FACTORY_CONTAINER .getCRSFactory() .createTemporalCRS(crsMap, temporalDatum, timeCS);
final CRSFactory factory = factories.getCRSFactory(); final CoordinateReferenceSystem crs;
final CRSFactory factory = factories.getCRSFactory(); final CoordinateReferenceSystem crs;
/** * Makes sure that the specified geocentric CRS uses standard axis, prime meridian and the * specified datum. If {@code crs} already meets all those conditions, then it is returned * unchanged. Otherwise, a new normalized geocentric CRS is created and returned. * * @param crs The geocentric coordinate reference system to normalize. * @param datum The expected datum. * @return The normalized coordinate reference system. * @throws FactoryException if the construction of a new CRS was needed but failed. */ private GeocentricCRS normalize(final GeocentricCRS crs, final GeodeticDatum datum) throws FactoryException { final CartesianCS STANDARD = DefaultCartesianCS.GEOCENTRIC; final GeodeticDatum candidate = crs.getDatum(); if (equalsIgnorePrimeMeridian(candidate, datum)) { if (getGreenwichLongitude(candidate.getPrimeMeridian()) == getGreenwichLongitude(datum.getPrimeMeridian())) { if (hasStandardAxis(crs.getCoordinateSystem(), STANDARD)) { return crs; } } } final CRSFactory crsFactory = getFactoryContainer().getCRSFactory(); return crsFactory.createGeocentricCRS(getTemporaryName(crs), datum, STANDARD); }
/** * A datum identical to the specified datum except for the prime meridian, which is replaced by * Greenwich. This datum is processed in a special way by {@link #equalsIgnorePrimeMeridian}. */ private static final class TemporaryDatum extends DefaultGeodeticDatum { /** For cros-version compatibility. */ private static final long serialVersionUID = -8964199103509187219L; /** The wrapped datum. */ private final GeodeticDatum datum; /** Wrap the specified datum. */ public TemporaryDatum(final GeodeticDatum datum) { super(getTemporaryName(datum), datum.getEllipsoid(), DefaultPrimeMeridian.GREENWICH); this.datum = datum; } /** Unwrap the datum. */ public static GeodeticDatum unwrap(GeodeticDatum datum) { while (datum instanceof TemporaryDatum) { datum = ((TemporaryDatum) datum).datum; } return datum; } /** Compares this datum with the specified object for equality. */ @Override public boolean equals( final AbstractIdentifiedObject object, final boolean compareMetadata) { if (super.equals(object, compareMetadata)) {
final CRSFactory crsFactory = getFactoryContainer().getCRSFactory(); return crsFactory.createGeographicCRS(getTemporaryName(crs), datum, STANDARD);
return targets[0]; return getCRSFactory() .createCompoundCRS(getTemporaryName(crs), XArray.resize(targets, count));
assertSame(datumFactory, container.getDatumFactory()); assertSame(csFactory, container.getCSFactory()); assertSame(crsFactory, container.getCRSFactory()); assertSame(mtFactory, container.getMathTransformFactory());
final CRSFactory crsFactory = factories.getCRSFactory(); Conversion fromBase = derivedCRS.getConversionFromBase(); fromBase = final Map properties = getProperties(crs); final ReferencingFactoryContainer factories = getFactoryContainer(true); final CRSFactory crsFactory = factories.getCRSFactory(); if (crs instanceof GeographicCRS) { modified =
final CRSFactory crsFactory = getCRSFactory(); if (horizontal instanceof GeographicCRS) {
final CRSFactory crsFactory = getFactoryContainer().getCRSFactory(); if (getGreenwichLongitude(targetPM) == 0) { stepCRS =