private void encodeDatasetBounds(CoverageInfo ci, GridCoverage2DReader reader) throws IOException { // get the crs and look for an EPSG code final CoordinateReferenceSystem crs = ci.getCRS(); GeneralEnvelope envelope = reader.getOriginalEnvelope(); List<String> axesNames = envelopeAxisMapper.getAxesNames(envelope, true); // lookup EPSG code Integer EPSGCode = null; try { EPSGCode = CRS.lookupEpsgCode(crs, false); } catch (FactoryException e) { throw new IllegalStateException( "Unable to lookup epsg code for this CRS:" + crs, e); } if (EPSGCode == null) { throw new IllegalStateException("Unable to lookup epsg code for this CRS:" + crs); } final String srsName = GetCoverage.SRS_STARTER + EPSGCode; // handle axes swap for geographic crs final boolean axisSwap = CRS.getAxisOrder(crs).equals(AxisOrder.EAST_NORTH); final StringBuilder builder = new StringBuilder(); for (String axisName : axesNames) { builder.append(axisName).append(" "); } String axesLabel = builder.substring(0, builder.length() - 1); dcTranslator.handleBoundedBy(envelope, axisSwap, srsName, axesLabel, null); }
public int getAxisIndex(final Envelope envelope, final String axisAbbreviation) { final int[] val = getAxesIndexes(envelope, Arrays.asList(axisAbbreviation)); return (val == null ? -1 : val[0]); }
/** * This method is responsible for extracting the spatial interpolation from the provided {@link * GetCoverageType} request. * * <p>We don't support mixed interpolation at this time and we will never support it for grid * axes. * * @param axesInterpolations the association between axes URIs and the requested interpolations. * @param envelope the original envelope for the source {@link GridCoverage}. * @return the requested {@link Interpolation} */ private Interpolation extractSpatialInterpolation( Map<String, InterpolationPolicy> axesInterpolations, Envelope envelope) { // extract interpolation // // we assume that we are going to support the same interpolation ONLY on the i and j axes // therefore we extract the first one of the two we find. We implicitly assume we already // checked that we don't have mixed interpolation types for lat,lon Interpolation interpolation = InterpolationPolicy.getDefaultPolicy().getInterpolation(); for (String axisLabel : axesInterpolations.keySet()) { // check if this is an axis we like final int index = envelopeDimensionsMapper.getAxisIndex(envelope, axisLabel); if (index == 0 || index == 1) { // found it! interpolation = axesInterpolations.get(axisLabel).getInterpolation(); break; } } return interpolation; }
envelopeDimensionsMapper.getAxesNames(sourceEnvelopeInSubsettingCRS, true); final List<String> foundDimensions = new ArrayList<String>(); envelopeDimensionsMapper.getAxisIndex( sourceEnvelopeInSubsettingCRS, dimension); if (axisIndex < 0) { envelopeDimensionsMapper.getAxisIndex( sourceEnvelopeInSubsettingCRS, dimension); if (axisIndex < 0) {
if (getAxisLabel(axis).equals(axisAbbreviation)) {
for (int i = 0; i < dimension; i++) { CoordinateSystemAxis axis = cs.getAxis(i); retValue.add(getAxisLabel(axis)); // use axis abbreviation northing = i; retValue.add(getAxisLabel(axis)); // use axis abbreviation
new HashMap<String, InterpolationPolicy>(); final Envelope envelope = reader.getOriginalEnvelope(); final List<String> axesNames = envelopeDimensionsMapper.getAxesNames(envelope, true); for (String axisName : axesNames) { returnValue.put(
envelopeDimensionsMapper.getAxesNames(reader.getOriginalEnvelope(), true); envelopeDimensionsMapper.getAxesNames(reader.getOriginalEnvelope(), false); for (String axisName : axesNames) { builder.append(axisName).append(" ");
GMLTransformer.this.envelopeDimensionsMapper.getAxesNames( gc2d.getEnvelope2D(), true); GMLTransformer.this.envelopeDimensionsMapper.getAxesNames( gc2d.getEnvelope2D(), false); for (String axisName : axesNames) {