feat(geotypes): rename domains and add geography variants#49
Merged
pyramation merged 1 commit intomainfrom Mar 22, 2026
Merged
Conversation
- Rename geolocation -> geo_point (geometry) - Rename geopolygon -> geo_polygon (geometry) - Add geography_point (geography(Point, 4326)) - Add geography_polygon (geography(Polygon, 4326)) - Update pgpm.plan, bundled SQL, tests, and README
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Renames the legacy PostGIS geometry domains and adds new geography (spherical/geodetic) domain variants:
geolocationgeo_pointgeometry(Point, 4326)geopolygongeo_polygongeometry(Polygon, 4326)geography_pointgeography(Point, 4326)geography_polygongeography(Polygon, 4326)Geography domains use geodetic calculations on the sphere —
ST_Distancereturns meters,ST_DWithinuses meters, and results account for Earth's curvature. Geometry domains remain planar/flat.Each domain has a full set of deploy/verify/revert migration files. Smart comment tags updated accordingly (e.g.
pgpmInternalTypeGeoLocation→pgpmInternalTypeGeoPoint).Companion PR: constructive-io/constructive-db#669 (same changes for the in-repo copy of geotypes).
Review & Testing Checklist for Human
geolocation/geopolygondomain names or the oldpgpmInternalTypeGeoLocationsmart comment tag. This is a hard rename with no migration path.pgpmInternalTypeGeoPoint,pgpmInternalTypeGeoPolygon,pgpmInternalTypeGeographyPoint,pgpmInternalTypeGeographyPolygonare the correct tag names expected by the graphile-postgis plugin and any PostGraphile schema generation.pgpm-geo-types--0.15.3.sql): Version number was not bumped — confirm this is intentional given the package.json is at0.19.0. If the bundled SQL filename should reflect a new version, it needs updating.DROP TYPE(notDROP DOMAIN) — this matches the existing convention and works in PostgreSQL, but worth a glance.Recommended test plan: Run
cd packages/geotypes && pnpm testlocally against a PostGIS-enabled Postgres instance to verify all 6 tests pass (3 geometry, 3 geography including the SF↔NYC distance check).Notes
constructiverepo (graphile-postgis plugin) does not need changes — it detects geometry/geography types dynamically via PostGIS codec introspection, not by domain name.Link to Devin session: https://app.devin.ai/sessions/2497d12c456844cc93429d027727addd
Requested by: @pyramation