@Override public ParameterValueGroup getReadParameters() { HashMap<String, String> info = new HashMap<String, String>(); info.put("name", getName()); info.put("description", getDescription()); info.put("vendor", getVendor()); info.put("docURL", getDocURL()); info.put("version", getVersion()); List<GeneralParameterDescriptor> delegateFormatParams = new ArrayList<GeneralParameterDescriptor>(); delegateFormatParams.addAll( delegateFormat.getReadParameters().getDescriptor().descriptors()); // add bands parameter descriptor only if the delegate reader doesn't have it // already if (!checkIfDelegateReaderSupportsBands()) { delegateFormatParams.add(AbstractGridFormat.BANDS); } return new ParameterGroup( new DefaultParameterDescriptorGroup( info, delegateFormatParams.toArray( new GeneralParameterDescriptor [delegateFormatParams.size()]))); }
/** Helper method that checks if the delegate reader support bands selection. */ private boolean checkIfDelegateReaderSupportsBands() { List<GeneralParameterDescriptor> parameters = delegate.getFormat().getReadParameters().getDescriptor().descriptors(); for (GeneralParameterDescriptor parameterDescriptor : parameters) { if (parameterDescriptor.getName().equals(AbstractGridFormat.BANDS.getName())) { return true; } } return false; }
int[] getSelectedBandIndexes(GeneralParameterValue[] parameters) { // if the delegate cannot do band selection, don't bother if (delegate.getFormat() == null || !delegate.getFormat() .getReadParameters() .getDescriptor() .descriptors() .contains(AbstractGridFormat.BANDS)) { return null; } // lookup the bands if possible if (parameters != null) { for (int i = 0; i < parameters.length; i++) { final ParameterValue param = (ParameterValue) parameters[i]; if (AbstractGridFormat.BANDS.getName().equals(param.getDescriptor().getName())) { int[] bandIndicesParam = (int[]) param.getValue(); return bandIndicesParam; } } } return null; }
ParameterValueGroup readParameters = format.getReadParameters(); List<GeneralParameterDescriptor> descriptors = readParameters.getDescriptor().descriptors();
/** * Constructs a new map projection from the supplied parameters. * * @param parameters The parameter values in standard units. * @throws ParameterNotFoundException if a mandatory parameter is missing. * @todo Current implementation assumes a "azimuth" case. We may try to detect automatically the * "two points" case in a future version if needed. Note that this limitation doesn't apply * to projection created from the {@link Provider_TwoPoint}. */ protected HotineObliqueMercator(final ParameterValueGroup parameters) throws ParameterNotFoundException { this(parameters, Provider.PARAMETERS.descriptors(), false); }
/** * Constructs a new map projection from the supplied parameters. * * @param parameters The parameter values in standard units. * @throws ParameterNotFoundException if a mandatory parameter is missing. * @since 2.4 * @todo Current implementation assumes a "azimuth" case. We may try to detect the "two points" * case in a future version if needed. */ protected ObliqueMercator(final ParameterValueGroup parameters) throws ParameterNotFoundException { this(parameters, Provider.PARAMETERS.descriptors(), false, false); }
/** * Creates a transform from the specified group of parameter values. * * @param parameters The group of parameter values. * @param descriptor The expected parameter descriptor. * @throws ParameterNotFoundException if a required parameter was not found. */ Stereographic(final ParameterValueGroup parameters, final ParameterDescriptorGroup descriptor) throws ParameterNotFoundException { // Fetch parameters super(parameters, descriptor.descriptors()); this.descriptor = descriptor; }
/** * Constructs a group with the same values than the specified one. This copy constructor may be * used in order to wraps an arbitrary implementation into a Geotools one. * * @since 2.2 */ public DefaultParameterDescriptorGroup(final ParameterDescriptorGroup group) { super(group); maximumOccurs = group.getMaximumOccurs(); final List<GeneralParameterDescriptor> c = group.descriptors(); parameters = c.toArray(new GeneralParameterDescriptor[c.size()]); }
/** * Creates a transform from the specified group of parameter values. * * @param parameters The group of parameter values. * @return The created math transform. * @throws ParameterNotFoundException if a required parameter was not found. */ protected MathTransform createMathTransform(final ParameterValueGroup parameters) throws ParameterNotFoundException { final Collection<GeneralParameterDescriptor> descriptors = PARAMETERS.descriptors(); return new ObliqueMercator(parameters, descriptors, false, false); } }
/** * Creates a transform from the specified group of parameter values. * * @param parameters The group of parameter values. * @return The created math transform. * @throws ParameterNotFoundException if a required parameter was not found. */ @Override protected MathTransform createMathTransform(final ParameterValueGroup parameters) throws ParameterNotFoundException { final Collection<GeneralParameterDescriptor> descriptors = PARAMETERS.descriptors(); return new HotineObliqueMercator(parameters, descriptors, true); } }
/** * Creates a transform from the specified group of parameter values. * * @param parameters The group of parameter values. * @return The created math transform. * @throws ParameterNotFoundException if a required parameter was not found. */ @Override protected MathTransform createMathTransform(final ParameterValueGroup parameters) throws ParameterNotFoundException { final Collection<GeneralParameterDescriptor> descriptors = PARAMETERS.descriptors(); return new HotineObliqueMercator(parameters, descriptors, false); } }
/** {@inheritDoc} */ @Override public ParameterValueGroup getParameterValues() { final ParameterValueGroup values = super.getParameterValues(); if (!Double.isNaN(standardParallel)) { final Collection<GeneralParameterDescriptor> expected = getParameterDescriptors().descriptors(); set(expected, AbstractProvider.STANDARD_PARALLEL_1, values, standardParallel); } return values; }
/** {@inheritDoc} */ @Override public ParameterValueGroup getParameterValues() { final ParameterValueGroup values = super.getParameterValues(); if (!Double.isNaN(standardParallel)) { final Collection<GeneralParameterDescriptor> expected = getParameterDescriptors().descriptors(); set(expected, Provider.STANDARD_PARALLEL_1, values, standardParallel); } return values; }
@Override public ParameterValueGroup getParameterValues() { final ParameterValueGroup values = super.getParameterValues(); final ParameterDescriptorGroup descriptor = getParameterDescriptors(); final Collection<GeneralParameterDescriptor> expected = descriptor.descriptors(); set(expected, Provider.SATELLITE_HEIGHT, values, h); return values; }
/** {@inheritDoc} */ @Override public ParameterValueGroup getParameterValues() { final ParameterValueGroup values = super.getParameterValues(); final Collection<GeneralParameterDescriptor> expected = getParameterDescriptors().descriptors(); set(expected, Provider.LATITUDE_OF_CENTRE, values, latitudeOfCentre); set(expected, Provider.LONGITUDE_OF_CENTRE, values, centralMeridian); return values; }
/** {@inheritDoc} */ @Override public ParameterValueGroup getParameterValues() { final ParameterValueGroup values = super.getParameterValues(); final Collection<GeneralParameterDescriptor> expected = getParameterDescriptors().descriptors(); set(expected, Provider.LATITUDE_OF_CENTRE, values, latitudeOfOrigin); set(expected, Provider.LONGITUDE_OF_CENTRE, values, centralMeridian); return values; }
/** {@inheritDoc} */ @Override public ParameterValueGroup getParameterValues() { final ParameterValueGroup values = super.getParameterValues(); final Collection<GeneralParameterDescriptor> expected = getParameterDescriptors().descriptors(); set(expected, Provider.STANDARD_PARALLEL_1, values, phi1); set(expected, Provider.STANDARD_PARALLEL_2, values, phi2); return values; }
/** {@inheritDoc} */ @Override public ParameterValueGroup getParameterValues() { final ParameterValueGroup values = super.getParameterValues(); final Collection<GeneralParameterDescriptor> expected = getParameterDescriptors().descriptors(); set(expected, AbstractProvider.STANDARD_PARALLEL_1, values, phi1); set(expected, AbstractProvider.STANDARD_PARALLEL_2, values, phi2); return values; }
/** {@inheritDoc} */ @Override public ParameterValueGroup getParameterValues() { final ParameterValueGroup values = super.getParameterValues(); final Collection<GeneralParameterDescriptor> expected = getParameterDescriptors().descriptors(); set(expected, Provider.STANDARD_PARALLEL_1, values, phi1); set(expected, Provider.STANDARD_PARALLEL_2, values, phi2); return values; }
/** * Return the values of the parameters that define the projection. * * @see org.geotools.referencing.operation.projection.MapProjection#getParameterValues() */ @Override public ParameterValueGroup getParameterValues() { ParameterValueGroup values = super.getParameterValues(); List<GeneralParameterDescriptor> descriptors = getParameterDescriptors().descriptors(); set(descriptors, Provider.LONGITUDE_OF_CENTRE, values, centralMeridian); set(descriptors, Provider.LATITUDE_OF_CENTRE, values, latitudeOfOrigin); return values; } };