Skip to content

Commit

Permalink
check target crs in intersection
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Oct 28, 2019
1 parent daec5b0 commit 58c4985
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/Intersection.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ intersection <- function(features1, features2,

#check CRS
targetCRS <- proj4string(features1)
if (targetCRS != proj4string(features2)) {
if(!is.na(targetCRS)) if (targetCRS != proj4string(features2)) {
print("CRS differ, try to project the second feature collection")
features2 <- spTransform(features2, CRS(targetCRS));
}
Expand Down

0 comments on commit 58c4985

Please sign in to comment.