postgis-grids hex, rect and triangle grid generating via postgis You can use this helping fucntions to create grids of such form: rectange, hex, triangle.