pgs2
Postgres extension for S2 spherical geometry
pgs2 · Postgres extension for S2 spherical geometry
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 101686 | pgs2 | pgs2 | 0.0.1 | GIS | Apache-2.0 | C |
Usage
Sources:
- Official upstream README
- Official extension control file (pgs2.control)
- Official extension SQL (pgs2–0.0.1.sql)
pgs2 — Postgres extension for S2 spherical geometry. Use it for the corresponding spatial data or geospatial workflow. Use the pinned upstream revision linked above as the API boundary and test it on the target PostgreSQL build.
Core Workflow
Install the extension in the intended database, run the smallest upstream example above when available, and verify the installed version and returned values before integrating it into application SQL.
Important Objects
btS2Cellsortsupport(internal)is an extension function and returnsvoid.S2Cap(center S2Point, radium float8 = 0.0)is an extension function and returnsS2Cap.S2Cap_eq(A S2Cap, B S2Cap)is an extension function.S2Cap_in(cstring)is an extension function and returnsS2Cap.S2Cap_out(S2Cap)is an extension function and returnscstring.S2Cell_as_S2LatLng(c S2Cell)is an extension function and returnsS2LatLng.S2Cell_as_S2Point(c S2Cell)is an extension function and returnsS2Point.S2Cell_cmp(A S2Cell, B S2Cell)is an extension function and returnsint.S2Cell_distance(A S2Cell, B S2Cell)is an extension function and returnsfloat8.S2Cell_eq(A S2Cell, B S2Cell)is an extension function.S2Cell_ge(A S2Cell, B S2Cell)is an extension function.S2Cell_gt(A S2Cell, B S2Cell)is an extension function.S2Cell_in(cstring)is an extension function and returnsS2Cell.S2Cell_le(A S2Cell, B S2Cell)is an extension function.
Requirements and Caveats
- The reviewed control file declares default version
0.0.1. - The control file marks the extension as relocatable.
- Confirm privileges, supported PostgreSQL versions, upgrade behavior, and failure cases against the pinned source before production use.