mirror of
https://git.osgeo.org/gitea/postgis/postgis
synced 2024-10-25 09:32:46 +00:00
update ST_Line_Locate ... with example of closest point. Asked way too many times on postgis news groups
git-svn-id: http://svn.osgeo.org/postgis/trunk@4341 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
parent
adf4763a73
commit
0ed90a2fcc
|
@ -13246,7 +13246,7 @@ MULTILINESTRING((3 4,4 5),(1 2,3 4))
|
|||
</refentry>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="Linear_Referencing">
|
||||
<sect1 id="Linear_Referencing">
|
||||
<title>Linear Referencing</title>
|
||||
<refentry id="ST_Line_Interpolate_Point">
|
||||
<refnamediv>
|
||||
|
@ -13311,6 +13311,14 @@ SELECT ST_AsEWKT(ST_Line_Interpolate_Point(the_line, 0.5))
|
|||
--------------------
|
||||
POINT(3.5 4.5 5.5)
|
||||
|
||||
|
||||
--find closest point on a line to a point or other geometry
|
||||
SELECT ST_AsText(ST_Line_Interpolate_Point(foo.the_line, ST_Line_Locate_Point(foo.the_line, ST_GeomFromText('POINT(4 3)'))))
|
||||
FROM (SELECT ST_GeomFromText('LINESTRING(1 2, 4 5, 6 7)') As the_line) As foo;
|
||||
st_astext
|
||||
----------------
|
||||
POINT(3 4)
|
||||
|
||||
</programlisting>
|
||||
</refsection>
|
||||
|
||||
|
@ -13318,7 +13326,7 @@ SELECT ST_AsEWKT(ST_Line_Interpolate_Point(the_line, 0.5))
|
|||
<refsection>
|
||||
<title>See Also</title>
|
||||
|
||||
<para><xref linkend="ST_Length" />, <xref linkend="ST_Line_Locate_Point" /></para>
|
||||
<para><xref linkend="ST_AsText" />,<xref linkend="ST_AsEWKT" />,<xref linkend="ST_Length" />, <xref linkend="ST_Line_Locate_Point" /></para>
|
||||
</refsection>
|
||||
</refentry>
|
||||
|
||||
|
@ -13384,6 +13392,14 @@ WHERE ST_DWithin(street_line, house_loc, 0.2);
|
|||
POINT(1.01 2.06) | 10
|
||||
POINT(2.02 3.09) | 15
|
||||
POINT(3.03 4.12) | 20
|
||||
|
||||
--find closest point on a line to a point or other geometry
|
||||
SELECT ST_AsText(ST_Line_Interpolate_Point(foo.the_line, ST_Line_Locate_Point(foo.the_line, ST_GeomFromText('POINT(4 3)'))))
|
||||
FROM (SELECT ST_GeomFromText('LINESTRING(1 2, 4 5, 6 7)') As the_line) As foo;
|
||||
st_astext
|
||||
----------------
|
||||
POINT(3 4)
|
||||
|
||||
</programlisting>
|
||||
</refsection>
|
||||
|
||||
|
|
Loading…
Reference in a new issue