You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by mi...@apache.org on 2022/11/19 23:11:30 UTC

[streampipes] branch STREAMPIPES-642 created (now 773495cca)

This is an automated email from the ASF dual-hosted git repository.

micklich pushed a change to branch STREAMPIPES-642
in repository https://gitbox.apache.org/repos/asf/streampipes.git


      at 773495cca misc changes on resources

This branch includes the following new commits:

     new 5c973c1eb rewrite to 1-class processor model
     new 498cde45e delete old setEPSG classes
     new 8b41f5e9b move resources
     new 773495cca misc changes on resources

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[streampipes] 01/04: rewrite to 1-class processor model

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

micklich pushed a commit to branch STREAMPIPES-642
in repository https://gitbox.apache.org/repos/asf/streampipes.git

commit 5c973c1ebf3797789f0f7753ed904f67c96f7e3a
Author: micklich <mi...@apache.org>
AuthorDate: Sat Nov 19 23:35:11 2022 +0100

    rewrite to 1-class processor model
---
 .../streampipes/processors/geo/jvm/GeoJvmInit.java |  4 +-
 .../geo/jvm/jts/processor/epsg/EpsgProcessor.java  | 80 ++++++++++++++++++++++
 2 files changed, 82 insertions(+), 2 deletions(-)

diff --git a/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/GeoJvmInit.java b/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/GeoJvmInit.java
index 949887050..52897a751 100644
--- a/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/GeoJvmInit.java
+++ b/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/GeoJvmInit.java
@@ -29,8 +29,8 @@ import org.apache.streampipes.messaging.jms.SpJmsProtocolFactory;
 import org.apache.streampipes.messaging.kafka.SpKafkaProtocolFactory;
 import org.apache.streampipes.messaging.mqtt.SpMqttProtocolFactory;
 import org.apache.streampipes.processors.geo.jvm.config.ConfigKeys;
+import org.apache.streampipes.processors.geo.jvm.jts.processor.epsg.EpsgProcessor;
 import org.apache.streampipes.processors.geo.jvm.jts.processor.latLngToGeo.LatLngToGeoController;
-import org.apache.streampipes.processors.geo.jvm.jts.processor.setEPSG.SetEpsgController;
 import org.apache.streampipes.processors.geo.jvm.jts.processor.trajectory.CreateTrajectoryFromPointsController;
 import org.apache.streampipes.processors.geo.jvm.processor.distancecalculator.DistanceCalculatorController;
 import org.apache.streampipes.processors.geo.jvm.processor.geocoder.GoogleMapsGeocodingController;
@@ -52,7 +52,7 @@ public class GeoJvmInit extends StandaloneModelSubmitter {
                     new GoogleMapsGeocodingController(),
                     new StaticGoogleMapsGeocodingController(),
                     new ReverseGeocodingController(),
-                    new SetEpsgController(),
+                    new EpsgProcessor(),
                     new LatLngToGeoController(),
                     new CreateTrajectoryFromPointsController(),
                     new SpeedCalculatorController(),
diff --git a/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/epsg/EpsgProcessor.java b/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/epsg/EpsgProcessor.java
new file mode 100644
index 000000000..44057d9d2
--- /dev/null
+++ b/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/epsg/EpsgProcessor.java
@@ -0,0 +1,80 @@
+/*
+ *
+ *  * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  * contributor license agreements.  See the NOTICE file distributed with
+ *  * this work for additional information regarding copyright ownership.
+ *  * The ASF licenses this file to You under the Apache License, Version 2.0
+ *  * (the "License"); you may not use this file except in compliance with
+ *  * the License.  You may obtain a copy of the License at
+ *  *
+ *  *    http://www.apache.org/licenses/LICENSE-2.0
+ *  *
+ *  * Unless required by applicable law or agreed to in writing, software
+ *  * distributed under the License is distributed on an "AS IS" BASIS,
+ *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  * See the License for the specific language governing permissions and
+ *  * limitations under the License.
+ *  *
+ *
+ */
+
+package org.apache.streampipes.processors.geo.jvm.jts.processor.epsg;
+
+import org.apache.streampipes.commons.exceptions.SpRuntimeException;
+import org.apache.streampipes.model.DataProcessorType;
+import org.apache.streampipes.model.graph.DataProcessorDescription;
+import org.apache.streampipes.model.runtime.Event;
+import org.apache.streampipes.sdk.builder.PrimitivePropertyBuilder;
+import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
+import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
+import org.apache.streampipes.sdk.helpers.Labels;
+import org.apache.streampipes.sdk.helpers.Locales;
+import org.apache.streampipes.sdk.helpers.OutputStrategies;
+import org.apache.streampipes.sdk.utils.Assets;
+import org.apache.streampipes.sdk.utils.Datatypes;
+import org.apache.streampipes.wrapper.context.EventProcessorRuntimeContext;
+import org.apache.streampipes.wrapper.routing.SpOutputCollector;
+import org.apache.streampipes.wrapper.standalone.ProcessorParams;
+import org.apache.streampipes.wrapper.standalone.StreamPipesDataProcessor;
+
+public class EpsgProcessor extends StreamPipesDataProcessor {
+    private static final String EPSG_KEY  = "epsg-key";
+    public static final String EPSG_RUNTIME = "epsg";
+
+    private int epsgCode;
+
+    @Override
+    public DataProcessorDescription declareModel() {
+        return ProcessingElementBuilder.create("org.apache.streampipes.processors.geo.jvm.jts.processor.epsg")
+                .category(DataProcessorType.GEO)
+                .withAssets(Assets.DOCUMENTATION, Assets.ICON)
+                .withLocales(Locales.EN)
+                .requiredStream(StreamRequirementsBuilder
+                        .create()
+                        .build())
+                .outputStrategy(OutputStrategies.append(PrimitivePropertyBuilder
+                                .create(Datatypes.Integer, EPSG_RUNTIME)
+                                .domainProperty("http://data.ign.fr/def/ignf#CartesianCS")
+                                .build())
+                )
+                .requiredIntegerParameter(Labels.withId(EPSG_KEY), 4326)
+                .build();
+    }
+
+    @Override
+    public void onInvocation(ProcessorParams parameters, SpOutputCollector spOutputCollector,
+                             EventProcessorRuntimeContext runtimeContext) throws SpRuntimeException {
+        this.epsgCode = parameters.extractor().singleValueParameter(EPSG_KEY, Integer.class);
+    }
+
+    @Override
+    public void onEvent(Event event, SpOutputCollector collector) throws SpRuntimeException {
+        event.addField(EpsgProcessor.EPSG_RUNTIME, this.epsgCode);
+        collector.collect(event);
+    }
+
+    @Override
+    public void onDetach() throws SpRuntimeException {
+
+    }
+}


[streampipes] 02/04: delete old setEPSG classes

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

micklich pushed a commit to branch STREAMPIPES-642
in repository https://gitbox.apache.org/repos/asf/streampipes.git

commit 498cde45e93298596ef8be0081988a82ae187f3a
Author: micklich <mi...@apache.org>
AuthorDate: Sat Nov 19 23:35:50 2022 +0100

    delete old setEPSG classes
---
 .../geo/jvm/jts/processor/setEPSG/SetEPSG.java     | 53 ----------------
 .../jts/processor/setEPSG/SetEpsgController.java   | 72 ----------------------
 .../jts/processor/setEPSG/SetEpsgParameter.java    | 37 -----------
 3 files changed, 162 deletions(-)

diff --git a/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/setEPSG/SetEPSG.java b/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/setEPSG/SetEPSG.java
deleted file mode 100755
index 4d5639b60..000000000
--- a/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/setEPSG/SetEPSG.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.streampipes.processors.geo.jvm.jts.processor.setEPSG;
-
-import org.apache.streampipes.logging.api.Logger;
-import org.apache.streampipes.wrapper.context.EventProcessorRuntimeContext;
-import org.apache.streampipes.wrapper.routing.SpOutputCollector;
-import org.apache.streampipes.wrapper.runtime.EventProcessor;
-import org.apache.streampipes.model.runtime.Event;
-
-
-public class SetEPSG implements EventProcessor<SetEpsgParameter> {
-
-  public static Logger LOG;
-  public SetEpsgParameter params;
-  public Integer epsg;
-
-
-  @Override
-  public void onInvocation(SetEpsgParameter params, SpOutputCollector spOutputCollector, EventProcessorRuntimeContext runtimeContext) {
-
-    LOG = params.getGraph().getLogger(SetEPSG.class);
-    this.epsg = params.getEpsg();
-  }
-
-  @Override
-  public void onEvent(Event in, SpOutputCollector out) {
-    in.addField(SetEpsgController.EPSG_RUNTIME, epsg);
-
-    out.collect(in);
-  }
-
-  @Override
-  public void onDetach() {
-
-  }
-}
diff --git a/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/setEPSG/SetEpsgController.java b/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/setEPSG/SetEpsgController.java
deleted file mode 100755
index eb85e0b74..000000000
--- a/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/setEPSG/SetEpsgController.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.streampipes.processors.geo.jvm.jts.processor.setEPSG;
-
-import org.apache.streampipes.model.DataProcessorType;
-import org.apache.streampipes.model.graph.DataProcessorDescription;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.model.schema.PropertyScope;
-import org.apache.streampipes.sdk.builder.PrimitivePropertyBuilder;
-import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
-import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
-import org.apache.streampipes.sdk.extractor.ProcessingElementParameterExtractor;
-import org.apache.streampipes.sdk.helpers.*;
-import org.apache.streampipes.sdk.utils.Datatypes;
-import org.apache.streampipes.vocabulary.SO;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-import org.apache.streampipes.sdk.utils.Assets;
-
-public class SetEpsgController extends StandaloneEventProcessingDeclarer<SetEpsgParameter> {
-
-  public final static String EPA_NAME = "EPSG Enricher";
-
-  public final static String EPSG_KEY = "epsg-key";
-  public final static String EPSG_RUNTIME = "epsg";
-
-  @Override
-  public DataProcessorDescription declareModel() {
-    return ProcessingElementBuilder
-        .create("org.apache.streampipes.processors.geo.jvm.jts.processor.setEPSG")
-        .category(DataProcessorType.GEO)
-        .withAssets(Assets.DOCUMENTATION, Assets.ICON)
-        .withLocales(Locales.EN)
-        .requiredStream(StreamRequirementsBuilder
-            .create()
-            .build())
-        .requiredIntegerParameter(Labels.withId(EPSG_KEY), 4326)
-
-        .outputStrategy(
-            OutputStrategies.append(PrimitivePropertyBuilder
-                .create(Datatypes.Integer, EPSG_RUNTIME)
-                .domainProperty("http://data.ign.fr/def/ignf#CartesianCS")
-                .build())
-        )
-        .build();
-  }
-
-  @Override
-  public ConfiguredEventProcessor<SetEpsgParameter> onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor extractor) {
-
-    Integer epsg_value = extractor.singleValueParameter(EPSG_KEY, Integer.class);
-    SetEpsgParameter params = new SetEpsgParameter(graph, epsg_value);
-
-    return new ConfiguredEventProcessor<>(params, SetEPSG::new);
-  }
-}
diff --git a/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/setEPSG/SetEpsgParameter.java b/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/setEPSG/SetEpsgParameter.java
deleted file mode 100755
index a08141e66..000000000
--- a/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/setEPSG/SetEpsgParameter.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.streampipes.processors.geo.jvm.jts.processor.setEPSG;
-
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.wrapper.params.binding.EventProcessorBindingParams;
-
-public class SetEpsgParameter extends EventProcessorBindingParams {
-
-
-  private Integer epsg;
-
-  public SetEpsgParameter(DataProcessorInvocation graph, Integer epsg) {
-    super(graph);
-    this.epsg = epsg;
-  }
-
-  public Integer getEpsg() {
-    return epsg;
-  }
-}


