计算PostGIS中多边形内部的总点数

时间:2017-01-27 02:46:42

标签: sql postgresql postgis

我有两张不同的牌桌。一个叫做store(points),另一个叫做county_grid(multipolygon)。我想返回每个网格的总点数,然后将结果作为列放入多边形(存储)表中 这就是我到目前为止所做的:

SELECT county_grid.gid, count(*) AS totale FROM stores, county_grid WHERE 
ST_intersects(county_grid.geom, stores.geom) GROUP BY county_grid.gid. 

但这会检索0行。两个geoms都设置为srid 4326。

0 个答案:

没有答案