ST_Azimuth for Oracle: AKA Cogo.Bearing

Many years ago I wrote a Coordinate Geometry (COGO) package for Oracle Sdo_Geometry that contained a Bearing function that, given two points, would return the angle in radians from the horizontal of the vector defined by point A and B. PostGIS has a similar function called “ST_Azimuth”:http://postgis.refractions.net/documentation/manual-svn/ST_Azimuth.html. Here are the relevant declarations of the BearingRead More

Implementing a Translate/ST_Translate/Move function for Oracle Spatial

Many years ago I wrote a PL/SQL function to move any sdo_geometry when supplied a “delta” in terms of deltaX, deltaY and optionally deltaZ. This function also allowed a user to supply an envelope, box or minimum bounding rectangle (MBR) to the function so that only those vertices that lie within an sdo_geometry object wouldRead More

Elem_Info_Array Processing: An alternative to SDO_UTIL.GetNumRings and querying SDO_ELEM_INFO itself

This article is in two parts: 1) on SDO_UTIL.GetNumRings; 2) and an outline of a function to return the element info array in its normalised form. 1. SDO_UTIL.GETNUMRINGS Oracle Spatial, well at release 10g, has an undocumented function in the SDO_UTIL package called GetNumRings. This function takes a polygon geometry object and returns the numberRead More

Minumum Bounding Rectangle (MBR) Object Type for Oracle

Many years ago I wrote a “comprehensive” Minimum Bounding Rectangle (MBR) Object type for Oracle. This provides a lot fo the functionality of the BOX operators for PostGIS. Here is the public interface of the MBR type: Follow the link to download the full implementation of my MBR type for Oracle. An example of theRead More

How to extract elements from the result of an sdo_intersection of two polygons.

This article is about how three things: 1. The fact that the intersection between two polygon (area) can be a combination of points, lines and polygons (a Collection sdo_geometry object). 2. Shows you how to extract a particular object type, in this case a polygon, from a mixed collection that results from an geospatial intersection. 3.Read More