Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

A single point map fails #1011

Closed
Nowosad opened this issue Jan 2, 2025 · 2 comments
Closed

A single point map fails #1011

Nowosad opened this issue Jan 2, 2025 · 2 comments

Comments

@Nowosad
Copy link
Member

Nowosad commented Jan 2, 2025

Relates to geocompx/geocompr#1148.

library(tmap)
library(sf)
null_island = st_point(c(0, 0))
null_island = st_sfc(null_island, crs = "EPSG:4326")
null_island = st_sf(name = "Null Island", geom = null_island)

# works
plot(null_island)

# does not work
tm_shape(null_island) +
  tm_symbols()
#> Error in wk_handle.wk_wkb(wkb, s2_geography_writer(oriented = oriented, : Loop 0 is not valid: Edge 0 is degenerate (duplicate vertex)

# does not work (more complex example)
tm_shape(null_island) +
  tm_graticules(labels.col = "gray40") +
  tm_text("name", size = 5, fontface = "italic") +
  tm_layout(bg.color = "lightblue") +
  tm_title("You are here:", color = "gray40")
#> Error in wk_handle.wk_wkb(wkb, s2_geography_writer(oriented = oriented, : Loop 0 is not valid: Edge 0 is degenerate (duplicate vertex)
@mtennekes
Copy link
Member

Pls check. Was caused by area calculation of 'null' bounding box (#954)

@Nowosad
Copy link
Member Author

Nowosad commented Jan 3, 2025

Thanks @mtennekes

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants