<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Based on a suggestion from another list, I tried using ST_line_locate_point, but get this error:</div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><div><div><div>gc3=# SELECT</div></div></div><div><div><div>gc3-# ST_AsText(the_geom) as street, strunamefr, l_adddirfg, l_hnumf, l_hnuml, l_stname_c, l_placenam, r_adddirfg, r_hnumf, r_hnuml, r_stname_c, r_placenam,</div></div></div><div><div><div>gc3-# ST_Distance(ST_GeomFromText('POINT(-79.639711 43.8098590)',4326),the_geom) AS distance,</div></div></div><div><div><div>gc3-# ST_line_locate_point(the_geom, ST_GeomFromText('POINT(-79.639711 43.8098590)')) As street_num</div></div></div><div><div><div>gc3-# FROM province_on</div></div></div><div><div><div>gc3-# WHERE the_geom && SetSRID('BOX3D(-79.64991853 43.80470025,-79.63089798 43.81621783)'::box3d,4326) ORDER BY distance ASC LIMIT 1;</div></div></div><div><div><div>ERROR:  line_locate_point: 1st arg isnt a line</div></div></div><div><div><div>gc3=# </div></div></div></blockquote><div><br></div><div>So I'm using PostGIS 1.5.3, and the docs (<a href="http://postgis.refractions.net/docs/ST_Line_Locate_Point.html">http://postgis.refractions.net/docs/ST_Line_Locate_Point.html</a>) say that multilinestrings are supported, so…. ???</div><div><br></div><div><br></div><div><div>On 2011-10-13, at 6:19 PM, René Fournier wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">In PostGIS parlance, <span class="Apple-style-span" style="font-family: monospace; white-space: pre; ">given a lat/lng point... where -- in terms of percentage or decimal -- does it lie along on a row's  </span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; ">multilinestring?</span><div><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="white-space: pre;"><br></span></font></div><div><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="white-space: pre;">The thing is, the multilinestring is just a single line string. But I suppose there are cases where there are more than one segment to the street… In any case, I have a range of house numbers, and I need to determine which side of the multilinestring the latlng lies, and then how far along… I know I'm not the first person to ask this, but I haven't been able to find a suitable answer.<br></span></font></div><div><div><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="white-space: pre;"><br></span></font></div><div><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="white-space: pre;">For what it's worth, I'm using the 2010 Tigerline data imported via shp2pgsql. </span></font></div><div><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="white-space: pre;"><br></span></font></div><div><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="white-space: pre;">Any ideas? Thanks!</span></font></div><div><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="white-space: pre;"><br></span></font></div><div><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="white-space: pre;">…Rene</span></font></div><div><br></div></div></div>_______________________________________________<br>postgis-users mailing list<br><a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>http://postgis.refractions.net/mailman/listinfo/postgis-users<br></blockquote></div><br></body></html>