Hi everyone,

I have a general question on how to handle measurement units. I found also two 
existing Geo PE'S where unit measurement could be used  [1] [2].


So far I used javax.measure [3] and tec units [4] to handle the output result 
e.g units in length for distance results. It looks something like this in the 
end:

private final Unit<Length> M = SI.METRE;
private final Unit<Length> KM = MetricPrefix.KILO(SI.METRE);
private final Unit<Length> MILE = SI.METRE.multiply(1609344).divide(1000);
private final Unit<Length> FOOT= SI.METRE.multiply(3048).divide(10000);

and will be stored together with the value in

Quantity<Length> length;


The benefits of this would also be an easy calculation between the different 
measurement units. This unit information could also be added into the stream 
event so this information is also traceable.


Is there already a way to handle units like in javax.measure and if not what 
could I use?

I would prefer the javax.measure under BSD license.


Kind regards

Florian


[1] 
https://github.com/apache/incubator-streampipes-extensions/blob/dev/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/processor/speed/SpeedCalculator.java

[2] 
https://github.com/apache/incubator-streampipes-extensions/blob/dev/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/processor/util/DistanceUtil.java

[3] https://mvnrepository.com/artifact/javax.measure/unit-api

[4] https://mvnrepository.com/artifact/tec.units

Disy Informationssysteme GmbH
Florian Micklich
Lösungsentwickler
+49 721 16006 477,  [email protected]

Firmensitz: Ludwig-Erhard-Allee 6, 76131 Karlsruhe
Registergericht: Amtsgericht Mannheim, HRB 107964
Geschäftsführer: Claus Hofmann

Bitte beachten Sie folgende Informationen für Kunden, Lieferanten und Bewerber
- Datenschutz: www.disy.net/datenschutz
- Informationspflichten:  www.disy.net/informationspflichten

Reply via email to