缓冲 lon,lat 点(以米为单位)(大约)

发布于 2024-11-30 18:26:59 字数 322 浏览 7 评论 0原文

我需要围绕一个点(经度,纬度)创建一个半径约为 X 米的圆。

该点是通过相当于 geomFromEwkt('SRID=1;POINT(lon lat)') 生成的。

我知道 postgis 的 buffer 或 st_buffer 函数,但是不确定如何将距离(米)转换为“该几何图形的空间参考系统的单位”。

doc “计算以该几何体的空间参考系统为单位”

I need to create a circle around a point (lon,lat) which is approximately X meters in radius.

The point is generated via the equivalent of geomFromEwkt('SRID=1;POINT(lon lat)').

I am aware of postgis' buffer or st_buffer function, however am unsure how to translate the distance (meters) to the "units of the Spatial Reference System of this Geometry".

doc
"Calculations are in units of the Spatial Reference System of this Geometry"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

江挽川 2024-12-07 18:27:00

越往北走,椭圆形就越明显。如果您使用的是 PostGIS 1.5,请执行 Geometry(ST_Buffer(GeogFromText('POINT(lon lat)'),100)) 在球形空间中进行缓冲,并获得正确的答案,无论纬度如何。

The elliptical shape will be more and more pronounced the further north you get. If you're on PostGIS 1.5, do geometry(ST_Buffer(GeogFromText('POINT(lon lat)'),100)) to do the buffering in spherical space and get a correct answer regardless of latitude.

凤舞天涯 2024-12-07 18:27:00

一位同事向我介绍了他使用的近似计算:

buffer("location", radius / 110000 * abs(cos(radians(lat))));

其中位置是点几何形状。

a colleague filled me in on a approx calculation he uses:

buffer("location", radius / 110000 * abs(cos(radians(lat))));

where location is the point geometry.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文