Skip to content

Commit

Permalink
fixes #387
Browse files Browse the repository at this point in the history
  • Loading branch information
dblodgett-usgs committed May 19, 2020
1 parent d015237 commit 7d93728
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions R/06-simplegeom-obj.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,9 @@ setAs("data.frame", "simplegeom", function(from) {

#'@importFrom sp Polygons Polygon CRS proj4string
setAs("SpatialPolygons", "simplegeom", function(from) {

supported.CRS <- c("+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0", "+proj=longlat +datum=WGS84")

if (!proj4string(from) %in% supported.CRS){

if (!(grepl("+proj=longlat", as.character(proj4string(from))) &
grepl("+proj=longlat", as.character(proj4string(from))))) {
stop('"',proj4string(from), '" not supported for "simplegeom", use "+proj=longlat +datum=WGS84"')
}

Expand Down

0 comments on commit 7d93728

Please sign in to comment.