Skip to content

Commit

Permalink
fix #321
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Apr 13, 2023
1 parent 96fb35b commit 3cffcad
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions R/geoflow_entity.R
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ geoflow_entity <- R6Class("geoflow_entity",
#try to inherit epsg code from WKT definition (thanks to rspatial/terra)
crs_wkt <- sf.crs$wkt
if(!is.na(crs_wkt)) if(nzchar(crs_wkt)){
crs_def <- terra:::.srs_describe(crs_wkt)
crs_def <- terra::crs(crs_wkt, describe = TRUE)
if(!is.null(crs_def$authority)) if(!is.na(crs_def$authority)) if(crs_def$authority == "EPSG"){
epsgcode <-crs_def$code
}
Expand Down Expand Up @@ -735,7 +735,7 @@ geoflow_entity <- R6Class("geoflow_entity",
#try to inherit epsg code from WKT definition (thanks to rspatial/terra)
crs_wkt <- st_crs(sf.data)$wkt
if(nzchar(crs_wkt)){
crs_def <- terra:::.srs_describe(crs_wkt)
crs_def <- terra::crs(crs_wkt, describe = TRUE)
if(!is.null(crs_def$authority)) if(!is.na(crs_def$authority)) if(crs_def$authority == "EPSG"){
epsgcode <-crs_def$code
}
Expand Down Expand Up @@ -791,7 +791,7 @@ geoflow_entity <- R6Class("geoflow_entity",
#try to inherit epsg code from WKT definition (thanks to rspatial/terra)
crs_wkt <- sf.crs$wkt
if(!is.na(crs_wkt)) if(nzchar(crs_wkt)){
crs_def <- terra:::.srs_describe(crs_wkt)
crs_def <- terra::crs(crs_wkt, describe = TRUE)
if(!is.null(crs_def$authority)) if(!is.na(crs_def$authority)) if(crs_def$authority == "EPSG"){
epsgcode <-crs_def$code
}
Expand Down Expand Up @@ -836,7 +836,7 @@ geoflow_entity <- R6Class("geoflow_entity",
#try to inherit epsg code from WKT definition (thanks to rspatial/terra)
crs_wkt <- sf.crs$wkt
if(!is.na(crs_wkt)) if(nzchar(crs_wkt)){
crs_def <- terra:::.srs_describe(crs_wkt)
crs_def <- terra::crs(crs_wkt, describe = TRUE)
if(!is.null(crs_def$authority)) if(!is.na(crs_def$authority)) if(crs_def$authority == "EPSG"){
epsgcode <-crs_def$code
}
Expand Down Expand Up @@ -888,7 +888,7 @@ geoflow_entity <- R6Class("geoflow_entity",
#try to inherit epsg code from WKT definition (thanks to rspatial/terra)
crs_wkt <- sf.crs$wkt
if(!is.na(crs_wkt)) if(nzchar(crs_wkt)){
crs_def <- terra:::.srs_describe(crs_wkt)
crs_def <- terra::crs(crs_wkt, describe = TRUE)
if(!is.null(crs_def$authority)) if(!is.na(crs_def$authority)) if(crs_def$authority == "EPSG"){
epsgcode <-crs_def$code
}
Expand Down Expand Up @@ -962,7 +962,7 @@ geoflow_entity <- R6Class("geoflow_entity",
#try to inherit epsg code from WKT definition (thanks to rspatial/terra)
crs_wkt <- sf.crs$wkt
if(!is.na(crs_wkt)) if(nzchar(crs_wkt)){
crs_def <- terra:::.srs_describe(crs_wkt)
crs_def <- terra::crs(crs_wkt, describe = TRUE)
if(!is.null(crs_def$authority)) if(!is.na(crs_def$authority)) if(crs_def$authority == "EPSG"){
epsgcode <-crs_def$code
}
Expand Down Expand Up @@ -1018,7 +1018,7 @@ geoflow_entity <- R6Class("geoflow_entity",
data_object$setCoverages(cov.data)

#dynamic srid
cov.crs <- terra:::.srs_describe(cov.data@ptr$get_crs("wkt"))
cov.crs <- terra::crs(cov.data@ptr$get_crs("wkt"), describe = TRUE)
if(!is.null(cov.crs$code)) if(!is.na(cov.crs$code)){
data_srids <<- c(data_srids, as.integer(cov.crs$code))
}
Expand Down

0 comments on commit 3cffcad

Please sign in to comment.