How to calculate cumulative length of a linestring, or the truck tonnage that accumulates across a set of roads

This articles describes how to compute the cumulative length of a single linestring, or the total tonnage that crosses a set road segments.

Identifying Quadrilateral Polygon Geometries in SQL Server Spatial

In some situations Quadrilateral polygon geometries in SQL Server Spatial can affect processing results. The best example of this is the identification of CircularStrings in polygon geometries. If quadrilateral objects are not identified, they end up being incorrectly converted. This function helps identify such polygon objects.

Simple Implementation Of Travelling Salesman Problem

UPDATE: This function is now a part of the Oracle Object implementation. The Travelling Salesman is a well known problem in graph theory: The Travelling Salesman Problem describes a salesman who must travel between N cities. The order in which he does so is something he does not care about, as long as he visitsRead More

Playing around with Centroids by using different seed values

The CENTROID package that I make available for free exposes a function for generating centroids of polygon (or area) objects. Here is the function: If you call the function with its defaults, the p_method parameter will be 1. For this value, the code determines the X ordinate extent of the polygon’s MBR, and selects theRead More

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

ST_VertexN / ST_PointN – Extracting a specific point from any geometry

I have published a number of times and implementation of functions what would extract a specific point from any geometry object. These appear in my LINEAR PL/SQL package and the T_GEOMETRY object that was published as part of the PACT book I wrote with Dr Siva Ravada. When working for a customer recently I hadRead More

Aggregate APPEND Islands and XOR polygons

For those not on 12cR1, or even perhaps if you are, the following two requirements came about at a customer site recently. Aggregate Append At that site (running 11gR2), there arose a need to aggregate all the islands of Australia into a single multi-polygon sdo_geometry. The first approach was to use SDO_AGGR_UNION (the customer isRead More