calculer polygone périmètre

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

calculer polygone périmètre

R_Tavares
Salut,

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?

Thanks in advance,

Richard
Reply | Threaded
Open this post in threaded view
|

Re: calculer polygone périmètre

Gwendall Petit
Administrator
Hi Richard,

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;
Regards,

Gwendall