I have to calculate building's perimeter in order to calculate total lateral/walls surface area in a grid (as a function of each cell); however, I'm having problems in doing it. Can anyone help or suggest how to do it?
Two of the main functions to caracterize geometries are :
- ST_AREA(the_geom) which compute the area of each geometries,
- ST_LENGHT(the_geom) which compute the length of each geometries,
- if your geometry is a point --> no result,
- if your geometry is a line --> you get the length of the line,
- if your geometry is a polygon --> you get the perimeter of the polygon.
So, in your case, you can test this instruction :
SELECT ST_LENGTH(the_geom) AS perimeter FROM mytable;