Skip to content
Prev 28418 / 29559 Next

sp:gIntersection warning message about projection

Hi Akos,

Thanks for your answer. I tried your suggestion, and for:
Warning messages:
1: In proj4string(buff) : CRS object has comment, which is lost in output
2: In proj4string(obj) : CRS object has comment, which is lost in output
Warning message:
In proj4string(buff) : CRS object has comment, which is lost in output
[1] "+proj=utm +zone=16 +datum=WGS84 +units=m +no_defs"
Warning message:
In proj4string(buff) : CRS object has comment, which is lost in output

I got these warnings, which again, i don't understand. I am trying to do an
R package that uses sp, and specifically gIntersection for my project and i
cannot leave it with those warnings.

But if after i have my two objects buff and pln and use these two
transforms you specified, where crs1 is my projection string "+proj=utm
+zone=16 +datum=WGS84
+units=m +no_defs" :

pln <- spTransform(x = pln, CRSobj=crs1)
Then, i get no warnings from the gIntersection function. I will test
further, but maybe this is the solution, although i still don't understand
why i need to transform my object with a projection when it already has
that projection.

Thanks again for your suggestion, it really helps ;-)

Take care,
Monica

##################################################################

Message: 2
Date: Wed, 21 Oct 2020 16:53:29 +0200
From: =?UTF-8?Q?Bede-Fazekas_=c3=81kos?= <bfalevlist at gmail.com>
To: r-sig-geo at r-project.org
Subject: Re: [R-sig-Geo] sp:gIntersection warning message about
        projection
Message-ID: <33da0968-ec27-89b3-6dc1-46d892309b93 at gmail.com>
Content-Type: text/plain; charset="iso-8859-2"; Format="flowed"

Hello Monica,

The format of CRS definition changed a lot in the last years. I saw
similar errors thrown by package sf, and transforming or CRS
modification solved the problem. Does rgeos::gIntersection() work if you
run one of the following lines before intersection?:
proj4string(pln) <- proj4string(buff)
pln <- spTransform(pln, proj4string(buff))
pln <- spTransform(x = pln, CRSobj = "+proj=utm +zone=16 +datum=WGS84
+units=m +no_defs"); buff<- spTransform(x = buff, CRSobj = "+proj=utm
+zone=16 +datum=WGS84 +units=m +no_defs")

Have a nice week,
?kos Bede-Fazekas
Hungarian Academy of Sciences

2020.10.21. 16:29 keltez?ssel, Monica Palaseanu-Lovejoy ?rta:
can
problem.
sp
am
ymax)
ymax)