Search in sources :

Example 1 with ParameterBuilder

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;
}
Also used : Parameters(org.apache.sis.parameter.Parameters) ParameterValueGroup(org.opengis.parameter.ParameterValueGroup) ParameterBuilder(org.apache.sis.parameter.ParameterBuilder) Workaround(org.apache.sis.util.Workaround)

Example 2 with ParameterBuilder

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());
}
Also used : ParameterDescriptor(org.opengis.parameter.ParameterDescriptor) ParameterBuilder(org.apache.sis.parameter.ParameterBuilder)

Example 3 with ParameterBuilder

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);
}
Also used : ParameterBuilder(org.apache.sis.parameter.ParameterBuilder) Debug(org.apache.sis.util.Debug)

Example 4 with ParameterBuilder

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) };
}
Also used : GeneralParameterDescriptor(org.opengis.parameter.GeneralParameterDescriptor) ParameterDescriptor(org.opengis.parameter.ParameterDescriptor) DefaultParameterDescriptor(org.apache.sis.parameter.DefaultParameterDescriptor) ParameterBuilder(org.apache.sis.parameter.ParameterBuilder)

Example 5 with ParameterBuilder

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);
}
Also used : HashMap(java.util.HashMap) GeneralParameterDescriptor(org.opengis.parameter.GeneralParameterDescriptor) ParameterDescriptor(org.opengis.parameter.ParameterDescriptor) ParameterDescriptorGroup(org.opengis.parameter.ParameterDescriptorGroup) ParameterBuilder(org.apache.sis.parameter.ParameterBuilder)

Aggregations

ParameterBuilder (org.apache.sis.parameter.ParameterBuilder)7 ParameterDescriptor (org.opengis.parameter.ParameterDescriptor)4 Debug (org.apache.sis.util.Debug)3 GeneralParameterDescriptor (org.opengis.parameter.GeneralParameterDescriptor)2 ParameterDescriptorGroup (org.opengis.parameter.ParameterDescriptorGroup)2 HashMap (java.util.HashMap)1 DefaultParameterDescriptor (org.apache.sis.parameter.DefaultParameterDescriptor)1 Parameters (org.apache.sis.parameter.Parameters)1 Workaround (org.apache.sis.util.Workaround)1 ParameterValueGroup (org.opengis.parameter.ParameterValueGroup)1