JetBrains / JetBrains/lets-plot

Segment don't want to cross the 180th meridian

Open
#795 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
1.8k
Forks
60
PR merge metrics
No merged PRs in 30d

Description

Example:

```python
world = gpd.read_file(gpd.datasets.get_path("naturalearth_lowres"))
countries = world[world["name"].isin(["United States of America", "Russia"])]

ggplot() + \
geom_map(map=countries) + \
geom_segment(x=158.634805, y=53.038483, xend=-149.863129, yend=61.217381)
```

Output:

But, how to draw a segment that connects points along the shorter arc of great circle of Earth's surface? I would prefer it to be the default behavior. When drawing on the Earth's surface, one may follow the same principles as in [D3.js](https://www.jasondavies.com/maps/bounds/).

In ggplot2 there are several ways to deal with such a problem. For example, you can use the function `coord_sf()` to change the CRS, or divide the line with `st_wrap_dateline()` and shift plot with `st_shift_longitude()`, etc.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.