Skip to content

Error in CPL_get_z_range(obj, 1) : z error - expecting three columns; #2095

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

Closed
rhijmans opened this issue Feb 8, 2023 · 1 comment
Closed

Comments

@rhijmans
Copy link
Contributor

rhijmans commented Feb 8, 2023

I see this error

f = "/vsicurl/https://github.com/GEMScienceTools/gem-global-active-faults/raw/master/geopackage/gem_active_faults_harmonized.gpkg"
 
library(terra)
#terra 1.7.6
v <- vect(f)

library(sf)
#Linking to GEOS 3.9.4, GDAL 3.6.0, PROJ 9.1.1; sf_use_s2() is TRUE
s <- read_sf(f)
#Error in CPL_get_z_range(obj, 1) : z error - expecting three columns;

It could be that the file has an issue. "terra" silently drops the z-coordinates; so it may be that it can read the file for that reason.

@edzer
Copy link
Member

edzer commented Feb 8, 2023

This has been solved in the dev version, #2046 #1592

It returns a mix of dimensions:

> s <- read_sf(f)
> s
Simple feature collection with 13696 features and 23 fields
Geometry type: LINESTRING
Dimension:     XY, XYZ
Bounding box:  xmin: -180 ymin: -66.163 xmax: 180 ymax: 86.805
z_range:       zmin: NA zmax: NA
Geodetic CRS:  WGS 84

@edzer edzer closed this as completed Feb 8, 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