apache / apache/sedona-db

c/sedona-s2geography: Reduce precision may have differing behaviour when some components collapse in a geography

Open
#822 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
503
Forks
61
Avg merge
2d 4h
Merged PRs (30d)
90

Description

I removed a test so that I can investigate properly from https://github.com/apache/sedona-db/pull/816 for ST_ReducePrecision for geography (which bigquery calls ST_SnapToGrid). We might also want to investigate naming them the same thing (but also investigate the specifics of the difference between ST_SnapToGrid and ST_ReducePrecision in PostGIS...I think snaptogrid is faster but maybe doesn't do validity checking in the same way).

```python
# Linestring: component collapses because the endpoints snap together
pytest.param(
"LINESTRING (0.01 0.02, 0.03 0.04)",
1.0,
"LINESTRING EMPTY",
id="linestring_collapse",
),
```

BigQuery gives `POINT (0 0)` here, which keep the collapsed component

Contributor guide

Open the contributing guide

Research direction

Start with PR 816 and the removed pytest case for ST_ReducePrecision on geography, especially the linestring whose endpoints collapse. Compare the observed behavior with BigQuery's ST_SnapToGrid and the corresponding PostGIS functions, including validity handling. Done means the differing collapsed-component behavior is understood, agreed, and covered by an appropriate regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, python, rust
Domain
database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.