1
新しい "sf"パッケージを使用して、Rでブラジルの国勢調査データを操作しようとしています。私は、データをインポートすることができていますが、私は、元のポリゴンsf :: st_centroidを使ってポリゴンの重心を計算するには?
library(sf)
#Donwload data
filepath <- 'ftp://geoftp.ibge.gov.br/organizacao_do_territorio/malhas_territoriais/malhas_de_setores_censitarios__divisoes_intramunicipais/censo_2010/setores_censitarios_shp/ac/ac_setores_censitarios.zip'
download.file(filepath,'ac_setores_censitarios.zip')
unzip('ac_setores_censitarios.zip')
d <- st_read('12SEE250GC_SIR.shp',stringsAsFactors = F)
の重心を作成しようとすると、私は今、私がコラム「幾何学」の重心を含む新しいジオメトリカラムを作成しようとエラーが出るが、エラーが発生する:
d$centroid <- st_centroid(d$geometry)
Warning message:
In st_centroid.sfc(d$geometry) :
st_centroid does not give correct centroids for longitude/latitude data
どうすればこの問題を解決できますか?
は、これは警告だ、エラーではありません。値が作成されます。 –