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
st_split leads to crashing r session #492
Comments
This is not a reprex for anything; crash is defined in the R FAQ. When using randon numbers, always set the seed. Nothing unusual for me. If you want to contribute code, please do so, use a polygon to divide a polygon. |
I also cannot reproduce this. What do you see when you try > sf::sf_extSoftVersion()
GEOS GDAL proj.4 lwgeom
"3.5.1" "2.2.0" "4.9.2" "2.3.3 r15473" ? |
Please reopen in case you can provide a reproducible example. |
I'd like to reopen the issue as I experience the same problem. Session Info> sf::sf_extSoftVersion()
GEOS GDAL proj.4 lwgeom
"3.5.1" "2.1.3" "4.9.2" "2.4.0 r15853" > sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.3 LTS
Matrix products: default
BLAS: /usr/lib/openblas-base/libblas.so.3
LAPACK: /usr/lib/libopenblasp-r0.2.18.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] sf_0.5-5
loaded via a namespace (and not attached):
[1] compiler_3.4.2 magrittr_1.5 DBI_0.7 tools_3.4.2 units_0.4-6 yaml_2.1.14
[7] Rcpp_0.12.13 udunits2_0.13 grid_3.4.2 Reproducible examplepol <- rbind(c(-3,3), c(-3,4), c(-2,4), c(-2,3), c(-3,3))
pol <- st_polygon(list(pol))
blade <- rbind(c(-2.5, 3), c(-2.6, 4))
blade <- st_linestring(blade)
st_split(pol, blade) This crashes the R session. Could it come from the GDAL version? |
Well it is strange for two reasons:
|
Thanks! It doesn't crash R, it stops it, with a message, as Tim shows.
The error is the call to > st_sfc(sf:::CPL_split(st_geometry(pol), st_geometry(blade)))
Geometry set for 1 feature
geometry type: GEOMETRYCOLLECTION
dimension: XY
bbox: xmin: -3 ymin: 3 xmax: -2 ymax: 4
epsg (SRID): NA
proj4string: NA
GEOMETRYCOLLECTION (POLYGON ((-3 3, -3 4, -2.6 ... with this commit, I get: > st_split(pol, blade) %>% st_collection_extract("POLYGON")
Geometry set for 2 features
geometry type: POLYGON
dimension: XY
bbox: xmin: -3 ymin: 3 xmax: -2 ymax: 4
epsg (SRID): NA
proj4string: NA
POLYGON ((-3 3, -3 4, -2.6 4, -2.5 3, -3 3))
POLYGON ((-2.6 4, -2 4, -2 3, -2.5 3, -2.6 4)) |
People finding this page through search engines should be aware that |
Hi all,
st_split can be used to split a linestring with points, but is it possible to split a polygon with a line?
A simple example:
... already leads to a crashing R session in my case. Is there anything wrong with sf, liblwgeom or whatever installation, or is just not possible to do that with sf?
According to this:
https://www.gaia-gis.it/fossil/libspatialite/wiki?name=liblwgeom-4.0
... it should be possible.
The text was updated successfully, but these errors were encountered: