Skip to content

Remove invalid geo and report - #29

Merged
tombrooks248 merged 3 commits into
mainfrom
remove_invalid_geo_and_report
Jul 6, 2026
Merged

tombrooks248 merged 3 commits into
mainfrom
remove_invalid_geo_and_report

Conversation

@salabi

@salabi salabi commented Jun 30, 2026 •

Copy link
Copy Markdown

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Update the Postgres loader so geometries are checked after the existing PostGIS repair flow. Entity rows are still loaded first, then the loader attempts to repair invalid/non-simple geometries using ST_MakeValid. But now any geometries still invalid after those repair attempts are nulled in the final entity table.

Why

We mostly handle invalid geometries well, we raise issues for fixable and unfixable geometries given to us, and we fix the fixable ones, the only thing we don't do is remove the unfixable ones. This PR Nulls those invalid ones so that the frotend does not need to run expensive checks when surfacing geometries to users.

Related Tickets & Documents

QA Instructions, Screenshots, Recordings

I have pushed this to DEV and run the manual postgres loader and can see the logs, it runs without any errors, although it didn't find any invalid geometries to Null in DEV, but I think the mechanism is tested in the tests and all we are doing is setting a value to Null so pretty limited risk.

I also ran a check on PROD to see if any issues were raised for geometries which could not be fixed and didn't find any. So I think its likely this was in fact never a problem and this whole thing is being very belt and braces.

Added/updated tests?

We encourage you to keep the code coverage percentage at 80% and above. Please refer to the Digital Land Testing Guidance for more information.

  • Yes
  • No, and this is why: please replace this line with details on why tests
    have not been included
  • I need help with writing tests

[optional] Are there any post deployment tasks we need to perform?

[optional] Are there any dependencies on other PRs or Work?

@salabi
salabi marked this pull request as ready for review June 30, 2026 14:28
@salabi
salabi requested a review from tombrooks248 June 30, 2026 14:29

@gibahjoe gibahjoe left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@tombrooks248
tombrooks248 merged commit 1a1f142 into main Jul 6, 2026
8 checks passed
@tombrooks248
tombrooks248 deleted the remove_invalid_geo_and_report branch July 6, 2026 08:22

This branch was previously deployed

2 inactive deployments
staging — 0de448ae Deployed Jul 2, 2026 by tombrooks248 via deploy #4
development — 0de448ae Deployed Jul 2, 2026 by tombrooks248 via deploy #39
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.

3 participants