[streampipes] 04/04: misc changes on resources

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

micklich pushed a commit to branch STREAMPIPES-642
in repository https://gitbox.apache.org/repos/asf/streampipes.git

commit 773495ccaa1ee47cef7fba3978cd248ca25f8847
Author: micklich <mi...@apache.org>
AuthorDate: Sat Nov 19 23:41:00 2022 +0100

    misc changes on resources
---
 .../documentation.md                                    | 17 +++++++++++------
 .../strings.en                                          |  4 ++--
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/streampipes-extensions/streampipes-processors-geo-jvm/src/main/resources/org.apache.streampipes.processors.geo.jvm.jts.processor.epsg/documentation.md b/streampipes-extensions/streampipes-processors-geo-jvm/src/main/resources/org.apache.streampipes.processors.geo.jvm.jts.processor.epsg/documentation.md
index 1f19b7b10..a4e420892 100644
--- a/streampipes-extensions/streampipes-processors-geo-jvm/src/main/resources/org.apache.streampipes.processors.geo.jvm.jts.processor.epsg/documentation.md
+++ b/streampipes-extensions/streampipes-processors-geo-jvm/src/main/resources/org.apache.streampipes.processors.geo.jvm.jts.processor.epsg/documentation.md
@@ -27,13 +27,14 @@
 
 ## Description
 
