Skip to content

Add Geography support for ST_Intersection #3175

Description

@jiayuasu

What's missing

ST_Intersection has no geography overload. docs/api/sql/geography/Geography-Functions/
currently documents ST_Area, ST_AsEWKT, ST_AsText, ST_Buffer, ST_Centroid, ST_Contains,
ST_DWithin, ST_Distance, ST_Envelope, ST_Equals, ST_GeometryType, ST_Intersects, ST_Length,
ST_NPoints, ST_NumGeometries and ST_Within — the overlay operations are absent.

-- wanted
SELECT ST_Area(ST_Intersection(geogA, geogB));   -- spherical overlay, area in m^2

Why

This is the one function blocking the geography form of SpatialBench Q9 (building conflation /
IoU) on Sedona. The query is a polygon self-join that computes
ST_Area(ST_Intersection(a, b)) / (area_a + area_b - overlap); with geography inputs the
areas come back in m² and the IoU is directly interpretable, whereas the planar form yields
square degrees.

Reference

SedonaDB already implements it — ST_Intersection(geography, geography) -> geography — so
there is a reference for the expected semantics.

Part of #2830.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions