Search in sources :

Example 1 with DefaultCompoundCS

use of org.apache.sis.referencing.cs.DefaultCompoundCS in project sis by apache.

the class DefaultCompoundCRS method createCoordinateSystem.

/**
 * Returns a compound coordinate system for the specified array of CRS objects.
 *
 * @param  properties  the properties given to the constructor, or {@code null} if unknown.
 * @param  components  the CRS components, usually singles but not necessarily.
 * @return the coordinate system for the given components.
 */
private static CoordinateSystem createCoordinateSystem(final Map<String, ?> properties, final CoordinateReferenceSystem[] components) {
    ArgumentChecks.ensureNonNull("components", components);
    verify(properties, components);
    if (components.length < 2) {
        throw new IllegalArgumentException(Errors.getResources(properties).getString(Errors.Keys.TooFewArguments_2, 2, components.length));
    }
    final CoordinateSystem[] cs = new CoordinateSystem[components.length];
    for (int i = 0; i < components.length; i++) {
        final CoordinateReferenceSystem crs = components[i];
        ArgumentChecks.ensureNonNullElement("components", i, crs);
        cs[i] = crs.getCoordinateSystem();
    }
    return new DefaultCompoundCS(cs);
}
Also used : CoordinateSystem(org.opengis.referencing.cs.CoordinateSystem) CoordinateReferenceSystem(org.opengis.referencing.crs.CoordinateReferenceSystem) DefaultCompoundCS(org.apache.sis.referencing.cs.DefaultCompoundCS)

Aggregations

DefaultCompoundCS (org.apache.sis.referencing.cs.DefaultCompoundCS)1 CoordinateReferenceSystem (org.opengis.referencing.crs.CoordinateReferenceSystem)1 CoordinateSystem (org.opengis.referencing.cs.CoordinateSystem)1