12.07.2015 Views

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>PostGIS</strong> <strong>1.5.8</strong> <strong>Manual</strong>238 / 310Availability: 0.8.2, Z and M supported added in 1.1.1This function supports 3d and will not drop the z-index.ExamplesA linestring with the interpolated point at 20% position (0.20)--Return point 20% along 2d lineSELECT ST_AsEWKT(ST_Line_Interpolate_Point(the_line, 0.20))FROM (SELECT ST_GeomFromEWKT(’LINESTRING(25 50, 100 125, 150 190)’) as the_line) As foo;st_asewkt----------------POINT(51.5974135047432 76.5974135047432)--Return point mid-way of 3d lineSELECT ST_AsEWKT(ST_Line_Interpolate_Point(the_line, 0.5))FROM (SELECT ST_GeomFromEWKT(’LINESTRING(1 2 3, 4 5 6, 6 7 8)’) as the_line) As foo;st_asewkt--------------------POINT(3.5 4.5 5.5)--find closest point on a line to a point or other geometrySELECT 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)See AlsoST_AsText,ST_AsEWKT,ST_Length, ST_Line_Locate_Point

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!