private static org.opengis.geometry.Envelope getCRSEnvelope(CoordinateReferenceSystem targetCRS) throws FactoryException, NoSuchAuthorityCodeException { if (targetCRS.getDomainOfValidity() == null) { Integer code = CRS.lookupEpsgCode(targetCRS, true); if (code != null) { CRS.decode("EPSG:" + code, CRS.getAxisOrder(targetCRS) != AxisOrder.NORTH_EAST); } } org.opengis.geometry.Envelope envelope = CRS.getEnvelope(targetCRS); return envelope; }
GeographicBoundingBoxImpl merged = null; if (crs != null) { final Extent domainOfValidity = crs.getDomainOfValidity(); if (domainOfValidity != null) { for (final GeographicExtent extent : domainOfValidity.getGeographicElements()) {
GeneralEnvelope merged = null; if (crs != null) { final Extent domainOfValidity = crs.getDomainOfValidity(); if (domainOfValidity != null) { for (final GeographicExtent extent : domainOfValidity.getGeographicElements()) {
/** * Returns the valid geographic area for the given coordinate reference system, or {@code null} if unknown. * This method explores the {@linkplain org.apache.sis.referencing.crs.AbstractCRS#getDomainOfValidity() domain of * validity} associated with the given CRS. If more than one geographic bounding box is found, then this method * computes their {@linkplain DefaultGeographicBoundingBox#add(GeographicBoundingBox) union}. * together. * * @param crs the coordinate reference system for which to get the domain of validity, or {@code null}. * @return the geographic area where the coordinate reference system is valid, or {@code null} if unspecified. * * @see #getDomainOfValidity(CoordinateReferenceSystem) * @see Extents#getGeographicBoundingBox(Extent) * * @category information */ public static GeographicBoundingBox getGeographicBoundingBox(final CoordinateReferenceSystem crs) { return (crs != null) ? Extents.getGeographicBoundingBox(crs.getDomainOfValidity()) : null; }
/** * Returns the valid geographic area for the given coordinate reference system, or {@code null} if unknown. * This method explores the {@linkplain org.apache.sis.referencing.crs.AbstractCRS#getDomainOfValidity() domain of * validity} associated with the given CRS. If more than one geographic bounding box is found, then this method * computes their {@linkplain DefaultGeographicBoundingBox#add(GeographicBoundingBox) union}. * together. * * @param crs the coordinate reference system for which to get the domain of validity, or {@code null}. * @return the geographic area where the coordinate reference system is valid, or {@code null} if unspecified. * * @see #getDomainOfValidity(CoordinateReferenceSystem) * @see Extents#getGeographicBoundingBox(Extent) * * @category information */ public static GeographicBoundingBox getGeographicBoundingBox(final CoordinateReferenceSystem crs) { return (crs != null) ? Extents.getGeographicBoundingBox(crs.getDomainOfValidity()) : null; }
/** * Suggests properties for a compound CRS made of the given elements. * This method builds a default CRS name and domain of validity. * * @param components the components for which to get a default set of properties. * @return suggested properties in a modifiable map. Callers can modify the returned map. */ public static Map<String,Object> properties(final CoordinateReferenceSystem... components) { final StringBuilder name = new StringBuilder(40); Extent domain = null; for (int i=0; i<components.length; i++) { final CoordinateReferenceSystem crs = components[i]; ArgumentChecks.ensureNonNullElement("components", i, crs); if (i != 0) name.append(" + "); name.append(crs.getName().getCode()); domain = Extents.intersection(domain, crs.getDomainOfValidity()); } final Map<String,Object> properties = new HashMap<>(2); properties.put(CoordinateReferenceSystem.NAME_KEY, name.toString()); properties.put(CoordinateReferenceSystem.DOMAIN_OF_VALIDITY_KEY, domain); return properties; } }
/** * Suggests properties for a compound CRS made of the given elements. * This method builds a default CRS name and domain of validity. * * @param components the components for which to get a default set of properties. * @return suggested properties in a modifiable map. Callers can modify the returned map. */ public static Map<String,Object> properties(final CoordinateReferenceSystem... components) { final StringBuilder name = new StringBuilder(40); Extent domain = null; for (int i=0; i<components.length; i++) { final CoordinateReferenceSystem crs = components[i]; ArgumentChecks.ensureNonNullElement("components", i, crs); if (i != 0) name.append(" + "); name.append(crs.getName().getCode()); domain = Extents.intersection(domain, crs.getDomainOfValidity()); } final Map<String,Object> properties = new HashMap<>(2); properties.put(CoordinateReferenceSystem.NAME_KEY, name.toString()); properties.put(CoordinateReferenceSystem.DOMAIN_OF_VALIDITY_KEY, domain); return properties; } }
private void validateCRS(CoordinateReferenceSystem crs, boolean domainShouldNotBeNull) throws Exception { assertNotNull("CRS should not be null", crs); if (domainShouldNotBeNull) { assertNotNull("Domain of Validity should not be null", crs.getDomainOfValidity()); } else { assertNull("Unexpected Domain of Validity", crs.getDomainOfValidity()); } }
private void validateCRS(CoordinateReferenceSystem crs, boolean domainShouldNotBeNull) throws Exception { assertNotNull("CRS should not be null", crs); if (domainShouldNotBeNull) { assertNotNull("Domain of Validity should not be null", crs.getDomainOfValidity()); } else { assertNull("Unexpected Domain of Validity", crs.getDomainOfValidity()); } }
final Extent domainOfValidity = crs.getDomainOfValidity();
final Extent domainOfValidity = crs.getDomainOfValidity();
remarks = crs.getRemarks(); Extent domainOfValidity = crs.getDomainOfValidity(); if (domainOfValidity != null) { areaOfValidity =
crs.getDomainOfValidity() .getGeographicElements() .iterator()