edzer / geosphere

FORK of geosphere on r-forge:
http://r-forge.r-project.org/projects/geosphere/
2 stars 1 forks source link

Calculation of the Center of Montana Using R Centroid Function Issues #5

Open RafaRafa opened 6 years ago

RafaRafa commented 6 years ago

From: https://stackoverflow.com/questions/48554410/calculation-of-the-center-of-montana-using-r-centroid-function-issues

I'm trying to find the center of Montana using the R centroid function in the geosphere package. The lat/long coordinates are stored in a shape file stored in xx that when calculated yield a result near Bermuda.

Any suggestions as to how to fix this?

geosphere::centroid(as.matrix(xx))
#           lon      lat
#[1,] -62.60957 28.57984
range(xx$long)
#-116.0492 -104.0391
range(xx$lat)
#44.38032 49.00091

Here's xx: https://pastebin.com/uFgmph9g