根据某电信运行商基站清单数据,通过经纬度信息画出这些点在北京的分布,R,数据集就不给出了,最后代码中给出了处理后真正作图的样本数据
##############################################
library(ggmap)
library(mapproj)
library(DBI)
library(RMySQL)
con=dbConnect(MySQL(),user='root',password='123',dbname='cmcc',host='localhost')
zhongguancun=dbGetQuery(con,'select cell_name,longtitude,latitude from 8_15_table_9 where DEPT_NAME="中关村片区1" or DEPT_NAME="中关村片区2"')#从数据库获取中关村的基站经纬度
#jingweidu=read.csv('./cmcc_doc/基站清单1.txt',header=T,colClasses=c('NULL','factor',rep(list('NULL'),4),'numeric','numeric',rep(list('NULL'),21)))
#classes=sapply(jingweidu,class)
names(jingweidu)=c('name','longitude','latitude')
#google给我中关村的公路地图数据吧
bjmap <- qmap('zhongguancun', zoom = 12, maptype = 'roadmap