# 第一個問題(分行政區畫圖)
data <- read.csv("ntp.gis.csv",fileEncoding = "UTF-8", header = TRUE)

map <- get_map(location = "Taipei", zoom = 11, language = "zh-TW", color = "bw")
ggmap(map) +
geom_point(aes(x = zip_x, y = zip_y), color="red", data = data) +
facet_wrap(~ district)

# 第 2 & 3 個問題(自動取最適合的zoom-in尺度, 經緯度精確度問題)
# 板橋
banqiao <- subset(data,data$district=='板橋區')
map <- get_map(location = c(lon = 121.453220, lat = 25.006734), zoom = 14, language = "zh-TW", color = "bw")
ggmap(map) +
#geom_point(aes(x = zip_x, y = zip_y), color = "red", data = banqiao) +
geom_jitter(aes(x = zip_x, y = zip_y),col="red", position = position_jitter(w=0.0005,h=0.0005),data=banqiao)
