[R-sig-Geo] Question about function COORDINATES in SP PACKAGE

Roger Bivand Roger@B|v@nd @end|ng |rom nhh@no
Wed Nov 4 15:09:36 CET 2020


On Wed, 4 Nov 2020, Pietro Andre Telatin Paschoalino wrote:

> Hi Roger,
>
> What do you mean by hole? Non-contiguous regions? If so, I don't think 
> it's a problem, because I don't have any non-contiguous regions. I have 
> a blank polygon that is not computed because it is a lake (it is blank).

An interior ring within a polygon (like a lake, or another region 
fully within another, which then has its own exterior ring).

>
> I am using coordinates to build spatial weight matrices to use in 
> spatial regression / geographically weighted regressions.

Please do not try to do this by hand. You can use topological predicates 
(in rgeos or sf), or simply use spdep::poly2nb(), which does this. Avoid 
GWR whenever possible, please.

Roger

>
> Pietro Andre Telatin Paschoalino
> Doutorando em Ciências Econômicas da Universidade Estadual de Maringá - PCE.
>
> ________________________________
> De: Roger Bivand <Roger.Bivand using nhh.no>
> Enviado: quarta-feira, 4 de novembro de 2020 10:38
> Para: Pietro Andre Telatin Paschoalino <Pietro_telato using hotmail.com>
> Cc: r-sig-geo using r-project.org <r-sig-geo using r-project.org>
> Assunto: Re: [R-sig-Geo] Question about function COORDINATES in SP PACKAGE
>
> On Wed, 4 Nov 2020, Pietro Andre Telatin Paschoalino wrote:
>
>> Hello everyone.
>>
>> Could anyone help with a small question about the coordinates in sp
>> package function?
>>
>> I want to retrieve the geographic coordinates of polygons (shape file),
>> and reading the documentation, I did not find out if these coordinates
>> refer to the centroid of polygon.
>>
>> So, in fact, do such coordinates refer to the centroid of each polygon?
>
> Yes, they report the centroid of the largest polygon, but may not handle
> holes correctly. Why do you need to retreive the complete set of
> coordinates? That would be much easier using the sf package, but is seldom
> needed.
>
> Roger
>
>>
>> Thanks.
>>
>> Pietro Andre Telatin Paschoalino
>> Doutorando em Ci�ncias Econ�micas da Universidade Estadual de Maring� - PCE.
>>
>>        [[alternative HTML version deleted]]
>>
>>
>
> --
> Roger Bivand
> Department of Economics, Norwegian School of Economics,
> Helleveien 30, N-5045 Bergen, Norway.
> voice: +47 55 95 93 55; e-mail: Roger.Bivand using nhh.no
> https://orcid.org/0000-0003-2392-6140
> https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
>

-- 
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: Roger.Bivand using nhh.no
https://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en


More information about the R-sig-Geo mailing list