<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font face="Arial">I'll first approach it with topology. Sounds
great! :)<br>
(</font><font face="Arial"><font face="Arial">Also I hadn't
thought about dead end streets.) <br>
<br>
</font>Thank you! <br>
<br>
</font>
<div class="moz-signature"><span style="font-size:8.5pt">
<b>Toni Hernández Vallès</b>
<br>
Servei de Sistemes d'Informació Geogràfica i Teledetecció<br>
-<br>
Universitat de Girona<br>
<b>SIGTE</b><br>
-<br>
Pl. Ferrater Mora 1<br>
17071 Girona<br>
Tel +34 972 418 039 (7026 intern)<br>
<a href="mailto:toni@sigte.udg.edu">toni@sigte.udg.edu</a>
<br>
<br>
<a href="http://www.sigte.udg.edu">http://www.sigte.udg.edu</a><br>
Twitter <a href="http://twitter.com/SIGTE_UDG">http://twitter.com/SIGTE_UDG</a><br>
<br>
</span></div>
<div class="moz-cite-prefix">On 23/11/2015 21:59, Martijn Meijers
wrote:<br>
</div>
<blockquote cite="mid:56537E1F.5090706@tudelft.nl" type="cite">Hi,
<br>
<br>
Would <a class="moz-txt-link-freetext" href="http://postgis.net/docs/ST_ShortestLine.html">http://postgis.net/docs/ST_ShortestLine.html</a> help you in
this case?
<br>
<br>
I am not sure how important the distinction between left/right is,
but are you sure that this is always defined properly just by
looking at the street and building only? E.g. if you have the
following: the house (in the center) is it on the left or right of
the small dead end street?
<br>
<br>
+-------------------+
<br>
| |
<br>
| +===+ |
<br>
| +===+ |
<br>
| |
<br>
| + |
<br>
| | |
<br>
+----+--------------+
<br>
<br>
One option: You could build explicit topology and then use
information of the faces and use left/right pointers on the edges
(the streets) to determine that a building is on the left/right of
a street (road part) - you can then also easily filter dead ends.
<br>
<br>
Another (potentially less accurate) option: calculate orient2d
(<a class="moz-txt-link-freetext" href="https://www.cs.cmu.edu/~quake/robust.html">https://www.cs.cmu.edu/~quake/robust.html</a>) for every segment of
the street to every polygon vertex of the building (or even
coarser approximation, but much faster: use centroid of the house
and one segment that represents the street, e.g. vector from begin
point segment - end point segment). I think you have to make such
an orientation test in Postgres/PostGIS yourself by making a
custom database function. Note that this could give wrong results
when streets run around buildings (flipping of left/right as
result).
<br>
<br>
<br>
Martijn
<br>
<br>
On 23-11-15 16:13, toni hernández wrote:
<br>
<blockquote type="cite">Hello everyone,
<br>
<br>
I have two tables: streets and buildings.
<br>
streets with a linestring geometry and buildings with polygons
geometry.
<br>
<br>
I need to know what is the minimal distance from each street to
a building on the right, and then, what is the minimal distance
from the street to a building on the left.
<br>
<br>
Any ideas on how I should approach this?
<br>
<br>
Thank you!
<br>
-- <br>
*Toni Hernández Vallès*
<br>
Servei de Sistemes d'Informació Geogràfica i Teledetecció
<br>
-
<br>
Universitat de Girona
<br>
*SIGTE*
<br>
-
<br>
Pl. Ferrater Mora 1
<br>
17071 Girona
<br>
Tel +34 972 418 039 (7026 intern)
<br>
<a class="moz-txt-link-abbreviated" href="mailto:toni@sigte.udg.edu">toni@sigte.udg.edu</a> <a class="moz-txt-link-rfc2396E" href="mailto:toni@sigte.udg.edu"><mailto:toni@sigte.udg.edu></a>
<br>
<br>
<a class="moz-txt-link-freetext" href="http://www.sigte.udg.edu">http://www.sigte.udg.edu</a>
<br>
Twitter <a class="moz-txt-link-freetext" href="http://twitter.com/SIGTE_UDG">http://twitter.com/SIGTE_UDG</a>
<br>
<br>
<br>
<br>
_______________________________________________
<br>
postgis-users mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/postgis-users">http://lists.osgeo.org/mailman/listinfo/postgis-users</a>
<br>
</blockquote>
<br>
_______________________________________________
<br>
postgis-users mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/postgis-users">http://lists.osgeo.org/mailman/listinfo/postgis-users</a><br>
</blockquote>
<br>
</body>
</html>