[postgis-users] Counting intersecting polygons

Eduardo Ramos duda.ramos at gmail.com
Wed May 29 00:38:54 PDT 2019


Hi,

You can use the blue polygon centroid to intersect the green layer.

Best regards, 
Eduardo 


> On 28 May 2019, at 18:47, Marcin Mionskowski <mionskowskimarcin at gmail.com> wrote:
> 
> I checked on the larger tables - you're right. Your approach
> significantly speeds up the query. Nice hint - thanks!
> 
> W dniu wto, 28.05.2019 o godzinie 08∶36 +0200, użytkownik Arnaud L.
> napisał:
>>> Le 27/05/2019 à 14:47, Marcin Mionskowski a écrit :
>>> SELECT COUNT(DISTINCT t1.column_with_unique_ids)
>>> FROM Table_1 t1
>>>    ,Table_2 t2
>>> WHERE ST_Intersects(t1.wkb_geometry,t2.wkb_geometry)
>> 
>> 
>> Unless you're running PG12 and PostGIS 3 (see Paul Ramsey's latest 
>> post), the "WHERE EXISTS" construct will be able to trigger a
>> parallel 
>> query plan whereas the "JOIN" construct will not.
>> 
>> Cheers
>> --
>> Arnaud
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/postgis-users
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users


More information about the postgis-users mailing list