refactored PostGisUtils
refactored and moved code (test beside class)