本文整理汇总了Java中org.opengis.parameter.ParameterValue类的典型用法代码示例。如果您正苦于以下问题:Java ParameterValue类的具体用法?Java ParameterValue怎么用?Java ParameterValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParameterValue类属于org.opengis.parameter包,在下文中一共展示了ParameterValue类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: replaceParameter
import org.opengis.parameter.ParameterValue; //导入依赖的package包/类
/**
* Replace or add the provided parameter in the read parameters
*/
public static <T> GeneralParameterValue[] replaceParameter(
GeneralParameterValue[] readParameters, Object value, ParameterDescriptor<T> pd) {
// scan all the params looking for the one we want to add
for (GeneralParameterValue gpv : readParameters) {
// in case of match of any alias add a param value to the lot
if (gpv.getDescriptor().getName().equals(pd.getName())) {
((ParameterValue) gpv).setValue(value);
// leave
return readParameters;
}
}
// add it to the array
// add to the list
GeneralParameterValue[] readParametersClone = new GeneralParameterValue[readParameters.length + 1];
System.arraycopy(readParameters, 0, readParametersClone, 0, readParameters.length);
final ParameterValue<T> pv = pd.createValue();
pv.setValue(value);
readParametersClone[readParameters.length] = pv;
readParameters = readParametersClone;
return readParameters;
}
示例2: getGeoTiffWriteParameters
import org.opengis.parameter.ParameterValue; //导入依赖的package包/类
private static GeneralParameterValue[] getGeoTiffWriteParameters() {
GeoTiffWriteParams writeParams = new GeoTiffWriteParams();
writeParams.setCompressionMode(GeoTiffWriteParams.MODE_EXPLICIT);
writeParams.setCompressionType(GEOTIFF_COMPRESSION_TYPE);
writeParams.setCompressionQuality(GEOTIFF_COMPRESSION_QUALITY);
ParameterValue parameterValue = AbstractGridFormat.GEOTOOLS_WRITE_PARAMS.createValue();
parameterValue.setValue(writeParams);
return new GeneralParameterValue[] {
parameterValue
};
}
示例3: addImageMosaic
import org.opengis.parameter.ParameterValue; //导入依赖的package包/类
private void addImageMosaic( MapContent map ) throws Exception {
if (inImageMosaics != null) {
RasterSymbolizer sym = sf.getDefaultRasterSymbolizer();
Style style = SLD.wrapSymbolizers(sym);
final ParameterValue<Color> inTransp = AbstractGridFormat.INPUT_TRANSPARENT_COLOR.createValue();
inTransp.setValue(Color.white);
final ParameterValue<Color> outTransp = ImageMosaicFormat.OUTPUT_TRANSPARENT_COLOR.createValue();
outTransp.setValue(Color.white);
final ParameterValue<Color> backColor = ImageMosaicFormat.BACKGROUND_COLOR.createValue();
backColor.setValue(Color.RED);
final ParameterValue<Boolean> fading = ImageMosaicFormat.FADING.createValue();
fading.setValue(true);
final ParameterValue<Interpolation> interpol = ImageMosaicFormat.INTERPOLATION.createValue();
interpol.setValue(new javax.media.jai.InterpolationBilinear());
final ParameterValue<Boolean> resol = ImageMosaicFormat.ACCURATE_RESOLUTION.createValue();
resol.setValue(true);
final ParameterValue<Boolean> multiThread= ImageMosaicFormat.ALLOW_MULTITHREADING.createValue();
multiThread.setValue(true);
final ParameterValue<Boolean> usejai = ImageMosaicFormat.USE_JAI_IMAGEREAD.createValue();
usejai.setValue(false);
final ParameterValue<double[]> bkg = ImageMosaicFormat.BACKGROUND_VALUES.createValue();
bkg.setValue(new double[]{0});
GeneralParameterValue[] gp = new GeneralParameterValue[]{inTransp, multiThread};
for( String imageMosaicPath : inImageMosaics ) {
ImageMosaicReader imr = new ImageMosaicReader(new File(imageMosaicPath));
GridReaderLayer layer = new GridReaderLayer(imr, style, gp);
map.addLayer(layer);
}
}
}
示例4: createValueContainer
import org.opengis.parameter.ParameterValue; //导入依赖的package包/类
private static PropertyContainer createValueContainer(ParameterValueGroup valueGroup) {
final PropertyContainer vc = new PropertyContainer();
List<GeneralParameterDescriptor> descriptors = valueGroup.getDescriptor().descriptors();
for (GeneralParameterDescriptor descriptor : descriptors) {
final Class valueType;
Set validValues = null;
Comparable minValue = null;
Comparable maxValue = null;
if (descriptor instanceof ParameterDescriptor) {
ParameterDescriptor parameterDescriptor = (ParameterDescriptor) descriptor;
valueType = parameterDescriptor.getValueClass();
validValues = parameterDescriptor.getValidValues();
minValue = parameterDescriptor.getMinimumValue();
maxValue = parameterDescriptor.getMaximumValue();
} else {
valueType = Double.TYPE;
}
final String paramName = descriptor.getName().getCode();
final PropertyDescriptor vd = new PropertyDescriptor(paramName, valueType);
final ParameterValue<?> parameterValue = valueGroup.parameter(paramName);
if (parameterValue.getUnit() != null) {
vd.setUnit(String.valueOf(parameterValue.getUnit()));
}
if (validValues != null) {
vd.setValueSet(new ValueSet(validValues.toArray()));
}
if ( minValue instanceof Double && maxValue instanceof Double) {
Double min = (Double) minValue;
Double max = (Double) maxValue;
vd.setValueRange(new ValueRange(min, max));
if(parameterValue.getValue() == null) {
parameterValue.setValue((min + max) / 2);
}
}
vd.setDefaultConverter();
final Property property = new Property(vd, new PropertyAccessor() {
@Override
public Object getValue() {
return parameterValue.getValue();
}
@Override
public void setValue(Object value) {
parameterValue.setValue(value);
}
});
vc.addProperty(property);
}
return vc;
}