markdown 从另一个图层的边界框创建一个十六进制网格

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 从另一个图层的边界框创建一个十六进制网格相关的知识,希望对你有一定的参考价值。

function hexGridFromLayerBBox(
  bboxJson,
  cellSide = 1,
  hexUnits = "miles",
  radius = 0,
  bufferUnits = "miles"
) {
  // requires turfjs
  let bbox = turf.bbox(
    turf.buffer(bboxJson, radius, {
      units: bufferUnits
    })
  );

  return turf.hexGrid(bbox, cellSide, {
    unit: hexUnits
  });
}
This function takes an input GeoJSON dataset and creates a generates a hex grid from the bounding box of that layer. Because of the way hex grids are created using turfjs, using the bounding box doesn't necessarily result in every area of the input GeoJSON being covered by a hex grid. As such you can also set buffer parameters, `radius` and `bufferUnits`, to expand the area for which the bounding box is created. You can define the size of the hexagons with the `cellSide` and `hexUnits` parameters.

以上是关于markdown 从另一个图层的边界框创建一个十六进制网格的主要内容,如果未能解决你的问题,请参考以下文章

arcgis10 空间参考与数据框不匹配?

5-20 将一个图层作为另一个图层的蒙版

二十九,GeoWebCache 图层边界(/bounds)

OpenLayers v3.4 从 GeoServer 获取图层边界框和 CRS 数据

在谷歌地球引擎上将一层剪裁到另一层的边界

遮罩层的创建