问题
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