Search in sources :

Example 6 with VerticalDatum

use of com.revolsys.geometry.cs.datum.VerticalDatum in project com.revolsys.open by revolsys.

the class WktCsParser method processVerticalCoordinateSystem.

private VerticalCoordinateSystem processVerticalCoordinateSystem(final List<Object> values) {
    final String name = (String) values.get(0);
    VerticalDatum verticalDatum = null;
    final Map<ParameterName, ParameterValue> parameters = new LinkedHashMap<>();
    LinearUnit linearUnit = null;
    Authority authority = null;
    final List<Axis> axises = new ArrayList<>();
    for (int i = 1; i < values.size(); i++) {
        final Object value = values.get(i);
        if (value instanceof VerticalDatum) {
            verticalDatum = (VerticalDatum) value;
        } else if (value instanceof LinearUnit) {
            linearUnit = (LinearUnit) value;
        } else if (value instanceof Axis) {
            final Axis axis = (Axis) value;
            axises.add(axis);
        } else if (value instanceof Authority) {
            authority = (Authority) value;
        } else if (value instanceof Map) {
            final Map<String, List<Object>> map = (Map<String, List<Object>>) value;
            final String key = map.keySet().iterator().next();
            if (key.equals("PARAMETER")) {
                final List<Object> paramValues = map.get(key);
                final String paramName = (String) paramValues.get(0);
                final ParameterName parameterName = new SingleParameterName(paramName);
                final BigDecimal paramValue = (BigDecimal) paramValues.get(1);
                parameters.put(parameterName, new ParameterValueBigDecimal(paramValue));
            }
        }
    }
    return new VerticalCoordinateSystem(authority, name, verticalDatum, parameters, linearUnit, axises);
}
Also used : LinearUnit(com.revolsys.geometry.cs.unit.LinearUnit) ArrayList(java.util.ArrayList) VerticalDatum(com.revolsys.geometry.cs.datum.VerticalDatum) BigDecimal(java.math.BigDecimal) LinkedHashMap(java.util.LinkedHashMap) ArrayList(java.util.ArrayList) List(java.util.List) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map)

Aggregations

VerticalDatum (com.revolsys.geometry.cs.datum.VerticalDatum)6 LinearUnit (com.revolsys.geometry.cs.unit.LinearUnit)4 ParameterName (com.revolsys.geometry.cs.ParameterName)3 ParameterValue (com.revolsys.geometry.cs.ParameterValue)3 VerticalCoordinateSystem (com.revolsys.geometry.cs.VerticalCoordinateSystem)3 ChannelReader (com.revolsys.io.channels.ChannelReader)3 WrappedException (com.revolsys.util.WrappedException)3 EOFException (java.io.EOFException)3 Area (com.revolsys.geometry.cs.Area)2 ParameterValueString (com.revolsys.geometry.cs.ParameterValueString)2 Datum (com.revolsys.geometry.cs.datum.Datum)2 EngineeringDatum (com.revolsys.geometry.cs.datum.EngineeringDatum)2 GeodeticDatum (com.revolsys.geometry.cs.datum.GeodeticDatum)2 NoSuchResourceException (com.revolsys.spring.resource.NoSuchResourceException)2 LinkedHashMap (java.util.LinkedHashMap)2 Map (java.util.Map)2 Maps (com.revolsys.collection.map.Maps)1 Authority (com.revolsys.geometry.cs.Authority)1 Axis (com.revolsys.geometry.cs.Axis)1 BaseAuthority (com.revolsys.geometry.cs.BaseAuthority)1