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.

PostGIS: Creating a line inside a polygon

I love working with the PostGIS API. It is a deep and wide river to swim in. But sometime having read, researched, experimented, and not found the right solution one can be forced to roll one’s own so to speak to get the job done. For the problem below, if someone can point out aRead More

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

Some Oriented Point Functions

A reader asked me for some help constructing and querying oriented points a few months back. The functions I created for him were one to create an oriented point from an normal point and a supplied whole circle bearing (0-360 degrees); the other was one that, given an oriented point, computed what they orientation angleRead 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