EDSC-4654: Split bounding boxes that cross the anti-meridian to draw correctly on the map#2048
Conversation
Bundle Size ComparisonFull build detailsThe full bundle is larger than main by 0.11 kB. ❗ The index.js is larger than main by 0.11 kB. ❗ Run
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2048 +/- ##
=======================================
Coverage 95.80% 95.80%
=======================================
Files 753 753
Lines 17427 17431 +4
Branches 4867 4916 +49
=======================================
+ Hits 16696 16700 +4
Misses 680 680
Partials 51 51 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@coderabbitai help |
ChatThere are 3 ways to chat with CodeRabbit:
CodeRabbit commands
Other keywords and placeholders
CodeRabbit configuration file (
|
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughSplits bounding-box polygons at antimeridian crossings, interpolates each interior polygon, and returns a MultiPolygon; adds a test for a box spanning longitudes near +178 and -179 verifying two coordinate rings around +180 and -180. ChangesAntimeridian crossing handling
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@static/src/js/util/map/normalizeSpatial.ts`:
- Around line 277-289: The divided polygon interiors from dividePolygon are not
guaranteed to be closed before interpolation, which can create invalid rings; in
the loop where dividedPolygon is mapped to dividedPolygonCoordinates and passed
to interpolateBoxPolygon (the block that pushes into multiPolygons), ensure each
dividedPolygonCoordinates is a closed ring by checking if the first coordinate
equals the last and, if not, push a copy of the first coordinate to the end
before calling interpolateBoxPolygon; update the code around the dividePolygon
-> dividedPolygonCoordinates -> interpolateBoxPolygon flow so every polygon
passed to interpolateBoxPolygon is closed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3e5313c5-3cef-4944-adfc-9085ecedbe9b
📒 Files selected for processing (2)
static/src/js/util/map/__tests__/normalizeSpatial.test.tsstatic/src/js/util/map/normalizeSpatial.ts
…correctly on the map
Overview
What is the feature?
We already split polygons and lines across the anti-meridian, but we don't split bounding boxes, so they do not show up correctly when drawn on our map.
What is the Solution?
Spilt bounding boxes that cross the anti-meridian
What areas of the application does this impact?
Drawing granules on the map
Testing
This UAT granule crosses with bounding box spatial. It should be drawn as two bounding boxes instead of one crossing the whole globe
http://localhost:8080/search/granules?p=C1275699127-ASF&pg[0][v]=f&pg[0][id]=OPERA_L3_DIST-ALERT-S1_T60UXC_20250123T182734Z_20260331T123639Z_S1A_30_v0.1&pg[0][gsk]=-start_date&ee=uat&q=OPERA_L3_DIST-ALERT-S1_V1
Attachments
Incorrect:

Correct:


Checklist
Summary by CodeRabbit
Tests
Bug Fixes