-This processor adds ab integer value to the stream. This integer value represents
-an [EPSG Code](https://en.wikipedia.org/wiki/EPSG_Geodetic_Parameter_Dataset) as an Spatial Reference System Identifier [(SRID)](https://en.wikipedia.org/wiki/Spatial_reference_system#Identifier).
+This processor adds an integer value to the event. This integer value represents
+an  <a href="https://en.wikipedia.org/wiki/EPSG_Geodetic_Parameter_Dataset" target="_blank">EPSG Code</a> as an Spatial Reference System Identifier
+an  <a href="https://en.wikipedia.org/wiki/Spatial_reference_system#Identifier" target="_blank">(SRID)</a>.
 
 
 ***
 
-## Required input
+## Required inputs
 
 None
 
@@ -41,13 +42,17 @@ None
 
 ## Configuration
 
-Integer values, representing a spatial reference system [(SRS)](https://en.wikipedia.org/wiki/Spatial_reference_system#Identifier).  Other possible values can be looked up under https://spatialreference.org/ref/epsg/.
+Integer values, representing a spatial reference system
+<a href="https://en.wikipedia.org/wiki/Spatial_reference_system#Identifier" target="_blank">SRID</a>.
+Other possible values can be looked up via
+<a href="https://spatialreference.org/ref/epsg/" target="_blank">spatialreference.org</a>.
 
 ### Parameter
 
-4- to 5-digit key integer number. Default value is 4326 representing the World Geodetic System [(WGS84)](https://en.wikipedia.org/wiki/World_Geodetic_System#WGS84).
+4- to 5-digit key integer number. Default value is 4326 representing the World Geodetic System
+<a href="https://en.wikipedia.org/wiki/World_Geodetic_System#WGS84" target="_blank">(WGS84)</a>.
 
 ***
 ## Output
 
-Adds a number to the event.
+Adds the epsg number to the event.
diff --git a/streampipes-extensions/streampipes-processors-geo-jvm/src/main/resources/org.apache.streampipes.processors.geo.jvm.jts.processor.epsg/strings.en b/streampipes-extensions/streampipes-processors-geo-jvm/src/main/resources/org.apache.streampipes.processors.geo.jvm.jts.processor.epsg/strings.en
index 599f7a7dd..94369c096 100644
--- a/streampipes-extensions/streampipes-processors-geo-jvm/src/main/resources/org.apache.streampipes.processors.geo.jvm.jts.processor.epsg/strings.en
+++ b/streampipes-extensions/streampipes-processors-geo-jvm/src/main/resources/org.apache.streampipes.processors.geo.jvm.jts.processor.epsg/strings.en
@@ -1,5 +1,5 @@
-org.apache.streampipes.processors.geo.jvm.jts.processor.setEPSG.title=EPSG Code
-org.apache.streampipes.processors.geo.jvm.jts.processor.setEPSG.description=Adds a corresponding EPSG Code to the Geo-Event
+org.apache.streampipes.processors.geo.jvm.jts.processor.epsg.title=EPSG Code
+org.apache.streampipes.processors.geo.jvm.jts.processor.epsg.description=Adds a corresponding EPSG Code to the Geo-Event
 
 epsg-key.title=EPSG Code field
 epsg-key.description=EPSG Code


[streampipes] 03/04: move resources

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

micklich pushed a commit to branch STREAMPIPES-642
in repository https://gitbox.apache.org/repos/asf/streampipes.git

commit 8b41f5e9bf16a397036a71a495f8ae7afca18459
Author: micklich <mi...@apache.org>
AuthorDate: Sat Nov 19 23:39:05 2022 +0100

    move resources
---
 .../documentation.md                                        |   0
 .../icon.png                                                | Bin
 .../strings.en                                              |   0
 3 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/streampipes-extensions/streampipes-processors-geo-jvm/src/main/resources/org.apache.streampipes.processors.geo.jvm.jts.processor.setEPSG/documentation.md b/streampipes-extensions/streampipes-processors-geo-jvm/src/main/resources/org.apache.streampipes.processors.geo.jvm.jts.processor.epsg/documentation.md
similarity index 100%
rename from streampipes-extensions/streampipes-processors-geo-jvm/src/main/resources/org.apache.streampipes.processors.geo.jvm.jts.processor.setEPSG/documentation.md
rename to streampipes-extensions/streampipes-processors-geo-jvm/src/main/resources/org.apache.streampipes.processors.geo.jvm.jts.processor.epsg/documentation.md
diff --git a/streampipes-extensions/streampipes-processors-geo-jvm/src/main/resources/org.apache.streampipes.processors.geo.jvm.jts.processor.setEPSG/icon.png b/streampipes-extensions/streampipes-processors-geo-jvm/src/main/resources/org.apache.streampipes.processors.geo.jvm.jts.processor.epsg/icon.png
similarity index 100%
rename from streampipes-extensions/streampipes-processors-geo-jvm/src/main/resources/org.apache.streampipes.processors.geo.jvm.jts.processor.setEPSG/icon.png
rename to streampipes-extensions/streampipes-processors-geo-jvm/src/main/resources/org.apache.streampipes.processors.geo.jvm.jts.processor.epsg/icon.png
diff --git a/streampipes-extensions/streampipes-processors-geo-jvm/src/main/resources/org.apache.streampipes.processors.geo.jvm.jts.processor.setEPSG/strings.en b/streampipes-extensions/streampipes-processors-geo-jvm/src/main/resources/org.apache.streampipes.processors.geo.jvm.jts.processor.epsg/strings.en
similarity index 100%
rename from streampipes-extensions/streampipes-processors-geo-jvm/src/main/resources/org.apache.streampipes.processors.geo.jvm.jts.processor.setEPSG/strings.en
rename to streampipes-extensions/streampipes-processors-geo-jvm/src/main/resources/org.apache.streampipes.processors.geo.jvm.jts.processor.epsg/strings.en