r-spatial / r-spatial/s2

s2_rebuild transforms `POLYGON FULL` into an empty geometrycollection

Open
#262 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
81
Forks
19
Avg merge
20h 25m
Merged PRs (30d)
3

Description

I'm (finally) implementing support for POLYGON FULL in sf, and ran into s2_rebuild converting an s2 full polygon to a GEOMETRYCOLLECTION EMPTY. I don't think it should! I'll work around it in sf, but it would be nice if it wasn't touched in s2_rebuild: In a debug session in sf::st_make_valid():

Browse[1]> s2
<geodesic s2_geography[2] with CRS=OGC:CRS84>
[1] POLYGON ((0 -90, 0 -90))             POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0...
Browse[1]> 
debug: s2 = s2::s2_rebuild(s2, s2_options)
Browse[1]> 
debug: st_as_sfc(s2, crs = crs)
Browse[1]> s2
<geodesic s2_geography[2] with CRS=OGC:CRS84>
[1] GEOMETRYCOLLECTION EMPTY             POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0...

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with s2::s2_rebuild as called from sf::st_make_valid(), and reproduce the POLYGON FULL example shown in the issue. Trace how the full polygon is converted during rebuilding, then verify that the result remains a full polygon rather than becoming GEOMETRYCOLLECTION EMPTY.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, r
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.