Closed paleolimbot closed 2 years ago
If another data point is helpful, I am finding a similar issue where R crashes completely on running the following:
al <- tigris::voting_districts('AL')
algeos <- geos::as_geos_geometry(al)
(Can't submit a reprex because R crashes.)
Thanks for adding this! Until I fix this, the workaround is to go through st_as_binary()
and geos_read_wkb()
like this:
al <- tigris::voting_districts('AL')
algeos <- geos::geos_read_wkb(sf::st_as_binary(tigris::voting_districts('AL')$geometry))
head(algeos)
#> <geos_geometry[6]>
#> [1] <MULTIPOLYGON [-86.909 31.870...-86.840 31.962]>
#> [2] <MULTIPOLYGON [-87.927 32.038...-87.745 32.191]>
#> [3] <MULTIPOLYGON [-88.052 32.030...-87.890 32.174]>
#> [4] <MULTIPOLYGON [-88.020 32.139...-87.854 32.308]>
#> [5] <MULTIPOLYGON [-87.877 32.343...-87.827 32.460]>
#> [6] <MULTIPOLYGON [-88.118 31.990...-87.950 32.129]>
Created on 2021-10-24 by the reprex package (v2.0.1)
Thanks for the workaround! The package looks great. Planning on using this and your libgeos
. After some testing, it seems like everything is extremely fast.
Good to know! There's a few things that are slower (geos_intersects_matrix()
is the one I know about)...let me know if you find anything else or find any problems!
This crash stopped happening on my computer, so I'm going to fall back to using geos_read_wkb()
for the next release and re-evaluate this later. This will slow down sf -> geos by about 4x (you can do wk::wk_handle(sf_object, geos_geometry_writer())
if you want the fast version that possibly crashes)
Also working for me using the most recent version on GitHub. Thanks!