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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>PostGIS</strong> <strong>1.5.8</strong> <strong>Manual</strong>134 / 310SELECT ST_AsText(ST_Segmentize(ST_GeomFromText(’POLYGON((-29 28, -30 40, -29 28))’),10));st_astext-----------------------POLYGON((-29 28,-29.8304547985374 37.9654575824488,-30 40,-29.1695452014626 ←↪30.0345424175512,-29 28))(1 row)See AlsoST_Line_Substring7.5.21 ST_SetPointST_SetPoint — Replace point N of linestring with given point. Index is 0-based.Synopsisgeometry ST_SetPoint(geometry linestring, integer zerobasedposition, geometry point);DescriptionReplace point N of linestring with given point. Index is 0-based. This is especially useful in triggers when trying to maintainrelationship of joints when one vertex moves.Availability: 1.1.0This function supports 3d and will not drop the z-index.Examples--Change first point in line string from -1 3 to -1 1SELECT ST_AsText(ST_SetPoint(’LINESTRING(-1 2,-1 3)’, 0, ’POINT(-1 1)’));st_astext-----------------------LINESTRING(-1 1,-1 3)---Change last point in a line string (lets play with 3d linestring this time)SELECT ST_AsEWKT(ST_SetPoint(foo.the_geom, ST_NumPoints(foo.the_geom) - 1, ST_GeomFromEWKT ←↪(’POINT(-1 1 3)’)))FROM (SELECT ST_GeomFromEWKT(’LINESTRING(-1 2 3,-1 3 4, 5 6 7)’) As the_geom) As foo;st_asewkt-----------------------LINESTRING(-1 2 3,-1 3 4,-1 1 3)See AlsoST_AddPoint,ST_NPoints, ST_NumPoints, ST_PointN, ST_RemovePoint7.5.22 ST_SetSRIDST_SetSRID — Sets the SRID on a geometry to a particular integer value.

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

Saved successfully!

Ooh no, something went wrong!