Using Oracle’s ST_GEOMETRY type hierarchy with SDO_GEOMETRY: ST_PointN and ST_NumPoints

Oracle Spatial has, for many versions, made available an implementation of the OpenGIS SFS type hierarchy. Today I will show how to use this type hierarchy do extract points from an SDO_GEOMETRY. The first example extracts the first and last point from a linestring constructed from Well Known Text. The second example finds the firstRead More

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

Extracting Inner Rings Changed Ordinate Ordering: A Trap For Players Who Don’t Read Documentation!

In Developing Some Ideas For The Compression/Decompression Of Sdo_Geometry Objects, I Had Cause To Create Two PL/SQL Functions called Geocompress and Geodecompress. I Have Not Done This For A While And Slapped Myself When I Ran Into something I Should Have Known Would Arise, as I have seen it before, and because it is documentedRead More

Selecting all SDO_GTYPE values for all tables/sdo_geometry columns in a schema

A question was asked on the Oracle Technology Network Spatial forum: I am trying to select sdo_gtype from all tables in schema, i mean to execute same sql statement given below for entire schema. Any help on the usage of dynamic sql in PLSQL to execute select statement for all tables in the schema. HereRead More

Finding centre and radius of a circular geometry

Here is a method for finding the centre of a circle and its radius from a polygon (x003) sdo_geometry. Some examples: The SDO_UTIL.CIRCLE_POLYGON function is trickier because it generates 8307 longitude/latitude data. So the above function, based as it is on projected data, can only give us a basic approximation. The returned radius is goingRead More