Hi Florian,

yes, I agree handling of measurement units is very important for pipeline 
elements!
Currently, we have a module [1] available that handles measurement units based 
on QUDT [2].
This is currently used in Connect (see the measurement unit transformation when 
you create a new adapter) and in a few pipeline elements (e.g., [3]).

Does this fit your needs or do you think we should look deeper into the 
javax.measure library?

Dominik

[1] 
https://github.com/apache/incubator-streampipes/tree/dev/streampipes-measurement-units
[2] https://qudt.org/
[3] 
https://github.com/apache/incubator-streampipes-extensions/tree/dev/streampipes-processors-transformation-flink/src/main/java/org/apache/streampipes/processors/transformation/flink/processor/measurementUnitConverter

On 2020/05/01 13:35:43, Florian Micklich <[email protected]> 
wrote: 
> 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