Skip to contents

Uses the representative point of each polygon (sf::st_point_on_surface()), which is always inside it; the centroid of a curved municipality can fall outside.

Usage

centroids(x, id_col)

Arguments

x

An sf object with polygons, e.g. the AGEB or localities of rgeomex.

id_col

Column with the identifier of each polygon (e.g. "CVEGEO").

Value

A data frame with id_col, latitude and longitude (WGS84), ready for download_nasa_power_data().