Noding and building a polygon from single, overlapping linestrings

The Spatial Companion 4 Oracle (SC4O) package (built using Java Topology Suite components) contains a method called ST_PolygonBuilder that can then form polygons from linestrings. However, ST_PolygonBuilder will not form polygons where it detects an unformed intersection: in this situation ST_PolygonBuilder has to be used with another SC4O method called ST_NodeLinestrings. ST_NodeLinestrings forms all intersectionsRead More

Some SDO_GEOMETRY/DIMINFO handling functions

While at my current contract employer, two functions were required to handle the conversion of DIMINFO SDO_LB/SDO_UB ranges to optimised rectangles (SDO_GEOMETRY) and the reverse. Note: GeoRaptor provides such capability for selected DIMINFO objects or to convert a map extent to its equivalent DIMINFO structure. The functions, written in PL/SQL are: ST_Diminfo2Rectangle ST_Geom2Diminfo The definitionRead More

Building Polygons from Incomplete Linestrings using ST_PolygonBuilder

The ST_PolygonBuilder function in the Spatial Companion for Oracle (SC4O) package provides a mechanism via which linestring can be compiled into polygons. I have given some simple examples in a post I made a few years ago. I will now give a much more complex example that I wrote in response to a request onRead More

Intersecting two aggregated polygon layers with SC4O

Someone downloaded my Spatial Companion for Oracle (SC4O) package the other day, then asked asked the following question(s): I have to calculate the intersection between two regions on a map. Each region is represented in the db as a >column in different tables. For now I have two columns of polygons one with 1500 entriesRead More

Generating a Grid (fishnet) of points or polygons for PostGIS

I wrote an article on Gridding a PostGIS Geometry object a while back. I had cause, recently, to use a variation on this for the generation of an array of point objects for a geometry polygon, so I wrote a version that also allows for the generation of a grid of polygons or points dependingRead More

Rounding Coordinates or Ordinates in SDO_GEOMETRY

Often Oracle Locator/Spatial users want to know how to round the individual ordinates of the coordinates of an sdo_geometry. This article shows how this can be done. Background Oracle imposes no precision limit on the NUMBER that records an ordinate of a coordinate except that imposed by the NUMBER datatype itself. Also, while one associatesRead More

STScale: Function to Scale a geometry object

Here is a simple scaling function for use with SQL Server Spatial’s geometry data type. Now some tests. Results sType geomWKT Scaled2D LINESTRING (0.5 1.5 3, 0.5 0.75 1) Original LINESTRING (1 2 3, 1 1 1) Results sType geomWKT Scaled3D LINESTRING (0.5 1.5 2.4, 0.5 0.75 0.8) Original LINESTRING (1 2 3, 1 1Read More

Creating linestrings from points

UPDATED: Fix in Order By and addition of second example. Here are some examples of how to construct linestrings from points stored in tables in two different formats. XYZ Values in SDO_POINT of SDO_GEOMETRY object The following example creates SDO_GEOMETRY point objects (2D) and stores them in a table linepoints. These points described individual featuresRead More