Free Aggregate Method for Concatenating 2D Lines in Oracle Locator 10g

The SDO_AGGR_CONCAT_LINES function in Oracle 10g and above allows for linestrings to be concatenated via GROUP BY SQL clauses. However, this function is only available for Spatial users on Enterprise Edition of the Oracle database 10g (it can be used on 11g). Locator users can, however, use the mdsys.sdo_util.concat_lines function to append two linestrings together.Read More

Reducing 5 Vertex Polygon to Optimized Rectangle

I had occasion to convert a set of 5 vertex polygons that defined grid squares to their optimized rectangle equivalent. To do this I created a simple function as follows. Which can then used as follows: Update On the basis of the excellent comments made by Farid Cheraghi, I have included his rectangle check (whichRead More

SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT – 13356 Issues

I have been doing a lot of work recently with processing the errors reported by Oracle’s MDSYS.SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT function. The results that are output from this function are not well documented with some outputs only being discovered by having bad geometries that generate those errors! But it was interesting for me to note that the functionRead More

Valid conversion unit values for Oracle sdo_geom.sdo_length()

The SDO_LENGTH function within SDO_GEOM package can be called with an optional unit parameter as in the following call signature: But what are a valid list of values for the unit parameter? For a start, if the SDO_GEOMETRY has a NULL SDO_SRID value then the unit parameter can’t be used at all! For other cases,Read More

COGO: Converting (Google Earth) Formatted Longitude/Latitude points to decimal degrees (SQL Server)

In an article on Oracle I described how to convert Google Earth textual representations of a longitude or latitude value to its decimal equivalent. Here is a version that will work with SQL Server 2008/2012 Spatial. And here are a few examples. Result DD -43.0138888888889 43.5126388888889 147.841833333333 -65.1701666666667 I hope this is of use toRead More

COGO: Convert Degrees, Minutes and Seconds values to Decimal Degrees

Sometimes data is provided to spatial databases via spreadsheets or other database tables in the form of degrees, minutes and seconds values. For example, data may come like this: Degree Minute Seconds 45 30 30.0 Which then need converting to a single decimal degree floating point value for use as an ordinate in a spatialRead More

COGO: Convert DMS String to decimal degrees floating point number.

In my article on DD2DMS I outlined how to convert a latitude or longitude as a decimal degrees value to a formatted string. This article describes a function, DMS2DD that reverses those values back to a single decimal degree value. Note that I have a schema call cogo in which I create functions like this.Read More