This is an automated email from the ASF dual-hosted git repository.
jiayu pushed a commit to branch fix-copyright
in repository https://gitbox.apache.org/repos/asf/incubator-sedona.git
The following commit(s) were added to refs/heads/fix-copyright by this push:
new 9f95878 Fix the references of the GeoJSONwriter
9f95878 is described below
commit 9f958781fe033789164c16d3d502a05f27df10b7
Author: Jia Yu <[email protected]>
AuthorDate: Mon May 17 18:19:21 2021 -0700
Fix the references of the GeoJSONwriter
---
DISCLAIMER-WIP | 2 --
.../main/java/org/apache/sedona/core/spatialRDD/SpatialRDD.java | 4 ++--
.../org/apache/spark/sql/sedona_sql/expressions/Functions.scala | 8 ++++----
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/DISCLAIMER-WIP b/DISCLAIMER-WIP
index 0df680a..1c8b028 100644
--- a/DISCLAIMER-WIP
+++ b/DISCLAIMER-WIP
@@ -2,6 +2,4 @@ Apache Sedona is an effort undergoing incubation at The Apache
Software Foundati
Some of the incubating project’s releases may not be fully compliant with ASF
policy. For example, releases may have incomplete or un-reviewed licensing
conditions. What follows is a list of known issues the project is currently
aware of (note that this list, by definition, is likely to be incomplete):
-1. The content of GeoJSONWriterNew is directly copied from jts2geojson library
(MIT License). This is to fix the incompatibility between jts2geojson 1.4.3 and
JTS 1.17+. GeoJSONWriterNew will be removed in the future if the developer of
jts2geojson fixes this issue.
-
If you are planning to incorporate this work into your product/project, please
be aware that you will need to conduct a thorough licensing review to determine
the overall implications of including this work. For the current status of this
project through the Apache Incubator visit:
https://incubator.apache.org/projects/sedona.html
\ No newline at end of file
diff --git
a/core/src/main/java/org/apache/sedona/core/spatialRDD/SpatialRDD.java
b/core/src/main/java/org/apache/sedona/core/spatialRDD/SpatialRDD.java
index ca7fdee..3eb6ae7 100644
--- a/core/src/main/java/org/apache/sedona/core/spatialRDD/SpatialRDD.java
+++ b/core/src/main/java/org/apache/sedona/core/spatialRDD/SpatialRDD.java
@@ -23,7 +23,6 @@ import org.apache.commons.lang.NullArgumentException;
import org.apache.log4j.Logger;
import org.apache.sedona.core.enums.GridType;
import org.apache.sedona.core.enums.IndexType;
-import org.apache.sedona.core.geometryObjects.GeoJSONWriterNew;
import org.apache.sedona.core.spatialPartitioning.FlatGridPartitioner;
import org.apache.sedona.core.spatialPartitioning.KDBTree;
import org.apache.sedona.core.spatialPartitioning.KDBTreePartitioner;
@@ -57,6 +56,7 @@ import org.opengis.referencing.FactoryException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.operation.MathTransform;
import org.wololo.geojson.Feature;
+import org.wololo.jts2geojson.GeoJSONWriter;
import scala.Tuple2;
import java.io.Serializable;
@@ -579,7 +579,7 @@ public class SpatialRDD<T extends Geometry>
throws Exception
{
ArrayList<String> result = new ArrayList();
- GeoJSONWriterNew writer = new GeoJSONWriterNew();
+ GeoJSONWriter writer = new GeoJSONWriter();
while (iterator.hasNext()) {
Geometry spatialObject = iterator.next();
Feature jsonFeature;
diff --git
a/sql/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/Functions.scala
b/sql/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/Functions.scala
index ec2afea..7ba88a2 100644
---
a/sql/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/Functions.scala
+++
b/sql/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/Functions.scala
@@ -18,7 +18,7 @@
*/
package org.apache.spark.sql.sedona_sql.expressions
-import org.apache.sedona.core.geometryObjects.{Circle, GeoJSONWriterNew}
+import org.apache.sedona.core.geometryObjects.Circle
import org.apache.sedona.core.utils.GeomUtils
import org.apache.sedona.sql.utils.GeometrySerializer
import org.apache.spark.internal.Logging
@@ -34,15 +34,15 @@ import org.geotools.geometry.jts.JTS
import org.geotools.referencing.CRS
import org.locationtech.jts.algorithm.MinimumBoundingCircle
import org.locationtech.jts.geom.{PrecisionModel, _}
-import org.locationtech.jts.io.WKBWriter
+import org.locationtech.jts.linearref.LengthIndexedLine
import org.locationtech.jts.operation.IsSimpleOp
import org.locationtech.jts.operation.buffer.BufferParameters
import org.locationtech.jts.operation.linemerge.LineMerger
import org.locationtech.jts.operation.valid.IsValidOp
import org.locationtech.jts.precision.GeometryPrecisionReducer
import org.locationtech.jts.simplify.TopologyPreservingSimplifier
-import org.locationtech.jts.linearref.LengthIndexedLine
import org.opengis.referencing.operation.MathTransform
+import org.wololo.jts2geojson.GeoJSONWriter
import java.util
import scala.collection.mutable.ArrayBuffer
@@ -479,7 +479,7 @@ case class ST_AsGeoJSON(inputExpressions: Seq[Expression])
inputExpressions.validateLength(1)
val geometry = inputExpressions.head.toGeometry(input)
- val writer = new GeoJSONWriterNew()
+ val writer = new GeoJSONWriter()
UTF8String.fromString(writer.write(geometry).toString)
}