如何查询在h3索引的给定半径范围内的索引?

时间:2019-07-15 06:07:35

标签: javascript uber-api h3 s2

我正在创建一个使用h3-js的送餐应用程序。我以geojson文件格式创建了餐厅列表。现在,我想查询半径5公里以内的餐厅。我该如何实现?

const shops = {
    "type": "FeatureCollection",
    "features": [
      {
        "type": "Feature",
        "properties": {},
        "geometry": {
          "type": "Point",
          "coordinates": [
            80.20839214324951,
            13.085434989577822
          ]
        }
      },
      {
        "type": "Feature",
        "properties": {},
        "geometry": {
          "type": "Point",
          "coordinates": [
            80.20182609558105,
            13.09095265785958
          ]
        }
      },
      {
        "type": "Feature",
        "properties": {},
        "geometry": {
          "type": "Point",
          "coordinates": [
            80.19940137863158,
            13.083470335444712
          ]
        }
      },
      {
        "type": "Feature",
        "properties": {},
        "geometry": {
          "type": "Point",
          "coordinates": [
            80.2132201194763,
            13.09168415763673
          ]
        }
      },
      {
        "type": "Feature",
        "properties": {},
        "geometry": {
          "type": "Point",
          "coordinates": [
            80.21068811416626,
            13.079875395860183
          ]
        }
      }
    ]
  };

0 个答案:

没有答案