Even old dogs like me forget things and have to learn them again. You know, I am sure that I knew that SDO_GEOM.RELATE was a Spatial licensed feature and not available in Locator, but I clean forgot until a situation with a customer required me to look at an alternative.
The reason is because this customer is trying to reduce their Oracle license costs (as part of a future migration to SQL Server) by dropping their Enterprise license and going back to Standard Edition. As part of this, an audit of Spatial feature usage showed that a limited number of functions were being used eg SDO_UNION and one or two SDO_LRS functions but what I had forgotten about was the use of SDO_GEOM.RELATE.
Now my SC4O wrapper over the Java Topology Suite 1.12 has been a great success but did not include a replacement for RELATE. Dipping in to the JTS toolkit I have found, and now exposed, the relevant components to be able to release a “replacement” for SDO_GEOM.RELATE.
I put “replacement” in inverted commas as it does not replace SDO_GEOM.RELATE exactly as it is implemented. To do so would require another 3 or 4 days work or testing but I can see little value in doing so. If anyone is interested in what this work might entail please contact me.
Anyway, here is the SC4O function wrapper:
* Implements a license free version of sdo_geom.RELATE.
* @note Supports JTS named topological relationships and not Oracle specific keywords like OVERLAPBDYDISJOINT
* @param p_geom1 : sdo_geometry : geometry which will be compared to second
* @param p_mask : varchar2 : Mask containing DETERMINE, ANYINTERACT or a list of comma separated topological relationships
* @param p_geom2 : sdo_geometry : geometry which will be compared to first.
* @param p_precision : number of decimal places of precision of a geometry
* @return String : Result of processing
* @throws SQLException
* @history Simon Greener, November 2011, Original coding.