<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">Hm,<br></div><div class="gmail_default" style="font-family:monospace,monospace">quite easy normally (method proposed above won't work).<br></div><div class="gmail_default" style="font-family:monospace,monospace">First break your polygon into segment, for instance with <br><a href="https://github.com/Remi-C/PPPP_utilities/blob/master/postgis/rc_DumpSegments.sql">https://github.com/Remi-C/PPPP_utilities/blob/master/postgis/rc_DumpSegments.sql</a><br></div><div class="gmail_default" style="font-family:monospace,monospace">Then, for each segment, compute the angle between first and last point, using <code class=""><span class="">ST_Azimuth, and st_pointN.<br><br></span></code></div><div class="gmail_default" style="font-family:monospace,monospace"><code class=""><span class="">Now, keep the segment where the abs(angle) is between pi/2<br> -tolerancy and pi/2+tolerancy<br>( you should add a tolerancy , nobody will be facing exactly north)</span><b class="">.<br></b></code></div><div class="gmail_default" style="font-family:monospace,monospace"><code class=""><b class="">Now simply sum the st_length of found segments.<br><br></b></code></div><div class="gmail_default" style="font-family:monospace,monospace"><code class=""><b class="">Cheers,<br></b></code></div><div class="gmail_default" style="font-family:monospace,monospace"><code class=""><b class="">Rémi-C<br></b></code></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-06-17 17:40 GMT+02:00 Komяpa <span dir="ltr"><<a href="mailto:me@komzpa.net" target="_blank">me@komzpa.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>you can apply ST_ForceRHR, break your polygons into segments and sum length of the ones that go from right to left, that is, where ST_X(ST_StartPoint(geom)) < ST_X(ST_StartPoint(geom)).</div><div><br></div><div>That's basically visibility problem, been there somewhere around <a href="https://github.com/Komzpa/Mapnik-Sheets/blob/master/3d-buildings/3dbuil.xml#L95" target="_blank">https://github.com/Komzpa/Mapnik-Sheets/blob/master/3d-buildings/3dbuil.xml#L95</a><br></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">2015-06-17 18:12 GMT+03:00 Paolo Crosato <span dir="ltr"><<a href="mailto:paolo.crosato@targaubiest.com" target="_blank">paolo.crosato@targaubiest.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I have a set of 2d polygons representing buildings. For each one, I have to find the lenght of the edges that look towards north.<br>
<br>
Here <a href="http://imgur.com/HgpO2yH" rel="noreferrer" target="_blank">http://imgur.com/HgpO2yH</a> there is a small picture with a test case, I have to compute the lenght of the red edges.<br>
<br>
Has anybody any suggestion on how to do this in postgis?<br>
<br>
Thanks for any input,<br>
<br>
Regards<span><font color="#888888"><br>
<br>
-- <br>
Paolo Crosato<br>
Software engineer/Custom Solutions<br>
e-mail: <a href="mailto:paolo.crosato@targaubiest.com" target="_blank">paolo.crosato@targaubiest.com</a><br>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div>Darafei "Komяpa" Praliaskouski<br>OSM BY Team - <a href="http://openstreetmap.by/" target="_blank">http://openstreetmap.by/</a><br><a href="mailto:xmpp%3Ame@komzpa.net" target="_blank">xmpp:me@komzpa.net</a> mailto:<a href="mailto:me@komzpa.net" target="_blank">me@komzpa.net</a><br></div>
</font></span></div>
<br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>