STLineToCurve. A Function that Converts a LineString to a CircularString, CompoundCurve or CurvePolygon.

The STLineToCurve function analyses a LineString looking for CircularString elements among its vertices (often LineStrings are created from curve elements by “stroking” especially where the processing software does not support CircularStrings). Any constructed CircularStrings are combined with other LineStrings to create CompoundCurves or CurvePolygons.

STFlipVectors: Normalize direction of linestring vectors

In the past I have found use for the ability to “flip” vectors in a polygon in order to provide an independent check on the topological integrity of planar enforced polygons. What I mean by topological integrity is that there are no gaps or overlaps between adjacent polygons. A simple method for doing this reliesRead More

STConvertToLineString: Extract LineStrings in GeometryCollection to create LineString

I had need today to create a function that extracts all linestring elements from a GeometryCollection and returns a LineString or a MultiLineString. The function is called STConvertToLineString as is described as follows: Its documentation can be seen see here. Here are some examples of how to use it: I hope this function is ofRead More

STExtractPolygon: Extract Polygons from result of STIntersection in SQL Server Spatial

Oracle customers have asked me for help in the past dealing with compound objects or collections that result from thinning or geoprocessing (intersection etc) of geometry data. Normally this is the need to extract only polygons from the result of an intersection operation. This problem applies to SQL Server Spatial users are the following exampleRead More

STExtract: Extract elements of a geometry object

Of the functions I have written for Oracle, those that allow me to extract (sub)elements of compound (objects consisting of linestrings and circular arcs) and multipart geometries have found use time and time again in such activities as: Filtering Rings of Polygons; Extracting homogeneous objects (eg point, line or polygon) from geometry collections. This articleRead More

STNumRings: Counting number of polygon rings

Here is an “ease of use” function that allows you to count the number of rings of a polygon or multipolygon geometry object in SQL Server Spatial. Some tests. Resulting in: gtype numRings Point 0 MultiPoint 0 LineString 0 MultiLineString 0 Polygon Outer 1 Polygon 3 MultiPolygon 5 CurvePolygon 1 GeometryCollection 1 I hope thisRead More

STFilterRings: Removing rings from Polygon based on area.

A function that have found use in Oracle and PostGIS is one that allows a user to filter out the rings of a polygon or multipolygon based on area. Here is presented a function to do this in SQL Server Spatial. This function requires Denali (2012) as it uses unionAggregate. In addition, the function requiresRead More

Detecting sdo_geometries with compound (3-point Arcs) segments

Often I have need to know if the linestrings describing an sdo_geometry line or polygon object contain 3-point arc segments or elements. If a linestring or polygon is described by, or contains, 3-point circular arc elements when: Its sdo_interpretation field in the sdo_elem_info array will contain the values 2 or 4 Or its sdo_etype isRead More