项目作者: marcomeng

项目描述 :
Get geohash list from a circle. 获得圆形里的geohash
高级语言: Java
项目地址: git://github.com/marcomeng/circle2geohash.git
创建时间: 2018-11-23T02:36:01Z
项目社区:https://github.com/marcomeng/circle2geohash

开源协议:

下载


circle2geohash

Get geohash list from a circle. 获得圆形里的geohash

Example:

  1. List<String> geohashList = Circle2GeoHash.getGeohashList(31.179859,121.604716, 100, 7);
  2. System.out.println(StringUtils.join(geohashList, ","));
  3. assertEquals(geohashList.size(), 2);
  4. assertEquals(geohashList.get(0), "wtw3rhj");

Steps:

  1. Caculate how many cells in the MBR.
  2. For each cell, check if it’s in the circle.
  3. Caculate the centre lat lon if the cell in the circle.
  4. Convert the latlon to geohash and deduplicate.