use of org.apache.sis.parameter.ParameterBuilder in project sis by apache.
the class NoOp method parameters.
/**
* Work around for RFE #4093999 in Sun's bug database
* ("Relax constraint on placement of this()/super() call in constructors").
*/
@Workaround(library = "JDK", version = "1.7")
private static Parameters parameters(final double semiMajor, final double semiMinor) {
final ParameterValueGroup group = new ParameterBuilder().addName("No-operation").createGroupForMapProjection().createValue();
group.parameter(Constants.SEMI_MAJOR).setValue(semiMajor);
group.parameter(Constants.SEMI_MINOR).setValue(semiMinor);
return (Parameters) group;
}
use of org.apache.sis.parameter.ParameterBuilder in project sis by apache.
the class AbstractOperationTest method foundCity.
/**
* Returns an operation that found new cities.
*/
static AbstractOperation foundCity() {
final ParameterBuilder builder = new ParameterBuilder();
final ParameterDescriptor<?>[] parameters = { builder.addName("founder").create(String.class, null) };
return new NoOperation(singletonMap(AbstractOperation.NAME_KEY, "new city"), builder.addName("create").createGroup(parameters), DefaultAttributeTypeTest.city());
}
use of org.apache.sis.parameter.ParameterBuilder in project sis by apache.
the class Molodensky method internal.
/**
* Creates a descriptor for the internal parameters of {@link MolodenskyTransform}.
* This is similar to the standard parameters except that the redundant target axes
* lengths are omitted.
*
* @return internal parameter descriptor.
*/
@Debug
public static ParameterDescriptorGroup internal() {
final ParameterBuilder builder = builder().setCodeSpace(Citations.SIS, Constants.SIS);
ParameterDescriptor<Boolean> abridged = builder.addName("abridged").create(Boolean.class, null);
return builder.addName("Molodensky (radians domain)").createGroup(DIMENSION, SRC_SEMI_MAJOR, SRC_SEMI_MINOR, AXIS_LENGTH_DIFFERENCE, FLATTENING_DIFFERENCE, TX, TY, TZ, abridged);
}
use of org.apache.sis.parameter.ParameterBuilder in project sis by apache.
the class CC_OperationParameterGroupTest method create.
/**
* Creates the parameter descriptors equivalent to the result of {@link #unmarshal()}
* but with value class, units and default values.
*
* @param remarks Remarks to associate to the latitude parameter, or {@code null} if none.
*/
private static ParameterDescriptor<?>[] create(final String remarks) {
final ParameterBuilder builder = new ParameterBuilder();
builder.setCodeSpace(EPSG, "EPSG").setRequired(true);
return new ParameterDescriptor<?>[] { builder.addIdentifier("8801").addName("Latitude of natural origin").setRemarks(remarks).create(0, Units.DEGREE), builder.addIdentifier("8802").addName("Longitude of natural origin").create(0, Units.DEGREE) };
}
use of org.apache.sis.parameter.ParameterBuilder in project sis by apache.
the class SingleOperationMarshallingTest method createMercatorMethod.
/**
* Creates the test operation method.
*/
private static DefaultOperationMethod createMercatorMethod() {
final ParameterBuilder builder = new ParameterBuilder();
builder.setCodeSpace(EPSG, "EPSG").setRequired(true);
ParameterDescriptor<?>[] parameters = { builder.addIdentifier("8801").addName("Latitude of natural origin").create(0, Units.DEGREE), builder.addIdentifier("8802").addName("Longitude of natural origin").create(0, Units.DEGREE) // There is more parameters for a Mercator projection, but 2 is enough for this test.
};
builder.addName(null, "Mercator (1SP)");
final ParameterDescriptorGroup descriptor = builder.createGroup(parameters);
final Map<String, Object> properties = new HashMap<>(4);
properties.put(DefaultOperationMethod.NAME_KEY, descriptor.getName());
properties.put(DefaultOperationMethod.FORMULA_KEY, new DefaultFormula("See EPSG guide."));
return new DefaultOperationMethod(properties, 2, 2, descriptor);
}
Aggregations