Constraining geometry type for sdo_geometry column in a table.

Other blog postings of mine have shown how the layer_gtype keyword in the PARAMETERS clause of an RTree spatial index can be used to constrain the sdo_geometry type being stored in a column. Remember, SDO_GEOMETRY is singly inherited: there is no POINT, CURVE, POLYGON etc sub-type. For this one must use the SQL/MM Type shippedRead More

The Power of Constraints and Indexes for Spatial Constraints: stopping duplicate points

Over on Technet , the following question was asked: My question is, can you think of a way to recognize situations like this and merge and store them in a table before, we attempt mapping and spatial queries are performed? The following database level approach is one approach for ensuring any loader doesn’t load duplicateRead More

CENTROID package use with ESRI’s sde.st_geometry

I have been emailed by someone who is using ESRI’s sde.st_geometry in preference to Oracle’s SDO_GEOMETRY or ST_GEOMETRY for their spatial data storage in Oracle, wanting a version of my CENTROID pl/sql package that would allow for its use with ESRI’s spatial data type. This is what I was asked: First off love your blog,Read More

CENTROID Package now returns centroid of multi-linestring

My original CENTROID package’s sdo_centroid() functions, when supplied with a multilinestring sdo_geometry, would “explode” the multilinestring into its component linestrings and calculate the centroid (mid-point) of the largest linestring. Some users have asked for the centroid package to return the centroid (midpoint) of the whole multilinestring. While the LINEAR package can do this, I haveRead More

Replacement for SDO_GEOM.RELATE – ST_Relate based on JTS

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 thisRead More

Changing Oracle Spatial Index Parameters on existing index

I received a question from a respected colleague: Can the parameters of a spatial index be altered? I created several dozen spatial indexes with a layer_gtype of polygon, I now have a requirement to modify them to be multipolygon…. My colleague wishes to do this without dropping the existing index. The answer to this isRead More

Writing Excel Spreadsheets files from within the Oracle database using Java and PL/SQL

My EXPORTER package + Java code has functions called WriteExcelSpreadsheet that can be used to create and export any SQL SELECT statement to disk as an Excel Spreadsheet using Oracle database’s DBMS_JOB or DBMS_SCHEDULER. Because Excel Spreadsheets have limited number of rows (65535) and columns (255) per sheet (the maximum size of data in aRead More