- This tutorial is based on R.
- Sample data is available in the
datafolder (a sample of Car2Go's location data) - Sample code is availalbe at the
.Rmdfiles. - Currently, there are two sample files available (
geo_agg_tutorial.Rmdfor geospatial visualization and aggregation; andvoronoi_overlay_sample.Rmdfor generating Voronoi diagram based on real-world points).
- Loading the data as a dataframe (if lon/lat).
- Loading the data as SpatialPointsDataFrame (
sppackage).
- Sources might be
GeoJSON,Shapefile, orKML. - Loading the data as SpatialPolygonDataFrame (
sppackage). - Many boundaries datasets available from Census or city data portals.
rasterpackage for intersection, union, and etc.- It's possible to iterate through each polygon in a SpatialPolygonDataFrame.
- Example: Aggregation I: Points to Polygons
- Using
ggplotandggmapto visualize frequency using the color gradiation (polygon-based).
- Hexagons (in this example)
- Grids
- Voronoi diagram
- Intersection and union are still available (
raster) - When aggregating different polygon layers, you need to prorate the value of each polygon based on the proportion of the area.