geoserver is broken in too many ways, but we can replicate its functionality using postgis directly