postgresql - st_intersect count result for each row -
i have 2 polygon tables freeform, , grid in postgres. count grid polygons intersect freeform polygons each freeform polygons. can 1 freeform:
select count (*) (select a.* durs_area b, grid b.job_reference = '1571754' , st_intersects(a.geom, b.the_geom)) zulu;
is there way create query add number of intersecting grid polygons each freeform polygons?
use join (rather unnecessary sub-query), , aggregate.
select ff.job_reference, count (g.*) durs_area ff join grid g on st_intersects(g.geom, ff.the_geom) group ff.job_reference, ff.the_geom;
Comments
Post a Comment