protected CoordinateReferenceSystem getCrsForCoverage(final String coverageName) { CoordinateReferenceSystem crs = crsCache.get(coverageName); if (crs != null) { return crs; } final AdapterToIndexMapping adapterMapping = geowaveAdapterIndexMappingStore.getIndicesForAdapter(getAdapterId(coverageName)); final Index[] indices = adapterMapping.getIndices(geowaveIndexStore); if ((indices != null) && (indices.length > 0)) { crs = GeometryUtils.getIndexCrs(indices[0]); crsCache.put(coverageName, crs); } return crs; }
public static CoordinateReferenceSystem getIndexCrs(final Index[] indices) { CoordinateReferenceSystem indexCrs = null; for (final Index primaryindx : indices) { // for first iteration if (indexCrs == null) { indexCrs = getIndexCrs(primaryindx); } else { if (primaryindx.getIndexModel() instanceof CustomCrsIndexModel) { // check if indexes have different CRS if (!indexCrs.equals(((CustomCrsIndexModel) primaryindx.getIndexModel()).getCrs())) { LOGGER.error("Multiple indices with different CRS is not supported"); throw new RuntimeException("Multiple indices with different CRS is not supported"); } else { if (!indexCrs.equals(getDefaultCRS())) { LOGGER.error("Multiple indices with different CRS is not supported"); throw new RuntimeException("Multiple indices with different CRS is not supported"); } } } } } return indexCrs; }
final CoordinateReferenceSystem indexCrs = GeometryUtils.getIndexCrs(index); final ReferencedEnvelope mapExtent = new ReferencedEnvelope(
final CoordinateReferenceSystem indexCrs = GeometryUtils.getIndexCrs(index); if (!indexCrs.equals(sourceCrs)) { try {
final CoordinateReferenceSystem inputIndexCrs = GeometryUtils.getIndexCrs(inputPrimaryIndex); final String inputCrsCode = GeometryUtils.getCrsCode(inputIndexCrs); outputIndexCrs = GeometryUtils.getIndexCrs(outputPrimaryIndex); outputCrsCode = GeometryUtils.getCrsCode(outputIndexCrs); } else {