[
https://issues.apache.org/jira/browse/TINKERPOP-2558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18144095#comment-18144095
]
ASF GitHub Bot commented on TINKERPOP-2558:
-------------------------------------------
GumpacG commented on code in PR #3754:
URL: https://github.com/apache/tinkerpop/pull/3754#discussion_r4558183584
##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/geo/WktReader.java:
##########
@@ -0,0 +1,621 @@
+/*
+ * 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.tinkerpop.gremlin.structure.geo;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Package-private WKT/EWKT parser.
+ */
+final class WktReader {
+
+ /**
+ * Longest run of input echoed back in an exception message.
+ */
+ private static final int MAX_ECHOED_INPUT = 64;
+
+ /**
+ * Longest run of SRID digits accepted after an EWKT "SRID=" prefix.
+ */
+ private static final int MAX_SRID_DIGITS = 10;
+
+ private final String input;
+ private int pos;
+ private int depth; // collection nesting depth
+ private int srid;
+ private Boolean hasZ; // null = not yet determined
+
+ private WktReader(final String input) {
+ this.input = input;
+ this.pos = 0;
+ this.depth = 0;
+ }
+
+ /**
+ * Parses WKT or EWKT text.
+ *
+ * @param wktOrEwkt the input text
+ * @param model explicit model, or null to derive from EWKT prefix
+ * @param srid explicit SRID, or null to derive from EWKT prefix
+ * @return the parsed geometry
+ */
+ static Geometry parse(final String wktOrEwkt, final Model model, final
Integer srid) {
Review Comment:
I've now added 3D EWKT without the Z tag. Thanks!
> GEO Spatial APIs
> ----------------
>
> Key: TINKERPOP-2558
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2558
> Project: TinkerPop
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.5.0
> Reporter: Jitesh
> Priority: Major
>
> Provide support for Geo based APIs (predicates, objects, etc)
>
>
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)