sf icon indicating copy to clipboard operation
sf copied to clipboard

Evaluation error: Found 13 features with invalid spherical geometry. Loop 37 is not valid: Edge 0 has duplicate vertex with edge 8

Open jiepingy opened this issue 3 years ago • 3 comments

Hi, I am using the flicker API to get the photo, and I faced some problems with the code in R. Here is my code and the error. Thanks, if anyone could help, I will appreciate it a lot.

截屏2022-05-13 00 44 48 截屏2022-05-13 00 44 58

If you need any datasets from me, please feel free to ask.

jiepingy avatar May 12 '22 16:05 jiepingy

Try to turn off the spherical geometry engine as workaround: sf_use_s2(FALSE); or transform the coordinate system to plannar: st_transform().

kadyb avatar May 12 '22 18:05 kadyb

sf_use_s2(FALSE) worked for me, but I expect it is annoying a lot of people. I found any map that included Russia, like https://geodata.lib.utexas.edu/catalog/stanford-tf388jt3160 would not work.

kjbeath avatar Jun 01 '22 06:06 kjbeath

Could you specify "would not work"? I downloaded the map you point to, which obviously is not valid on S2, but st_make_valid() makes it valid without issue.

edzer avatar Jun 01 '22 07:06 edzer