Hi,

ST_Subdivide can help you split up your polygons to have less points in
their edges. After that, ST_Intersects should be the fastest way to check a
point-in-polygon relation.

To check if you can service a customer, you don't need a count - WHERE
EXISTS() should be faster and enough.

On аў, 3 ліп 2018, 12:50 Devdatta Tengshe <[email protected]> wrote:

>
> Hi all,
>
> I'm developing an API which will help us figure out if we can server a
> potential customer. For this, I have a PostGIS Table with polygon
> representing the service area of each of our store. There could be up to
> 10,000 polygons in the table. These polygons are geometries in EPSG:4326
> and has a Gist Index.
>
> Currently I'm using the following query to figure out if we can
> potentially service the customer:
>
> Select count(id) from service_areas where
> ST_CoveredBy(ST_SetSRID(ST_MakePoint(78.46239,17.30360),4326), geom);
>
> Is there a faster way to get if any of the polygons cover my input Point?
>
>
> Regards,
> Devdatta
> _______________________________________________
> postgis-users mailing list
> [email protected]
> https://lists.osgeo.org/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/postgis-users

Reply via email to