Per Robert's request, here are some queries that take many rows of data, aggregate them based on the location (unique counts) or sector (unique sectors), then join the aggregates to the geometries at different levels.
WITH hap_counts AS (
SELECT
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
# open source spatial join script | |
# fiona and shapely scripting adapted from ThomasG77's comment from: | |
# http://gis.stackexchange.com/questions/119374/intersect-shapefiles-using-shapely | |
# | |
# import libraries | |
import fiona, rtree, os, shapefile | |
from shapely.geometry import shape, mapping | |
from os.path import isfile |