Question about function COORDINATES in SP PACKAGE

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about function COORDINATES in SP PACKAGE

Pietro Andre Telatin Paschoalino
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Question about function COORDINATES in SP PACKAGE

Roger Bivand
Administrator
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: [hidden email]
https://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Roger Bivand
Department of Economics
Norwegian School of Economics
Helleveien 30
N-5045 Bergen, Norway
Reply | Threaded
Open this post in threaded view
|

Re: Question about function COORDINATES in SP PACKAGE

Pietro Andre Telatin Paschoalino
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Question about function COORDINATES in SP PACKAGE

Roger Bivand
Administrator
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 <[hidden email]>
> Enviado: quarta-feira, 4 de novembro de 2020 10:38
> Para: Pietro Andre Telatin Paschoalino <[hidden email]>
> Cc: [hidden email] <[hidden email]>
> 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: [hidden email]
> 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: [hidden email]
https://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Roger Bivand
Department of Economics
Norwegian School of Economics
Helleveien 30
N-5045 Bergen, Norway
Reply | Threaded
Open this post in threaded view
|

Re: Question about function COORDINATES in SP PACKAGE

Pietro Andre Telatin Paschoalino
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Question about function COORDINATES in SP PACKAGE

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

> Hello Roger,
>
> Yes, I'm using spdep package to construct the matrices.
>

Do not use matrices, use neighbour or weights objects. Dense matrices with
mostly zero values are a waste of space.

> I used the knearneigh function (in which I entered the coordinates), as
> well as the poly2nb function.

Yes, however, you change the support of the aggregated data units by doing
this, so knn is less well supported than contiguity in general.

>
> I think that I only have one of these rings but the size of the polygons
> is relatively large (they are political divisions) of a country. In that
> case, can I keep extracting coordinates by the coordinates function?
>

The centroids are more dependent (and so the distances between point
representations) on the boundary geometries than are simple contiguities.
Change of support is always something of a problem. Practically, yes, you
can do it, but whether it makes sense or not in terms of the data is a
different question.

> I didn't understand why you suggested avoiding GWR. Are you commenting
> on the methodology itself?

Yes, it may be used for exploring to detect possible omitted covariates
but should not be used for modelling unless that is definitely the data
generating process. Random data generates patterned (insignificant)
coefficient maps.

Roger

>
> Pietro Andre Telatin Paschoalino
> Doutorando em Ciências Econômicas da Universidade Estadual de Maringá - PCE.
>
>
>

--
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: [hidden email]
https://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Roger Bivand
Department of Economics
Norwegian School of Economics
Helleveien 30
N-5045 Bergen, Norway
Reply | Threaded
Open this post in threaded view
|

Re: Question about function COORDINATES in SP PACKAGE

Pietro Andre Telatin Paschoalino
CONTENTS DELETED
The author has deleted this message.