VenuReddy2103 commented on a change in pull request #3436: 
[CARBONDATA-3548]Geospatial Support: Modified to create and load the table with 
a nonschema dimension sort column. And added InPolygon UDF
URL: https://github.com/apache/carbondata/pull/3436#discussion_r349878603
 
 

 ##########
 File path: 
core/src/main/java/org/apache/carbondata/core/util/GeoHashDefault.java
 ##########
 @@ -0,0 +1,336 @@
+/*
+ * 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.carbondata.core.util;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import 
org.apache.carbondata.common.exceptions.sql.MalformedCarbonCommandException;
+import org.apache.carbondata.core.constants.CarbonCommonConstants;
+
+
+public class GeoHashDefault implements CustomIndex<Long, String, List<Long[]>> 
{
+  // 角度转弧度的转换因子
+  private static final double CONVERT_FACTOR = 180.0;
+  // 地球半径
+  private static final double EARTH_RADIUS = 6371004.0;
+
+  private static final String GEOHASH = "geohash";
+  // 赤道经度1度或者纬度1度对应的地理空间距离
+  private static double transValue = Math.PI / CONVERT_FACTOR * EARTH_RADIUS;
+
+  // private double oriLongitude = 0;  // 坐标原点的经度
+
+  private double oriLatitude = 0;   // 坐标原点的纬度
+
+  private double userDefineMaxLongitude = 0;  // 用户定义地图最大的经度
+
+  private double userDefineMaxLatitude = 0;   // 用户定义地图最大的纬度
+
+  private double userDefineMinLongitude = 0;  // 用户定义地图最小的经度
+
+  private double userDefineMinLatitude = 0;   // 用户定义地图最小的纬度
+
+  private double CalculateMaxLongitude = 0;  // 计算后得出的补齐地图最大的经度
+
+  private double CalculateMaxLatitude = 0;  // 计算后得出的补齐地图最大的纬度
+
+  private int gridSize = 0;  //栅格长度单位是米
+
+  private double mCos;               // 坐标原点纬度的余玄数值
+
+  private double deltaY = 0;        // 每一个gridSize长度对应Y轴的度数
+
+  private double deltaX = 0;        // 每一个gridSize长度应X轴的度数
+
+  private double deltaYByRatio = 0; // 每一个gridSize长度对应Y轴的度数 * 系数
+
+  private double deltaXByRatio = 0; // 每一个gridSize长度应X轴的度数 * 系数
+
+  private int cutLevel = 0;          // 对整个区域切的刀数(一横一竖为1刀),就是四叉树的深度
+
+  //    private int totalRowNumber = 0;    // 整个区域的行数,从左上开始到右下
+
+  //    private int totalCloumnNumber = 0;   // 整个区域的列数,从左上开始到右下
+
+  //    private int udfRowStartNumber = 0;   // 用户定义区域的开始行数
+
+  //    private int udfRowEndNumber = 0;   // 用户定义区域的结束的行数
+
+  //    private int udfCloumnStartNumber = 0;   // 用户定义区域的开始列数
+
+  //    private int udfCloumnEndNumber = 0;   // 用户定义区域的开始结束列数
+
+  //    private double lon0 = 0;              // 
栅格最小数值的经度坐标,最小栅格坐标是扩展区域最左上角的经纬度坐标
+
+  //    private double lat0 = 0;              // 
栅格最小数值的纬度坐标,最小栅格坐标是扩展区域最左上角的经纬度坐标
 
 Review comment:
   Agreed. This code is removed from this PR and it will be raised by 
@MarvinLitt in a different PR as part algorithm.

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


With regards,
Apache Git Services

Reply via email to