Skip to content

Fix geography collection length on PostGIS 3.6.4 - #4168

Merged
roji merged 5 commits into
mainfrom
roji-polygon-length-triage
Nov 26, 2026
Merged

roji merged 5 commits into
mainfrom
roji-polygon-length-triage

Conversation

@roji

@roji roji commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 28c4393148d7b92793fdac4de1e7c38408eb6824

Dimension Assessment Rationale
Change confidence 7.5/10 ↑ 41 targeted spatial length tests passed using a local simulation of the corrected PostGIS collection behavior.
↑ The documentation update passed Markdown lint.
↓ Execution against actual PostGIS 3.6.4 remains unverified.
Diagnosis confidence 9.5/10 ↑ The previous CI logs and upstream PostGIS fix demonstrate that ST_Length excludes collection polygon boundaries on 3.6.4.
Evidence fit 9.5/10 ↑ The merged translation and the review reproduction both omit polygon perimeters from geography collections.

The geography collection translation merged in #4167 omits polygon perimeters on PostGIS 3.6.4, and its tests incorrectly accepted the shortened result.

Sum ST_Length and ST_Perimeter for collections, including polymorphic and measured collections, while retaining single-function translations for concrete types. Restore the expected collection lengths in the regression tests. This targets PostGIS's corrected behavior; older versions have different collection semantics.

Document the type-dependent translations and the PostGIS 3.6.4 requirement for geography collections.

Relates to #4167

roji and others added 4 commits November 26, 2026 15:05
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 26, 2026 15:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Validation used a simulation rather than actual PostGIS 3.6.4, leaving the changed collection semantics unverified and their impact on older supported versions unresolved.

No open issues 🎉

What changed in this PR

Corrects the Npgsql EF Core provider’s geography collection Length translation from #4167 for PostGIS 3.6.4 so polygon perimeters are included.

Changes:

  • Sum ST_Length and ST_Perimeter for collections, including polymorphic and measured collections, while retaining single-function translations for concrete types.
  • Restore expected collection lengths, update SQL baselines, and add measured-collection regression coverage.
File Description
test/​EFCore.PG.FunctionalTests/​Query/​SpatialQueryNpgsqlGeographyTest.cs Corrects expected lengths and SQL baselines; adds measured-collection coverage.
src/​EFCore.PG.NTS/​Query/​ExpressionTranslators/​Internal/​NpgsqlNetTopologySuiteMemberTranslatorPlugin.cs Includes polygon perimeters in geography collection length translations.

Review effort: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 26, 2026 15:46
@roji
roji enabled auto-merge (squash) November 26, 2026 15:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Validation used a simulation rather than an actual PostGIS 3.6.4+ instance, leaving the version-specific collection measurement behavior unverified.

No open issues 🎉

Review effort: Balanced

@roji
roji merged commit c92dc5c into main Nov 26, 2026
17 checks passed
@roji
roji deleted the roji-polygon-length-triage branch November 26, 2026 16:01
roji added a commit that referenced this pull request Nov 26, 2026
Backport #4167 and #4168.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
roji added a commit that referenced this pull request Nov 26, 2026
Backport #4167 and #4168.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants