Adapted main to new return type of postgis functions