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/23 22:53:23 UTC

[streampipes] 15/16: trajectory delete old classes

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 3df9394b071e07b0143120c8e3fb9b359046851c
Author: micklich <mi...@apache.org>
AuthorDate: Wed Nov 23 23:41:34 2022 +0100

    trajectory delete old classes
---
 .../trajectory/CreateTrajectoryFromPoints.java     |  80 ---------------
 .../CreateTrajectoryFromPointsController.java      | 113 ---------------------
 .../CreateTrajectoryFromPointsParameter.java       |  60 -----------
 3 files changed, 253 deletions(-)

diff --git a/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/trajectory/CreateTrajectoryFromPoints.java b/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/trajectory/CreateTrajectoryFromPoints.java
deleted file mode 100755
index 12fe8aa09..000000000
--- a/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/trajectory/CreateTrajectoryFromPoints.java
+++ /dev/null
@@ -1,80 +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.trajectory;
-
-import org.apache.streampipes.logging.api.Logger;
-import org.apache.streampipes.model.runtime.Event;
-import org.apache.streampipes.processors.geo.jvm.jts.helper.SpGeometryBuilder;
-import org.apache.streampipes.processors.geo.jvm.jts.helper.SpTrajectoryBuilder;
-import org.apache.streampipes.wrapper.context.EventProcessorRuntimeContext;
-import org.apache.streampipes.wrapper.routing.SpOutputCollector;
-import org.apache.streampipes.wrapper.runtime.EventProcessor;
-import org.locationtech.jts.geom.LineString;
-import org.locationtech.jts.geom.Point;
-
-
-public class CreateTrajectoryFromPoints implements EventProcessor<CreateTrajectoryFromPointsParameter> {
-
-  private static Logger LOG;
-
-  private SpTrajectoryBuilder trajectory;
-
-  private String geom_wkt;
-  private String epsg_code;
-  private String m_value;
-
-  @Override
-  public void onInvocation(CreateTrajectoryFromPointsParameter params, SpOutputCollector spOutputCollector, EventProcessorRuntimeContext runtimeContext) {
-
-    LOG = params.getGraph().getLogger(CreateTrajectoryFromPointsParameter.class);
-    this.geom_wkt = params.getWkt();
-    this.epsg_code = params.getEpsg();
-    this.m_value = params.getM();
-
-    trajectory = new SpTrajectoryBuilder(params.getSubpoints(), params.getDescription());
-  }
-
-  @Override
-  public void onEvent(Event in, SpOutputCollector out) {
-
-    // extract values
-    String wkt = in.getFieldBySelector(geom_wkt).getAsPrimitive().getAsString();
-    Integer epsg = in.getFieldBySelector(epsg_code).getAsPrimitive().getAsInt();
-    Integer m = in.getFieldBySelector(m_value).getAsPrimitive().getAsInt();
-
-    //create JTS geometry
-    Point eventGeom = (Point) SpGeometryBuilder.createSPGeom(wkt, epsg);
-
-    //adds point and m value to trajectory object
-    trajectory.addPointToTrajectory(eventGeom, m);
-    // returns JTS LineString
-    LineString geom = trajectory.returnAsLineString(eventGeom.getFactory());
-
-    // adds to stream
-    in.addField(CreateTrajectoryFromPointsController.DESCRIPTION_RUNTIME, trajectory.getDescription());
-    in.addField(CreateTrajectoryFromPointsController.WKT_RUNTIME, geom.toString());
-    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/trajectory/CreateTrajectoryFromPointsController.java b/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/trajectory/CreateTrajectoryFromPointsController.java
deleted file mode 100755
index 61e559e36..000000000
--- a/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/trajectory/CreateTrajectoryFromPointsController.java
+++ /dev/null
@@ -1,113 +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.trajectory;
-
-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.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.Assets;
-import org.apache.streampipes.vocabulary.SO;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-public class CreateTrajectoryFromPointsController extends StandaloneEventProcessingDeclarer<CreateTrajectoryFromPointsParameter> {
-
-
-  public final static String POINT_KEY = "point-key";
-  public final static String EPSG_KEY = "epsg-key";
-  public final static String M_KEY = "m-key";
-  public final static String DESCRIPTION_KEY = "description-key";
-  public final static String SUBPOINTS_KEY = "subpoints-key";
-
-  public final static String WKT_KEY = "trajectory-key";
-  public final static String WKT_RUNTIME = "trajectoryWKT";
-
-  public final static String DESCRIPTION_RUNTIME = "trajectoryDescription";
-
-
-  @Override
-  public DataProcessorDescription declareModel() {
-    return ProcessingElementBuilder
-        .create("org.apache.streampipes.processors.geo.jvm.jts.processor.trajectory")
-        .category(DataProcessorType.GEO)
-        .withAssets(Assets.DOCUMENTATION, Assets.ICON)
-        .withLocales(Locales.EN)
-        .requiredStream(
-            StreamRequirementsBuilder
-                .create()
-                .requiredPropertyWithUnaryMapping(
-                    EpRequirements.domainPropertyReq("http://www.opengis.net/ont/geosparql#Geometry"),
-                    Labels.withId(POINT_KEY), PropertyScope.MEASUREMENT_PROPERTY
-                )
-                .requiredPropertyWithUnaryMapping(
-                    EpRequirements.domainPropertyReq("http://data.ign.fr/def/ignf#CartesianCS"),
-                    Labels.withId(EPSG_KEY), PropertyScope.MEASUREMENT_PROPERTY
-                )
-                .requiredPropertyWithUnaryMapping(
-                    EpRequirements.numberReq(),
-                    Labels.withId(M_KEY), PropertyScope.MEASUREMENT_PROPERTY
-                )
-                .build()
-        )
-        .requiredTextParameter(
-            Labels.withId(DESCRIPTION_KEY)
-        )
-        .requiredIntegerParameter(
-            Labels.withId(SUBPOINTS_KEY),
-            2, 30, 1
-        )
-
-        .outputStrategy(OutputStrategies.append(
-            EpProperties.stringEp(
-                Labels.withId(DESCRIPTION_KEY),
-                DESCRIPTION_RUNTIME,
-                SO.Text
-            ),
-            EpProperties.stringEp(
-                Labels.withId(WKT_KEY),
-                WKT_RUNTIME,
-                "http://www.opengis.net/ont/geosparql#Geometry")
-            )
-        )
-        .build();
-  }
-
-
-  @Override
-  public ConfiguredEventProcessor<CreateTrajectoryFromPointsParameter> onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor extractor) {
-
-
-    String wkt = extractor.mappingPropertyValue(POINT_KEY);
-    String epsg = extractor.mappingPropertyValue(EPSG_KEY);
-    String m = extractor.mappingPropertyValue(M_KEY);
-
-    String description = extractor.singleValueParameter(DESCRIPTION_KEY, String.class);
-    Integer subpoints = extractor.singleValueParameter(SUBPOINTS_KEY, Integer.class);
-
-
-    CreateTrajectoryFromPointsParameter params = new CreateTrajectoryFromPointsParameter(graph, wkt, epsg, description, subpoints, m);
-
-    return new ConfiguredEventProcessor<>(params, CreateTrajectoryFromPoints::new);
-  }
-}
diff --git a/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/trajectory/CreateTrajectoryFromPointsParameter.java b/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/trajectory/CreateTrajectoryFromPointsParameter.java
deleted file mode 100755
index 872fb00e9..000000000
--- a/streampipes-extensions/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/processor/trajectory/CreateTrajectoryFromPointsParameter.java
+++ /dev/null
@@ -1,60 +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.trajectory;
-
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.wrapper.params.binding.EventProcessorBindingParams;
-
-public class CreateTrajectoryFromPointsParameter extends EventProcessorBindingParams {
-
-  private String epsg;
-  private String wkt;
-  private String description;
-  private Integer subpoints;
-  private String m;
-
-  public CreateTrajectoryFromPointsParameter(DataProcessorInvocation graph, String wkt, String epsg, String description, Integer subpoints, String m) {
-    super(graph);
-    this.wkt = wkt;
-    this.epsg = epsg;
-    this.description = description;
-    this.subpoints = subpoints;
-    this.m = m;
-  }
-
-  public String getEpsg() {
-    return epsg;
-  }
-
-  public String getWkt() {
-    return wkt;
-  }
-
-  public String getDescription() {
-    return description;
-  }
-
-  public Integer getSubpoints() {
-    return subpoints;
-  }
-
-  public String getM() {
-    return m;
-  }
-}