Search in sources :

Example 1 with NumericalType

use of ch.interlis.ili2c.metamodel.NumericalType in project ili2db by claeis.

the class FromXtfRecordConverter method getP.

public double getP(LineType type) {
    if (typeCache.containsKey(type)) {
        return ((Double) typeCache.get(type)).doubleValue();
    }
    double p;
    CoordType coordType = (CoordType) type.getControlPointDomain().getType();
    NumericalType[] dimv = coordType.getDimensions();
    int accuracy = ((NumericType) dimv[0]).getMaximum().getAccuracy();
    if (accuracy == 0) {
        p = 0.5;
    } else {
        p = Math.pow(10.0, -accuracy);
    // EhiLogger.debug("accuracy "+accuracy+", p "+p);
    }
    typeCache.put(type, new Double(p));
    return p;
}
Also used : NumericalType(ch.interlis.ili2c.metamodel.NumericalType) CoordType(ch.interlis.ili2c.metamodel.CoordType)

Aggregations

CoordType (ch.interlis.ili2c.metamodel.CoordType)1 NumericalType (ch.interlis.ili2c.metamodel.NumericalType)1