Key takeaway
A correct point can fall on a shared edge. The selection predicate can return no zone or two zones without any coordinate changing.
A valid coordinate can still have no assigned zone
A location import passes its coordinate and reference-system checks, yet a point on a zone border receives no region. Another implementation assigns it to both adjacent regions. Investigate the spatial predicate before changing coordinates or filling a missing region by guesswork. Boundary membership and exclusive business assignment are separate decisions.
PostGIS ST_Contains requires an intersection between the interiors of the two geometries. A point lying wholly on a polygon boundary therefore fails that predicate. ST_Covers includes the boundary. Those definitions can explain different selections even when both implementations receive identical, valid geometry.
Test an interior, the shared edge and the exterior
This hypothetical coordinate-plane fixture has two valid closed squares. Left spans x=0 to 10 and y=0 to 10; Right spans x=10 to 20 with the same y range. They share the vertical edge x=10. The points [5,5], [10,5] and [25,5] are invented and avoid vertices. They are not surveyed parcels, customer locations or measurements of positional accuracy.
The interior point belongs to Left under either predicate. The shared-edge point is contained by neither square but covered by both. The exterior point satisfies neither predicate for either square. These results follow from the stated rectangular interiors and boundaries; no spatial database was executed. Counts over these selections must preserve whether they count point-zone pairs or distinct points.
| Synthetic point | ST_Contains selections | ST_Covers selections | Assignment question |
|---|---|---|---|
| [5,5] | Left | Left | One geometric match |
| [10,5] | None | Left and Right | Resolve the shared-edge policy |
| [25,5] | None | None | Outside both stated zones |
Choose inclusion and then resolve multiplicity
ST_Covers answers whether any part of the second geometry is outside the first; it supplies an inclusive geometric test. It does not select one owner from two adjacent zones. If a business process requires one zone per point, specify a separate assignment rule, such as a documented authoritative region identifier or an explicit boundary allocation convention. Do not let whichever polygon happens to be returned first decide ownership.
Record the geometry type and implementation as well. The worked example concerns valid planar polygons and points, not every geography, line or collection overload. PostGIS warns against using these functions on invalid geometries because the results can be unexpected. A successful query does not settle whether an upstream polygon is valid or represents the intended legal or operating boundary.
Retain the unassigned and multiply matched cases
Return the original point, polygon versions, CRS/axis convention, predicate, engine version and every matching region identifier. Count zero, one and multiple matches separately. A summary with exactly one row per input can conceal a duplicate if an arbitrary deduplication step chose one match without retaining the alternatives. Equally, treating every unmatched boundary point as a lost coordinate can lead to an unnecessary coordinate repair.
Include the actual application’s precision and tolerance policy in the receiving test. This fixture uses exact coordinates on an exact shared edge; real observations can have uncertainty. Moving a point a small distance to force a match changes the observation and needs an explicit, justified transformation rather than a quiet fix. Keep any derivative separate from the preserved input.
For the illustration, the defensible finding is that [10,5] needs an assignment decision after its geometric selection is understood. The diligence request should ask for the predicate and treatment of shared boundaries before regional coverage counts are accepted. None of this establishes parcel authority, surveying fitness, anonymization or permission to disclose real locations.