[R-sig-Geo] Warning in st_intersection

Edzer Pebesma edzer.pebesma at uni-muenster.de
Thu Jul 6 17:37:14 CEST 2017



On 06/07/17 16:16, Sergio Ibarra wrote:
> Hello everyone
> 
> In my work, I use to intersect polygon grids with lines or points. I use
> the package "sf" with the function 'st_intersection". However, every time I
> run st_intersection I got the following Warning Message:
> 
> Warning message:attribute variables are assumed to be spatially
> constant throughout all geometries
> 
> 
> What does this warning mean?

Attribute values are assigned to sub-geometries; if these are spatially
constant, as for instance for land use, then this is fine. If they are
aggregates, such as population count, then this is not fine, wrong even.
By default, they are set to NA.

e.g.

demo(nc)
st_agr(nc) = "constant"

takes away the warning, as it sets all attribute values (in this case
wrongly) to "constant", as of their agr value (agr standing for
"attribute geometry relationship").

More here:
https://cran.r-project.org/web/packages/sf/vignettes/sf1.html#how-attributes-relate-to-geometries

> 
> Thanks
> 

-- 
Edzer Pebesma
Institute for Geoinformatics  (ifgi),  University of Münster
Heisenbergstraße 2, 48149 Münster, Germany; +49 251 83 33081
Journal of Statistical Software:   http://www.jstatsoft.org/
Computers & Geosciences:   http://elsevier.com/locate/cageo/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20170706/597f5e59/attachment.sig>


More information about the R-sig-Geo mailing list