Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Warnings when simpifying sf #78

Closed
mtennekes opened this issue Jun 6, 2018 · 2 comments
Closed

Warnings when simpifying sf #78

mtennekes opened this issue Jun 6, 2018 · 2 comments

Comments

@mtennekes
Copy link

mtennekes commented Jun 6, 2018

library(rmapshaper)
library(spData)
library(sf)
library(sp)

world2 <- ms_simplify(world, keep=.2)

gives these warnings:

Warning messages:
1: In eval(call(as_fun, df[[n]])) : NAs introduced by coercion
2: In eval(call(as_fun, df[[n]])) : NAs introduced by coercion
3: In eval(call(as_fun, df[[n]])) : NAs introduced by coercion

However, the result looks ok, and also the same as sp:

world_sp <- as(world, "Spatial")
world2_sp <- ms_simplify(world_sp, keep=.2)

library(tmap)
tmap_mode("view")
tmap_arrange(qtm(world_sp, title = "Original sf"), 
             qtm(world2, title = "Simplified sf"),
             qtm(world_sp, title = "Original sp"), 
             qtm(world2_sp, title = "Simplified sp"), 
             nrow = 2,
             sync = TRUE)

screenshot from 2018-06-06 12-15-29

@ateucher
Copy link
Owner

ateucher commented Jun 6, 2018

Thanks @mtennekes. I can reproduce this. Luckily the warning is spurious - after processing with mapshaper, the original column classes are restored, and some NA's were encountered in coercion. This whole piece of rmapshaper needs reworking under the hood, as it is a bit clunky. Related to #69 and #75.

@ateucher
Copy link
Owner

ateucher commented Apr 4, 2023

Closing in favour of #69

@ateucher ateucher closed this as completed Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants