swamirishi commented on a change in pull request #536:
URL: https://github.com/apache/incubator-sedona/pull/536#discussion_r695179581



##########
File path: 
core/src/main/java/org/apache/sedona/core/geometryObjects/schema/PolygonSchema.java
##########
@@ -0,0 +1,37 @@
+package org.apache.sedona.core.geometryObjects.schema;
+
+import com.google.common.collect.Lists;
+import org.apache.sedona.core.io.avro.constants.AvroConstants;
+import org.apache.sedona.core.io.avro.schema.*;
+import org.apache.sedona.core.io.avro.utils.AvroUtils;
+import org.apache.sedona.core.utils.SedonaUtils;
+
+/**
+ * Polygon Schema class representing AvroSchema of Polygon Geometry
+ */
+public class PolygonSchema extends RecordSchema {
+    public static final String POLYGON = "polygon";
+    public static final String EXTERIOR_RING = "ex";
+    public static final String HOLES = "holes";
+    
+    private PolygonSchema() {
+        super(AvroConstants.SEDONA_NAMESPACE,POLYGON,
+              Lists.newArrayList(new Field(EXTERIOR_RING, 
CoordinateArraySchema.getSchema()),
+                                 new Field(HOLES, new UnionSchema(
+                                         new 
ArraySchema(CoordinateArraySchema.getSchema()),
+                                         new 
SimpleSchema(AvroConstants.PrimitiveDataType.NULL)))));

Review comment:
       Saving null would be a better approach to go about I think. Though the 
default implmentation of the geotools returns an empty array. But I feel we 
should also support null types. I had the same confusion when I was 
implementing this. 




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to