Posts tagged with 'ST_CoveredBy'

Getting intersections the faster way

Doing an ST_Intersection is much slower than relation checks such as ST_Intersects , ST_CoveredBy, and , ST_Within . In many situations you know the intersection of 2 geometries without actually computing an intersection. In these cases, you can skip the costly ST_Intersection call. Cases like this:

  1. geometry a is covered by geometry b -> intersection is geometry a
  2. geometry b is covered by geometry a -> intersection is geometry b
  3. geometry a does not intersect geometry b -> intersection is empty geometry

This kind of question comes up a lot: As discussed in stackexchange Acquiring ArcGIS speed in PostGIS

Read More…