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 2020/05/12 11:04:09 UTC

[incubator-streampipes-extensions] 03/09: changed javadoc

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

micklich pushed a commit to branch feature/trajectory
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes-extensions.git

commit 1ec0b51ffc9eab23a14734534a2bb310bbf5f3a6
Author: micklich <fl...@disy.net>
AuthorDate: Wed Apr 29 15:54:14 2020 +0200

    changed javadoc
---
 .../geo/jvm/jts/helper/SpGeometryBuilder.java      | 42 +++++++++++-----------
 1 file changed, 20 insertions(+), 22 deletions(-)

diff --git a/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/helper/SpGeometryBuilder.java b/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/helper/SpGeometryBuilder.java
index e6e183a..03e38a5 100644
--- a/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/helper/SpGeometryBuilder.java
+++ b/streampipes-processors-geo-jvm/src/main/java/org/apache/streampipes/processors/geo/jvm/jts/helper/SpGeometryBuilder.java
@@ -27,17 +27,16 @@ public class SpGeometryBuilder {
   final static double LONGITUDE_MIN = -180.00;
   final static double LONGITUDE_MAX = 180.00;
   final static double LATITUDE_MIN = -90;
-  final static double LATITIDE_MAX = 90;
+  final static double LATITUDE_MAX = 90;
 
 
   /**
-   * Creates a JTS point geometry from Longitude and Latitude values
+   * Creates a {@link org.locationtech.jts.geom.Point} from <code>Latitude</code> and <code> Longitude</code> values
    *
-   * @param lng Longitude value in the range -180 <Longitude > 180
-   * @param lat Latitude value in the range -90 <LATITUDE > 90
-   * @param epsg EPSG Code for projection info
-   * @return a JTS Point Geometry Object with lat lng values. An empty point geometry is created if Latitude or Longitude values are out of range
-   * or has null values.
+   * @param lng  Longitude value in the range -180 &lt; Longitude &gt; 180
+   * @param lat  Latitude value in the range -90 &lt; LATITUDE &gt; 90
+   * @param epsg EPSG Code representing coordinate reference system
+   * @return a {@link org.locationtech.jts.geom.Point}. An empty point geometry is created if Latitude or Longitude values are out of range or has null values.
    */
   public static Point createSPGeom(Double lng, Double lat, Integer epsg) {
     Point point;
@@ -47,7 +46,7 @@ public class SpGeometryBuilder {
     //check if value is not null due missing stream value
     if ((lng != null) && (lat != null)) {
       //check if lat lng is in typical range
-      if (isInWGSCoordinateRange(lng, LONGITUDE_MIN, LONGITUDE_MAX) || isInWGSCoordinateRange(lat, LATITUDE_MIN, LATITIDE_MAX)) {
+      if (isInWGSCoordinateRange(lng, LONGITUDE_MIN, LONGITUDE_MAX) || isInWGSCoordinateRange(lat, LATITUDE_MIN, LATITUDE_MAX)) {
 
         Coordinate coordinate = new Coordinate(lng, lat);
         point = geomFactory.createPoint(coordinate);
@@ -69,10 +68,9 @@ public class SpGeometryBuilder {
    * geom is returned. method calls getPrecision method and creates a jts geometry factory and a WKT-parser object.
    * from the wktString the
    *
-   * @param wktString wkt text
-   * @param epsg EPSG Code for projection info
-   * @return Geometry geom: a JTS Geometry Object depending on the WKT input. An empty point geometry is created if Latitude or Longitude values are out of range
-   *    * or has null values
+   * @param wktString Well-known text representation of the input geometry
+   * @param epsg      EPSG Code representing SRID
+   * @return {@link org.locationtech.jts.geom.Geometry}. An empty point geometry is created if {@link org.locationtech.jts.io.ParseException} due invalid WKT-String
    */
   public static Geometry createSPGeom(String wktString, Integer epsg) {
 
@@ -93,26 +91,26 @@ public class SpGeometryBuilder {
   }
 
 
-
   /**
+   * Is in wgs coordinate range boolean.
    *
-   * @param checkedvalue Any Value
+   * @param valueToCheck Any Value
    * @param min          Min value to check
    * @param max          max value to check
-   * @return boolean value true or false
+   * @return true if value is in min max range
    */
-  private static boolean isInWGSCoordinateRange(double checkedvalue, double min, double max) {
-    return checkedvalue > min && checkedvalue < max;
+  private static boolean isInWGSCoordinateRange(double valueToCheck, double min, double max){
+    return valueToCheck > min && valueToCheck < max;
   }
 
 
   /**
-   * Creates a JTS PrecisionModel with a specific precision.
-   * WGS84/WGS84 will be created with 7 decimal positions.
-   * Any other epsg code will create a precision with Ffloating type. See JTS PrecisionModel for more information
+   * Creates a {@link org.locationtech.jts.geom.PrecisionModel} with a specific precision.
+   * WGS84/WGS84 will be created a {@link org.locationtech.jts.geom.PrecisionModel#FIXED} with 7 decimal positions (scale 1000000).
+   * Any other epsg code will create a precision with {@link org.locationtech.jts.geom.PrecisionModel#FLOATING}.
    *
-   * @param epsg EPSG alue
-   * @return a JTS PrecisionModel
+   * @param epsg EPSG Code representing SRID
+   * @return {@link org.locationtech.jts.geom.PrecisionModel}
    */
   private static PrecisionModel getPrecisionModel(Integer epsg) {
     PrecisionModel precisionModel;