R

Rasterize Lines in R

As a part of a University level GIS course I taught I needed to generate some raster data for a lab exercise on map algebra. I wrote a function to “rasterize” polyline data I had on hand, that is, to convert the discrete polyline data to a continuous density surface. This type of operation used in things like land use regression models or in metrics of walkability or bikeability, which require all input data to be continuous surfaces.

Kernel Density Estimation of Point Processes in Network Space in R

To produce kernel density estimates (KDE) of point processes in a linear network: \[\lambda(z)= \sum_{i=1}^{n} \frac{1}{\tau} k(\frac{d_{iz}}{\tau})y_i\] Using the Quartic function: \[\lambda(z)= \sum_{i=1}^{n} \frac{1}{\tau}(\frac{3}{\pi}(1-\frac{d_{iz}^2}{\tau^2}))y_i\] Where, \(\lambda\)(z) = density at location z; \(\tau\) is bandwidth linear network distance; \(k\) is the kernel function, typically a function of the ratio of \(d_{iz}\) to \(\tau\); \(d_{iz}\) is the linear network distance from event \(i\) to location \(z\). I wanted to implement a network-based KDE in R based on the algorithm outlined in Xie & Yan (2008).