added code for ch04-04 postgis validity