ST_AREA关于坐标系的问题
我想选择距离我最初多边形超过350平方公里的区域的所有多边形,并尝试了ST_AREA。但是我的多边形在WKID中:25832(UTM 32N),我读到ST_AREA总是在WGS 84(EPSG 4326)中计算。...
我尝试过这样的尝试,但不起作用。
DROP TABLE IF EXISTS projekt."Final_Selection";
CREATE TABLE projekt."Final_Selection" AS
SELECT (st_area/1000000), geom
FROM projekt."New_Pot" WHERE st_area>350 ;
像这样:
DROP TABLE IF EXISTS projekt."Final_Selection";
CREATE TABLE projekt."Final_Selection" AS
SELECT (st_area(ST_Transform(geom,25832)))/10000000, geom
FROM projekt."New_Pot" WHERE st_area>350;
有人对我有建议吗?提前提前!
I want to select all polygons with area more than 350 square kilometers from my initial polygons and tried ST_Area. But my polygons are in WKID: 25832 (UTM 32N) and I read that ST_Area always calculates in WGS 84 (EPSG 4326)....
I tried it like this but did not work.
DROP TABLE IF EXISTS projekt."Final_Selection";
CREATE TABLE projekt."Final_Selection" AS
SELECT (st_area/1000000), geom
FROM projekt."New_Pot" WHERE st_area>350 ;
and like this:
DROP TABLE IF EXISTS projekt."Final_Selection";
CREATE TABLE projekt."Final_Selection" AS
SELECT (st_area(ST_Transform(geom,25832)))/10000000, geom
FROM projekt."New_Pot" WHERE st_area>350;
Does anyone have an advice for me? Thx in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想在SQM中选择几何形状,则使用使用
地理
而不是几何
:注意:请记住,在中使用
st_area
,其中条款可能会大大减慢您的查询,因为该区域正在查询时间中计算。如果不是一次性查询,请考虑使用预计区域的区域创建索引,例如,请参见:计算多边形的百分比在PostgreSQL中的缓冲区内
如果您想在给定半径内查询多边形:最简单的方法是将您的几何列转换为
geagraphy ,从那里使用
st_dwithin
,它将与Geagraghy> Geograke <>地理
计算/code>参数:相关帖子:将所有建筑物从指定的坐标范围内占5英里
If you want to select geometries by their size in sqm use
ST_Area
withgeography
instead ofgeometry
:Note: keep in mind that using
ST_Area
in theWHERE
clause might slow down your query significantly, as the area is being calculated in query time. If it isn't a one time query, consider creating an index with the area pre-calculated, e.g.See also: Calculate the percentage of polygon inside the buffer in postgresql
In case you want to query polygons within a given radius: the easiest way would be to convert your geometry column to
geography
and from there useST_DWithin
, which will calculate the distance in metres when used withgeography
parameters:Related post: Getting all Buildings in range of 5 miles from specified coordinates