<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Everyone,<div><br></div><div>Since there seems to be some interest in exploring this a bit more, here's the more technical explanation of what I've done so far. I'm an R novice at best, so I would be very happy to learn of better or more efficient or more elegant ways to accomplish this. As far as a webapp, the possibility of Shiny comes to mind, but I have no idea whether that's something you could bundle up and embed on a webpage and/or whether your Shiny server and R implementation necessarily need to be on the same machine. </div><div><br></div><div><div>The dataset is here: <a href="http://data.ottawa.ca/dataset/tree-inventory-street-trees">http://data.ottawa.ca/dataset/tree-inventory-street-trees</a></div><div><br></div><div>The KML file is basically just a flavour of XML. I spent probably too much time messing around with the R XML stuff before finding the sp and rgdal packages (both at CRAN). The readOGR function from rgdal gave me a SpatialPointsDataframe object, that took just over half the size of the KML file in RAM. This gets you the coordinates in an array, and metadata still stored in blobs of XML. At first I just used perl regular expressions to go fishing for the fields I wanted but later I used readHTMLTable and laply to grab everything. </div><div><br></div><div>Then to get it all into a pretty plot, I used ggmap to put a map down and ggplot to put the trees on top. At the end you get something like the linked PDF from the R script I included below:</div><div><br></div><div></div></div></body></html>