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

vect() error for .kml files on Linux #1084

Closed
AMBarbosa opened this issue Mar 29, 2023 · 2 comments
Closed

vect() error for .kml files on Linux #1084

AMBarbosa opened this issue Mar 29, 2023 · 2 comments

Comments

@AMBarbosa
Copy link
Contributor

On Windows, .kml files are read as expected (except maybe for the warning message); but on Linux (system info below) there's also an error and the file is not read:

download.file("https://filesamples.com/samples/code/kml/sample3.kml", "sample3.kml")
library(terra)
v <- vect("sample3.kml")
# Error: [vect] cannot read this geometry type: Unknown (any)
# In addition: Warning message:
# [vect] Z coordinates ignored 
> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Linux Mint 21.1

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=pt_PT.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=pt_PT.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=pt_PT.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.1.2   tools_4.1.2      rstudioapi_0.14  Rcpp_1.0.10     
[5] codetools_0.2-19 terra_1.7-21    
@rhijmans
Copy link
Member

I can reproduce this. It does not seem to be related to the version of GDAL. My guess is that it is related to the version of the library that reads KML (that is then used by GDAL).

@rhijmans
Copy link
Member

This now works, although there is a difference between linux (11 attributes) and windows (2 attributes), presumably due to a difference in the underlying KML library.

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