0
다른 카운티 조합에서 나온 다각형.순서를 변경하는 방법 정식 클래스 공간 다각형 나는 (텍사스에 한함) 미국 인구 조사 자료를 사용하여 33을 만들려는거야</p> <p>를 사용하여 공식 클래스 공간 다각형의 집합을 재정렬 할 수있는 방법을 찾고 있어요
library(tmap)
library(maptools)
library(ggplot2)
library(rgeos)
library(sp)
library(mapdata)
library(rgdal)
library(raster)
# Download the map of texas and get the LMAs boundaries
# Download shape
f <- tempfile()
download.file("http://www2.census.gov/geo/tiger/GENZ2010/gz_2010_us_050_00_20m.zip", destfile = f)
unzip(f, exdir = ".")
US <- read_shape("gz_2010_us_050_00_20m.shp")
# Select only Texas
Texas <- US[(US$STATE %in% c("48")),]
# Load the LMA append data
LMAs = read.table('LMA append data.csv',header=T, sep=',')
# Append LMA data to Texas shape
Texas$FIPS <- paste0(Texas$STATE, Texas$COUNTY)
Texas <- append_data(Texas, LMAs, key.shp = "FIPS", key.data = "FIPS")
Texas <- Texas[order(Texas$LMA),]
# Create shape object with LMAs polygons
Texas_LMA <- unionSpatialPolygons(Texas, IDs=Texas$LMA)
나는
# Create shape object with LMAs polygons
Texas_LMA <- unionSpatialPolygons(Texas, IDs=Texas$LMA)
spp <- SpatialPolygonsDataFrame(Texas_LMA,data=matrix(1:33,nrow=33,ncol=1))
와 SpatialPolygonsDataFrame에 Texas_LMA 변환 시도했다 그러나 그것은 나를 위해 일하지 않았다.
을하고 그것은 나를 재 수 필요한 순서대로 다각형을 정렬하십시오. 도와 주셔서 감사합니다! – rskinner593