Home    |    Concepts   |   API   |   Samples
Concepts > Geometry > Shapes
Transformations

Transformation functions generate new geometry using existing geometry and a formula.
Note: Function references are for the SQL API.

Buffering geometry

The ST_Buffer function generates a geometry by encircling a geometry at a specified distance. A single polygon results when a primary geometry is buffered or when the buffer polygons of a collection are close enough to overlap. When enough separation exists between the elements of a buffered collection, individual buffer polygons will result in a multipolygon.

The ST_Buffer function accepts both positive and negative distances, but only geometries with a dimension of 2 (polygons and multipolygons) can apply a negative buffer. The absolute value of the buffer distance is used when the dimension of the source geometry is less than 2 (all geometries that are neither polygon nor multipolygon). Generally speaking, positive buffer distances generate polygon rings away from the center of the source geometry, and for the exterior ring of a polygon or multipolygon, toward the center when the distance is negative. For interior rings of a polygon or multipolygon, the buffer ring is toward the center when the buffer distance is positive and away from the center when it is negative.

The buffering process merges polygons that overlap. Negative distances greater than one-half the maximum interior width of a polygon result in an empty geometry.

Buffer generates a polygon or a multipolygon surrounding a given geometry at a specified radius.

SE_LocateAlong

Top

For geometries that have measures, the location of a particular measure can be found with the SE_LocateAlong function. SE_LocateAlong returns the location as a multipoint. If the source geometry's dimension is 0 (i.e., point and multipoint), only points with a matching measure value are returned as a multipoint. However, for source geometries whose dimension is greater than 0, the location is interpolated. For example, if the requested measure value is 5.5 and a linestring's vertices have measures of 3, 4, 5, 6, and 7, an interpolated point that falls exactly halfway between the vertices with measure values 5 and 6 is returned.

ST_LocateAlong locates a point on a linestring by interpolating the given measure value, if necessary. In this case, a point with measure 5.5 is interpolated halfway between the vertices of the linestring with measures 5 and 6. For multipoints, an exact match is required. In the case of the above multipoint geometry, locatealong returns the point that has measure 5.5.

SE_Locatebetween

Top

The SE_LocateBetween function returns the set of paths or locations that lie between two measure values from a source geometry that has measures. If the source geometry's dimension is 0, SE_LocateBetween returns a multipoint consisting of all points whose measures lie between the two source measures. For source geometries whose dimension is greater than 0, SE_LocateBetween returns a multilinestring if a path can be interpolated; otherwise, SE_LocateBetween returns a multipoint containing the point locations. An empty point is returned whenever SE_LocateBetween cannot interpolate a path or find a location between the measures. SE_LocateBetween performs an inclusive search of the geometries; therefore, the geometries' measures must be greater than or equal to the from measure and less than or equal to the to measure.

SE_LocateBetween returns a multilinestring that is between measures 4.3 and 6.9.

ST_ConvexHull

Top

The ST_ConvexHull function returns the convex hull polygon of any geometry that has at least three vertices forming a convex. If vertices of the geometry do not form a convex, convexhull returns a null. Creating a convex hull is often the first step when tessellating a set of points to create a triangulated irregular network (TIN).

ST_ConvexHull generates a polygon from the convex hull of three of the geometries pictured above. ST_ConvexHull returns a null for the two-point linestring because it does not form a convex hull.

Top

feedback | privacy | legal