ajantha-bhat commented on a change in pull request #3481: [CARBONDATA-3548]Geospatial Support: add hash id create,query condition analyze and generate hash id list
URL: https://github.com/apache/carbondata/pull/3481#discussion_r356544508 ########## File path: geo/src/main/java/org/apache/carbondata/geo/GeoHashImpl.java ########## @@ -38,10 +41,66 @@ * columns. */ public class GeoHashImpl extends CustomIndex<List<Long[]>> { + private static final Logger LOGGER = + LogServiceFactory.getLogService(GeoHashImpl.class.getName()); + + // conversion factor of angle to radian + private static final double CONVERT_FACTOR = 180.0; + // Earth radius + private static final double EARTH_RADIUS = 6371004.0; + // Longitude of coordinate origin + // private double oriLongitude = 0; + // Latitude of coordinate origin + private double oriLatitude; + // User defined maximum longitude of map + private double userDefineMaxLongitude; + // User defined maximum latitude of map + private double userDefineMaxLatitude; + // User defined map minimum longitude + private double userDefineMinLongitude; + // User defined map minimum latitude + private double userDefineMinLatitude; + // The maximum longitude of the completed map after calculation + private double CalculateMaxLongitude; + // The maximum latitude of the completed map after calculation + private double CalculateMaxLatitude; + // Grid length is in meters + private int gridSize; + // cos value of latitude of origin of coordinate + private double mCos; + // The degree of Y axis corresponding to each grid size length + private double deltaY; + // Each grid size length should be the degree of X axis + private double deltaX; + // Degree * coefficient of Y axis corresponding to each grid size length + private double deltaYByRatio; + // Each grid size length should be X-axis Degree * coefficient + private double deltaXByRatio; + // The number of knives cut for the whole area (one horizontally and one vertically) + // is the depth of quad tree + private int cutLevel; + // used to convert the latitude and longitude of double type to int type for calculation + private int conversionRatio; + // * Constant of coefficient + private double lon0ByRation; + // * Constant of coefficient + private double lat0ByRation; + + /** * Initialize the geohash index handler instance. - * @param handlerName - * @param properties + * the properties is like that: + * TBLPROPERTIES ('INDEX_HANDLER'='mygeohash', + * 'INDEX_HANDLER.mygeohash.type'='geohash', + * 'INDEX_HANDLER.mygeohash.sourcecolumns'='longitude, latitude', + * 'INDEX_HANDLER.mygeohash.gridSize'='50' + * 'INDEX_HANDLER.mygeohash.minLongitude'='0' + * 'INDEX_HANDLER.mygeohash.maxLongitude'='0' + * 'INDEX_HANDLER.mygeohash.minLatitude'='100' + * 'INDEX_HANDLER.mygeohash.maxLatitude'='100' + * 'INDEX_HANDLER.mygeohash.orilatitude''8') Review comment: this GeoHashImpl.java cannot be the default implementation as it depends on grid size, min max latitude longitude and original latitude longitude. will it work if these parameters set to 0 also ? then it can be default implementation. If it cannot work we can have it as a custom implementation and introduce simple default implementation that can work on any geo spatial polygon query. (with float longitude, latitude) ---------------------------------------------------------------- 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: [hidden email] With regards, Apache Git Services |
Free forum by Nabble | Edit this page |