【发布时间】:2014-12-22 22:08:29
【问题描述】:
以下语句始终返回来自st_area(st_buffer(polygon,100)) 的结果。
select st_Area(polygon) as area,
case when area>100000 then st_area(st_buffer(polygon,500))
else st_area(st_buffer(polygon,100))
end from polygons limit 10;
area | st_area
------------------+------------------
383287.287473659 | 723738.615102036
47642.5395246768 | 192575.823383778
45546.753026985 | 174122.420564731
435204.455923533 | 725419.735987631
839954.564052786 | 1268251.88626391
315213.27742828 | 630424.785088617
966620.061916605 | 1447647.57269461
38446.6010009923 | 151584.647252579
82576.1182937309 | 238095.988431594
321682.125463567 | 695462.262796463
(10 rows)
st_area应该是st_buffer(polygon,500)的结果,当area>100000如下所示:
area | st_area
------------------+------------------
383287.287473659 | 2702203.34758147
47642.5395246768 | 192575.823383778
45546.753026985 | 174122.420564731
435204.455923533 | 2507469.89929028
839954.564052786 | 3568866.96452707
315213.27742828 | 2453576.33477712
966620.061916605 | 3953365.12876066
38446.6010009923 | 151584.647252579
82576.1182937309 | 238095.988431594
321682.125463567 | 2628693.69179652
(10 rows)
谁能解释一下?
【问题讨论】:
-
"输出应该有所不同" - 你期待什么?
-
这有点令人困惑:area 是一个别名,也是一个列名。使用唯一的名称并检查实际具有的值区域。
-
是的,也许
when st_Area(polygon) > 100000会得到更好的结果
标签: sql postgresql postgis