fixes to views and to postgis json