PLSQL ST_AsEWKT and ST_FromWKT Functions For Oracle (any version)

Previously I created the following Java stored procedures to enable the import/export of ZM aware WKT. ST_GeomFromText ST_GeomFromEWKT ST_AsText ST_AsEWKT These functions are necessary if one wishes to exchange geometry data with users of other databases that support WKT functions for 2D, 3D or 4D (ZM). For example, PostGIS supports the EWKT format and providesRead More

Convert Single Geometry to Multi-part Geometry in Oracle Spatial

Oracle allows single part and multipart geometry objects to existing in a single SDO_GEOMETRY column. For example, a polygon and a multipolygon. This is because the SDO_GEOMETRY object type is singly inherited. (This also means that a single column can also hold geometries from different geometry types eg points, lines and polygons: common in CADRead More

Optimized Rectangle to 5 Point Polygon

Here is a function that takes a any polygon whose elements are defined by an optimized rectangle and converts all elements to 5 vertex polygons. Polygon may be multi; may have non-optimized rectangle components. Does NOT process geometries with compound elements. Now let’s test the function: Results are as follows: DESCRIPTION VALIDORIGINALGEOM VGEOM POLY SingleRead 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

Create Polygons and Linestrings From Bearings And Distances (COGO)

UPDATE The original functions have been modified and deployed via my Oracle Object code. They original code is no longer available. My COordinate GeOmetry (COGO) package has been around for a long time. What I had not done was use the power of this package to construct polygons (2003) or linestrings (2002) from a startingRead 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