Melb <- get_map("Melbourne,Australia", zoom = 10, source = "stamen", maptype = "toner")
ggmap(Melb)
The Node and Cell data is manipulated to produce a dataset which lists the geolocation, hardware variant and number of frequencies supported at each site represented by the first four letters of cellname (LRD Code)
#Set up VIC Dataset
df.VIC_NodeData <- read.csv("NodeData_VIC_METRO.csv", header = T, stringsAsFactors=FALSE)
df.VIC_CellData <- read.csv("CellData_VIC_METRO.csv", header = T, stringsAsFactors=FALSE)
df.VIC_CellNodeData <- merge(x=df.VIC_CellData, y=df.VIC_NodeData,by.x=c("nodename"), by.y=c("nodename"), all.x = TRUE, all.y = FALSE)
df.VIC_CellNodeData <- subset(df.VIC_CellNodeData, select=-c(itkAttrMoId.y))
colnames(df.VIC_CellNodeData)[14:15] = c("cellname","NodeType")
# Replace Hardware Names by Hardware Variant
df.VIC_CellNodeData$NodeType <- gsub("ENB", "G1", df.VIC_CellNodeData$NodeType)
df.VIC_CellNodeData$NodeType <- gsub("MSRBS", "G2", df.VIC_CellNodeData$NodeType)
# Subset for Node Data
df.VIC_SiteData = df.VIC_CellNodeData[,c("nodename","latitude","longitude","cellname", "NodeType", "freqBand")]
df.VIC_SiteData <- count(df.VIC_SiteData, nodename, latitude, longitude)
df.VIC_SiteData$latitude <- df.VIC_SiteData$latitude/1000000
df.VIC_SiteData$longitude <- df.VIC_SiteData$longitude/1000000
colnames(df.VIC_SiteData)[4] = c("numCells")
Plot the data for the number of Cells per Site location onto this Map
p <- ggmap(Melb)
cols <- c("1"="#fabb00","2"="#f08a00","3"="#e32119","4"="#a66dff","5"="#00b302","6"="#00a9d4","7"="#a64dff","8"="#b1b3b4","9"="#00625f","10"="#00285f","11"="#ffffff","12"="#00285f")
p + geom_point(data=df.VIC_SiteData, aes(x=longitude, y=latitude, color = factor(numCells)),
size=1.5, alpha = .7) + labs(title = "Cell Count at Melbourne Sites", x = "Longitude", y = "Latitude") + scale_color_manual(name = "Number of Cells",values = cols)