<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV>
<DIV>Dear List,</DIV>
<DIV> </DIV>
<DIV>I have polyline depicting river banks. I have queried the minimum distance between left and right river bank as follows:</DIV>
<DIV> </DIV>
<DIV>SELECT min(ST_Distance(r.the_geom, r.the_geom)) as Min_Width </DIV>
<DIV>FROM River as r</DIV>
<DIV>WHERE r.Name = 'Barito';<BR><BR>It returns zero ('0') result. The left and the right river bank have the same attributes (ID, Name, etc), that is why I use ST_Distance(r.the_geom, r.the_geom). Should I give different ID or Name for left and river bank. How the argument of ST_distance should look like. The argument that I use above must be not correct (i.e. ST_Distance(r.the_geom, r.the_geom)). </DIV>
<DIV> </DIV>
<DIV>Any clue would be appreciated</DIV>
<DIV> </DIV>
<DIV>surya</DIV>
<DIV> </DIV></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR>
<DIV style="FONT-SIZE: 13px; FONT-FAMILY: arial, helvetica, sans-serif"><FONT face=Tahoma size=2>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Kevin Neufeld <kneufeld@refractions.net><BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> PostGIS Users Discussion <postgis-users@postgis.refractions.net><BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Fri, October 2, 2009 12:35:17 PM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [postgis-users] polygon minimum width<BR></FONT><BR>The linestrings wouldn't need to be continuous as long as you attribute them left and right bank. Then your query would be to find the shortest distance between two linear datasets (left and right banks). A cross product query would help you here. Or, ST_Collect your banks into two multilinestrings, one for left and one for right bank. Then compute the distance between them.<BR><BR>But you are still going to have problems at the head and mouth of the river. There, the left and right banks touch, so the
minimum distance between the left side of the river and right side of the river is zero. <BR>-- Kevin<BR><BR>Surya Tarigan wrote:<BR>> Hallo Nicklas<BR>> fortunately I have linestring version of the polygon, but it seems that the linestirings are not continuous. Does st_distance still apply? Or are there any postgis function to make the polyline continuous?<BR>> kind regards,<BR>> <BR>> ------------------------------------------------------------------------<BR>> *From:* "<A href="mailto:nicklas.aven@jordogskog.no" ymailto="mailto:nicklas.aven@jordogskog.no">nicklas.aven@jordogskog.no</A>" <<A href="mailto:nicklas.aven@jordogskog.no" ymailto="mailto:nicklas.aven@jordogskog.no">nicklas.aven@jordogskog.no</A>><BR>> *To:* PostGIS Users Discussion <<A href="mailto:postgis-users@postgis.refractions.net" ymailto="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</A>><BR>>
*Sent:* Thursday, October 1, 2009 3:50:37 PM<BR>> *Subject:* Re: [postgis-users] polygon minimum width<BR>> <BR>> Hallo<BR>> I think the easiest way is to make a linestring of the polygon.boundary and then cut the line in the start and end so you get two more or less paralell lines.. Then you can use st_distance to find the shortest distance between them..<BR>> Hope that helps<BR>> Nicklas<BR>> <BR>> 2009-10-01 Surya Tarigan wrote:<BR>> <BR>> ><BR>> ><BR>> Dear list,<BR>> ><BR>> ><BR>> I have a river polygon with polygon length about 20 km. How can I query the minimum width of the river polygon. I tried to search previous threads, but I could not find any clue.<BR>> ><BR>> ><BR>> kind regards,<BR>> ><BR>> ><BR>> surya<BR>> <BR>> ><BR>> <BR>>
------------------------------------------------------------------------<BR>> <BR>> _______________________________________________<BR>> postgis-users mailing list<BR>> <A href="mailto:postgis-users@postgis.refractions.net" ymailto="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</A><BR>> http://postgis.refractions.net/mailman/listinfo/postgis-users<BR>> <BR>_______________________________________________<BR>postgis-users mailing list<BR><A href="mailto:postgis-users@postgis.refractions.net" ymailto="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</A><BR><A href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target=_blank>http://postgis.refractions.net/mailman/listinfo/postgis-users</A><BR></DIV></DIV></div><br>
</body></html>