从 geojson 围绕 geojson 中的每个点创建一个多边形

Create a polygon around each point in geojson from geojson

正在创建与此处找到的地图类似的地图: https://www.plantmaps.com/interactive-california-2012-usda-plant-zone-hardiness-map.php

拥有所有需要的数据。 在每一个周围创建多边形,中间没有距离。没有重叠或相似之处。

在 geojson.io 上全部手绘似乎不可能。

以下是一些需要考虑的事项:

  • 从一个点创建多边形非常简单。例如,您使用 作为正多边形的中心,将 2PI 除以边数,然后逐步通过这些点来创建多边形。但是,什么是半径?这取决于您使用的投影。我碰巧用 OpenLayers and really like this map control. It's default projection it EPSG:3857. So, the coordinates are already in meters - so easy. But if your points are in long/lat then you have to do some math. it may be easier to transform to a different projection temporarily. An opensource library that is really nice for gis calculations if you need one is Turf.

  • 您还提到了非重叠多边形?那么,在这种情况下,如果您使用正多边形,就会有很多间隙。要具有不重叠的多边形,正如您所说,它们之间没有距离 是一个有趣的约束。现在您正在处理不同形状的多边形。还有一种处理算法非常激烈。我知道 MapInfo GIS 具有将多边形调整为不重叠的功能。但是,在使用 GeoJSON 的 JavaScript 环境中,您可能正在谈论服务器端逻辑。

  • 您正在查看的地图看起来正在使用 Leaflet with svg overlays

I want to create polygons around each [point] and make sure there is no distance between them.

您在这里描述的是 tessellation. Depending on your data, you might opt for a regular tessellation (i.e. creating a grid of squares or hexagons, paying a modicum of attention to the units of your coordinate system) or the well-known-among-GIS-people Voronoi tessellation。请注意,在规则的点网格上创建的 Voronoi 曲面细分将生成规则的多边形网格。

有很多用于 Voronoi 曲面细分的工具。对于 javascript 和 GeoJSON,我选择的工具是 turf.js's voronoi module.