Is there an easy way to create square buffers around point and if they intersect, merge them?

99封情书 提交于 2021-01-29 13:58:04

问题


I am trying to create square buffers around given points, I am able to create circular buffers but not square ones.

from shapely.ops import transform
from shapely.geometry import Point
    local_azimuthal_projection = "+proj=aeqd +R=6371000 +units=m +lat_0={} +lon_0={}".format(lat, lon)
                    wgs84_to_aeqd = partial(
                        pyproj.transform,
                        pyproj.Proj('+proj=longlat +datum=WGS84 +no_defs'),
                        pyproj.Proj(local_azimuthal_projection),
                    )
                    aeqd_to_wgs84 = partial(
                        pyproj.transform,
                        pyproj.Proj(local_azimuthal_projection),
                        pyproj.Proj('+proj=longlat +datum=WGS84 +no_defs'),
                    )

                    point_transformed = transform(wgs84_to_aeqd, Point(float(lon), float(lat)))
                    buffer = point_transformed.buffer(0.5*1000)
                    buffered_geom = transform(aeqd_to_wgs84, buffer).exterior.coords[:]

Also, if I have some buffers that overlap, how can I merge them?


回答1:


In jaguardb, it should be simply Select union(buffer(p1), buffer(p2)) from t where intersect(buffer(p1), buffer(p2));



来源:https://stackoverflow.com/questions/55083290/is-there-an-easy-way-to-create-square-buffers-around-point-and-if-they-intersect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!