Skip to content

Commit

Permalink
Update WaterML/TimeseriesML InterpolationTypes and add encoding of ag…
Browse files Browse the repository at this point in the history
…gregation duration
  • Loading branch information
Carsten Hollmann committed Aug 6, 2021
1 parent 6482765 commit d93e035
Show file tree
Hide file tree
Showing 13 changed files with 218 additions and 120 deletions.
25 changes: 13 additions & 12 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ This project includes:
52°North Svalbard Parent under The Apache Software License, Version 2.0
52°North Svalbard XML Stream under The Apache Software License, Version 2.0
52°North Svalbard XmlBeans under The Apache Software License, Version 2.0
aggs-matrix-stats under Server Side Public License, v 1 or Elastic License 2.0
aggs-matrix-stats under Elastic License 2.0 or Server Side Public License, v 1
ANTLR 4 Runtime under The BSD License
Apache Commons CLI under Apache License, Version 2.0
Apache Commons Codec under Apache License, Version 2.0
Expand All @@ -64,12 +64,12 @@ This project includes:
compiler under Apache License 2.0
dexx under MIT License
Elastic JNA Distribution under Apache License, Version 2.0
elasticsearch-cli under Server Side Public License, v 1 or Elastic License 2.0
elasticsearch-core under Server Side Public License, v 1 or Elastic License 2.0
elasticsearch-geo under Server Side Public License, v 1 or Elastic License 2.0
elasticsearch-plugin-classloader under Server Side Public License, v 1 or Elastic License 2.0
elasticsearch-secure-sm under Server Side Public License, v 1 or Elastic License 2.0
elasticsearch-x-content under Server Side Public License, v 1 or Elastic License 2.0
elasticsearch-cli under Elastic License 2.0 or Server Side Public License, v 1
elasticsearch-core under Elastic License 2.0 or Server Side Public License, v 1
elasticsearch-geo under Elastic License 2.0 or Server Side Public License, v 1
elasticsearch-plugin-classloader under Elastic License 2.0 or Server Side Public License, v 1
elasticsearch-secure-sm under Elastic License 2.0 or Server Side Public License, v 1
elasticsearch-x-content under Elastic License 2.0 or Server Side Public License, v 1
embedded-elasticsearch under The Apache Software License, Version 2.0
error-prone annotations under Apache 2.0
EXIficient under MIT License
Expand Down Expand Up @@ -115,7 +115,7 @@ This project includes:
Joda-Time under Apache License, Version 2.0
JOpt Simple under The MIT License
JSONLD Java :: Core under Revised BSD License
lang-mustache under Server Side Public License, v 1 or Elastic License 2.0
lang-mustache under Elastic License 2.0 or Server Side Public License, v 1
libphonenumber under The Apache Software License, Version 2.0
Lucene Common Analyzers under Apache License, Version 2.0
Lucene Core under Apache License, Version 2.0
Expand All @@ -130,7 +130,8 @@ This project includes:
Lucene Spatial 3D under Apache License, Version 2.0
Lucene Spatial Extras under Apache License, Version 2.0
Lucene Suggest under Apache License, Version 2.0
mapper-extras under Server Side Public License, v 1 or Elastic License 2.0
LZ4 and xxHash under The Apache Software License, Version 2.0
mapper-extras under Elastic License 2.0 or Server Side Public License, v 1
MaxMind DB Reader under Apache License 2.0
MaxMind GeoIP2 API under Apache License, Version 2.0
mchange-commons-java under GNU Lesser General Public License, Version 2.1 or Eclipse Public License, Version 1.0
Expand Down Expand Up @@ -185,14 +186,14 @@ This project includes:
Old JAXB Core under CDDL+GPL License
Old JAXB Runtime under CDDL+GPL License
org.locationtech.jts:jts-core under Eclipse Public License, Version 2.0 or Eclipse Distribution License - v 1.0
parent-join under Server Side Public License, v 1 or Elastic License 2.0
parent-join under Elastic License 2.0 or Server Side Public License, v 1
Portele Schape Change schema (spec. v3.0) under The Apache Software License, Version 2.0
quartz under The Apache Software License, Version 2.0
rank-eval under Server Side Public License, v 1 or Elastic License 2.0
rank-eval under Elastic License 2.0 or Server Side Public License, v 1
rest under The Apache Software License, Version 2.0
rest-high-level under Elastic License 2.0
Saxon-HE under Mozilla Public License Version 2.0
server under Server Side Public License, v 1 or Elastic License 2.0
server under Elastic License 2.0 or Server Side Public License, v 1
SLF4J API Module under MIT License
SnakeYAML under Apache License, Version 2.0
Spring AOP under Apache License, Version 2.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,33 @@
* See <code>/req/xsd-measurement-timeseries-tvp/</code>.
*
* @see <a href="http://www.opengeospatial.org/standards/tsml">OGC TSML</a>
* @see <a href="http://www.opengeospatial.org/standards/waterml">OGC WaterML</a>
* @see <a href="http://www.opengeospatial.org/standards/waterml">OGC
* WaterML</a>
*/
public interface AbstractDefaultTVPMeasurementMetadata {
public abstract class AbstractDefaultTVPMeasurementMetadata<T extends AbstractDefaultTVPMeasurementMetadata<?>> {

boolean isSetInterpolationType();
private String aggregationDuration;

AbstractInterpolationType getInterpolationtype();
public String getAggregationDuration() {
return aggregationDuration;
}

AbstractDefaultTVPMeasurementMetadata setInterpolationtype(AbstractInterpolationType interpolationtype);
public T setAggregationDuration(String aggregationDuration) {
this.aggregationDuration = aggregationDuration;
return (T) this;
}

public boolean isSetAggregationDuration() {
return getAggregationDuration() != null && !getAggregationDuration().isEmpty();
}

public boolean isSetInterpolationType() {
return getInterpolationtype() != null;
}

public abstract AbstractInterpolationType getInterpolationtype();

public abstract T setInterpolationtype(
AbstractInterpolationType interpolationtype);

}
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,7 @@ public interface SeriesConstants {
String EN_CENSORED_REASON = "censoredReason";

String EN_QUALIFIER = "qualifier";

String EN_AGGREGATION_DURATION = "aggregationDuration";

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,11 @@
* @since 1.0.0
* @see <a href="http://www.opengeospatial.org/standards/tsml">OGC TSML</a>
*/
public class DefaultTVPMeasurementMetadata implements AbstractDefaultTVPMeasurementMetadata {
public class DefaultTVPMeasurementMetadata
extends AbstractDefaultTVPMeasurementMetadata<DefaultTVPMeasurementMetadata> {

private InterpolationType interpolationtype;

@Override
public boolean isSetInterpolationType() {
return interpolationtype != null;
}

@Override
public InterpolationType getInterpolationtype() {
return interpolationtype;
Expand All @@ -47,6 +43,4 @@ public DefaultTVPMeasurementMetadata setInterpolationtype(AbstractInterpolationT
this.interpolationtype = (InterpolationType) interpolationtype;
return this;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ public interface TimeseriesMLConstants extends SeriesConstants {

QName QN_CUMULATIVE = new QName(NS_TSML_10, EN_CUMULATIVE, NS_TSML_10_PREFIX);

QName QN_CENSORED_REASON = new QName(NS_TSML_10, EN_CENSORED_REASON, NS_TSML_10);
QName QN_CENSORED_REASON = new QName(NS_TSML_10, EN_CENSORED_REASON, NS_TSML_10_PREFIX);

QName QN_QUALIFIER = new QName(NS_TSML_10, EN_QUALIFIER, NS_TSML_10);
QName QN_QUALIFIER = new QName(NS_TSML_10, EN_QUALIFIER, NS_TSML_10_PREFIX);

QName QN_AGGREGATION_DURATION = new QName(NS_TSML_10, EN_AGGREGATION_DURATION, NS_TSML_10_PREFIX);

QName UOM = new QName(NS_TSML_10, EN_UOM, NS_TSML_10_PREFIX);

Expand All @@ -129,74 +131,80 @@ enum InterpolationType implements AbstractInterpolationType {
* Continuous
* http://www.opengis.net/def/timeseries/InterpolationCode/Continuous
*/
Continuous,
Continuous("Continuous"),
/**
* Discontinuous
* http://www.opengis.net/def/timeseries/InterpolationCode/Discontinuous
*/
Discontinuous,
Discontinuous("Discontinuous"),
/**
* Instantaneous total
* http://www.opengis.net/def/timeseries/InterpolationCode/InstantTotal
*/
InstantTotal,
InstantTotal("Instant Total"),
/**
* Average in preceding interval
* http://www.opengis.net/def/timeseries/InterpolationCode/AveragePrec
*/
AveragePrec,
AveragePrec("Average Preceding"),
/**
* Maximum in preceding interval
* http://www.opengis.net/def/timeseries/InterpolationCode/MaxPrec
*/
MaxPrec,
MaxPrec("Maximum Preceding"),
/**
* Minimum in preceding interval
* http://www.opengis.net/def/timeseries/InterpolationCode/MinPrec
*/
MinPrec,
MinPrec("Minimum Preceding"),
/**
* Preceding total
* http://www.opengis.net/def/timeseries/InterpolationCode/PrecTotal
*/
TotalPrec,
TotalPrec("Preceding Total"),
/**
* Average in succeeding interval
* http://www.opengis.net/def/timeseries/InterpolationCode/AverageSucc
*/
AverageSucc,
AverageSucc("Average Succeeding"),
/**
* Succeeding total
* http://www.opengis.net/def/timeseries/InterpolationCode/TotalSucc
*/
TotalSucc,
TotalSucc("Total Succeeding"),
/**
* Minimum in succeeding interval
* http://www.opengis.net/def/timeseries/InterpolationCode/MinSucc
*/
MinSucc,
MinSucc("Minimum Succeeding"),
/**
* Maximum in succeeding interval
* http://www.opengis.net/def/timeseries/InterpolationCode/MaxSucc
*/
MaxSucc,
MaxSucc("Maximum Succeeding"),
/**
* Constant in preceding interval
* http://www.opengis.net/def/timeseries/InterpolationCode/ConstPrec
*/
ConstPrec,
ConstPrec("Constant Preceding"),
/**
* Constant in succeeding interval
* http://www.opengis.net/def/timeseries/InterpolationCode/ConstSucc
*/
ConstSucc;
ConstSucc("Constant Succeeding");

private String title;

InterpolationType(String title) {
this.title = title;
}

public String getIdentifier() {
return INTERPOLATION_TYPE + "/" + this.toString();
}

public String getTitle() {
return this.toString();
return title;
}

public static InterpolationType from(String v) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,17 @@
*
* See <code>/req/xsd-measurement-timeseries-tvp/interpolation-type</code>.
*
* @author <a href="mailto:e.h.juerrens@52north.org">Eike Hinderk J&uuml;rrens</a>
* @author <a href="mailto:e.h.juerrens@52north.org">Eike Hinderk
* J&uuml;rrens</a>
* @since 1.0.0
* @see <a href="http://www.opengeospatial.org/standards/waterml">OGC WaterML</a>
* @see <a href="http://www.opengeospatial.org/standards/waterml">OGC
* WaterML</a>
*/
public class DefaultTVPMeasurementMetadata implements AbstractDefaultTVPMeasurementMetadata {
public class DefaultTVPMeasurementMetadata
extends AbstractDefaultTVPMeasurementMetadata<DefaultTVPMeasurementMetadata> {

private InterpolationType interpolationtype;

@Override
public boolean isSetInterpolationType() {
return interpolationtype != null;
}

@Override
public AbstractInterpolationType getInterpolationtype() {
return interpolationtype;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ public interface WaterMLConstants extends SeriesConstants {

QName QN_QUALIFIER = new QName(NS_WML_20, EN_QUALIFIER, NS_WML_20_PREFIX);

QName QN_AGGREGATION_DURATION = new QName(NS_WML_20, EN_AGGREGATION_DURATION, NS_WML_20_PREFIX);

QName UOM = new QName(NS_WML_20, EN_UOM, NS_WML_20_PREFIX);

/**
Expand All @@ -142,79 +144,85 @@ enum InterpolationType implements AbstractInterpolationType {
* Continuous/Instantaneous
* http://www.opengis.net/def/waterml/2.0/interpolationType/Continuous
*/
Continuous,
Continuous("Continuous"),
/**
* http://www.opengis.net/def/waterml/2.0/interpolationType/
* Discontinuous
*/
Discontinuous,
Discontinuous("Discontinuous"),
/**
* Instantaneous total
* http://www.opengis.net/def/waterml/2.0/interpolationType/InstantTotal
*/
InstantTotal,
InstantTotal("Instantaneous Total"),
/**
* Average in preceding interval
* http://www.opengis.net/def/waterml/2.0/interpolationType/AveragePrec
*/
AveragePrec,
AveragePrec("Average in Preceding Interval"),
/**
* Maximum in preceding interval
* http://www.opengis.net/def/waterml/2.0/interpolationType/MaxPrec
*/
MaxPrec,
MaxPrec("Maximum in Preceding Interval"),
/**
* Minimum in preceding interval
* http://www.opengis.net/def/waterml/2.0/interpolationType/MinPrec
*/
MinPrec,
MinPrec("Minimum in Preceding Interval"),
/**
* Preceding total
* http://www.opengis.net/def/waterml/2.0/interpolationType/TotalPrec
*/
TotalPrec,
TotalPrec("Preceding Total"),
/**
* Average in succeeding interval
* http://www.opengis.net/def/waterml/2.0/interpolationType/AverageSucc
*/
AverageSucc,
AverageSucc("Average in Succeeding Interval"),
/**
* Succeeding total
* http://www.opengis.net/def/waterml/2.0/interpolationType/TotalSucc
*/
TotalSucc,
TotalSucc("Succeeding Total"),
/**
* Minimum in succeeding interval
* http://www.opengis.net/def/waterml/2.0/interpolationType/MinSucc
*/
MinSucc,
MinSucc("Minimum in Succeeding Interval"),
/**
* Maximum in succeeding interval
* http://www.opengis.net/def/waterml/2.0/interpolationType/MaxSucc
*/
MaxSucc,
MaxSucc("Maximum in Succeeding Interval"),
/**
* Constant in preceding interval
* http://www.opengis.net/def/waterml/2.0/interpolationType/ConstPrec
*/
ConstPrec,
ConstPrec("Constant in Preceding Interval"),
/**
* Constant in succeeding interval
* http://www.opengis.net/def/waterml/2.0/interpolationType/ConstSucc
*/
ConstSucc,
ConstSucc("Constant in Succeeding Interval"),
/**
* Statistical
* http://www.opengis.net/def/waterml/2.0/interpolationType/Statistical
*/
Statistical;
Statistical("Statistical");

private String title;

InterpolationType(String title) {
this.title = title;
}

public String getIdentifier() {
return INTERPOLATION_TYPE + "/" + this.toString();
}

public String getTitle() {
return this.toString();
return title;
}

public static InterpolationType from(String v) {
Expand Down
Loading

0 comments on commit d93e035

Please sign in to comment.