diff --git a/R/conn.read_gdal.R b/R/conn.read_gdal.R index 2df2d08..fe65dc1 100644 --- a/R/conn.read_gdal.R +++ b/R/conn.read_gdal.R @@ -35,12 +35,6 @@ ,verbose=FALSE,...) { ## ,... # if (resetGrid) # session_grid(NULL) - if (!file.exists(fname)) { - list1 <- dir(path=dirname(fname),pattern=paste0("^",basename(fname)),full.names=TRUE) - list1 <- list1[.grep("\\.(tif|tiff|img|hfa)$",basename(list1))] - if (length(list1)==1) - fname <- list1 - } engList <- as.character(as.list(match.fun("read_gdal"))[["engine"]])[-1] if (length(engine)0] if (noProj <- !length(proj4)) - proj4 <- "+init=epsg:4326" + proj4 <- "+proj=longlat +datum=WGS84 +no_defs" ftemp <- .maketmp() # .maketmp() #tempfile(pattern="") # ".\\tmp1" cmd <- paste("ogrinfo","-q",.dQuote(dsn)) if (verbose) diff --git a/R/xxx.spatialize.R b/R/xxx.spatialize.R index cc02dfd..e12cf24 100644 --- a/R/xxx.spatialize.R +++ b/R/xxx.spatialize.R @@ -204,7 +204,7 @@ crsNow <- NA if (is.na(crsNow)) { if ((.lgrep("^(lon|lng$)",coords[1])==1)&&(.lgrep("^lat",coords[2])==1)) - crsNow <- "EPSG:4326" + crsNow <- "+proj=longlat +datum=WGS84 +no_defs" else if (is.data.frame(dsn)) { if (is.character(attr(dsn,"crs"))) crsNow <- attr(dsn,"crs") diff --git a/R/yyy.project.R b/R/yyy.project.R index 2ba15a8..cca48fb 100644 --- a/R/yyy.project.R +++ b/R/yyy.project.R @@ -101,11 +101,11 @@ if (verbose) message("'sf' is used") if (inv) { - crs_t <- "EPSG:4326" + crs_t <- "+proj=longlat +datum=WGS84 +no_defs" crs_s <- proj } else { - crs_s <- "EPSG:4326" + crs_s <- "+proj=longlat +datum=WGS84 +no_defs" crs_t <- proj } if (is.list(xy)) @@ -145,7 +145,7 @@ sf::st_multipoint(xy),crs=crs_s),crs_t)[[1]])) else { if (T & !sf::sf_proj_network()) - sf::sf_proj_network(url="",TRUE) + try(sf::sf_proj_network(url="",TRUE)) if (F & verbose) { print(xy) print(crs_s)