jiayuasu commented on a change in pull request #510:
URL: https://github.com/apache/incubator-sedona/pull/510#discussion_r592109578



##########
File path: 
core/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/parseUtils/shp/ShapeSerde.java
##########
@@ -1,264 +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.sedona.core.formatMapper.shapefileParser.parseUtils.shp;
-
-import com.esotericsoftware.kryo.io.Input;
-import org.locationtech.jts.geom.Geometry;
-import org.locationtech.jts.geom.GeometryFactory;
-import org.locationtech.jts.geom.LineString;
-import org.locationtech.jts.geom.MultiLineString;
-import org.locationtech.jts.geom.MultiPoint;
-import org.locationtech.jts.geom.MultiPolygon;
-import org.locationtech.jts.geom.Point;
-import org.locationtech.jts.geom.Polygon;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-
-/**
- * Provides methods to efficiently serialize and deserialize geometry types
- * using shapefile format developed by ESRI. Does not serialize user data
- * attached to the geometry.
- * <p>
- * Supports Point, LineString, Polygon, MultiPoint, MultiLineString and
- * MultiPolygon types.
- * <p>
- * Compatible with the family of {@link ShapeReader} classes.
- * <p>
- * First byte contains {@link ShapeType#id}. The rest is type specific.
- * Point: 8 bytes for X coordinate, followed by 8 bytes for Y coordinate.
- * LineString is serialized as MultiLineString.
- * MultiLineString: 16 bytes for envelope, 4 bytes for the number of line 
strings,
- * 4 bytes for total number of vertexes, 16 * num-vertexes for
- * XY coordinates of all the vertexes.
- * Polygons is serialized as MultiPolygon.
- * MultiPolygon: 16 bytes for envelope, 4 bytes for the total number of 
exterior and
- * interior rings of all polygons, 4 bytes for total number of vertexes,
- * 16 * num-vertexes for XY coordinates of all the vertexes. The vertexes
- * are written one polygon at a time, exterior ring first, followed by
- * interior rings.
- */
-public class ShapeSerde
-{
-    private static final int POINT_LENGTH = 1 + 2 * 
ShapeFileConst.DOUBLE_LENGTH;
-
-    public static byte[] serialize(Geometry geometry)
-    {
-        if (geometry instanceof Point) {
-            return serialize((Point) geometry);
-        }
-
-        if (geometry instanceof MultiPoint) {
-            return serialize((MultiPoint) geometry);
-        }
-
-        if (geometry instanceof LineString) {
-            return serialize((LineString) geometry);
-        }
-
-        if (geometry instanceof MultiLineString) {
-            return serialize((MultiLineString) geometry);
-        }
-
-        if (geometry instanceof Polygon) {
-            return serialize((Polygon) geometry);
-        }
-
-        if (geometry instanceof MultiPolygon) {

Review comment:
       @netanel246 I wouldn't recommend GeoTools Serde due to their license 
issue. According to ASF policy, components that require Category X license has 
to be an optional feature. Serializer is the fundamental component in Sedona. 
If we use their library, I am afraid that we won't be able to graduate from the 
incubator.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to