Go to content Go to navigation and search

Home

Free Software Download

Download Code, Packages and Installers

Object Documentation

Package Documentation

CENTROID
COGO
EXPORTER
GEOM
KML
NETWORK
SDO_ERROR
Spatial Companion For Oracle (SC4O)
TOOLS

Articles

    New versions of LINEAR, CENTROID and GEOM etc packages
    TESSELATE and CENTROID package updates
    Applying and Extending Oracle Spatial: Source Code Problem
    CENTROID package use with ESRI's sde.st_geometry
    Changes to CENTROID and TESSELATE packages
    CENTROID Package now returns centroid of multi-linestring
    New versions of PL/SQL packages uploaded
    New Release of Free PL/SQL Packages
    New version of PL/SQL packages released
    New Version PL/SQL Spatial packages released
    New PL/SQL Package Upload
    PL/SQL Spatial Types and Packages
    Update to PL/SQL Packages
    New PL/SQL Packages
    VB6 Oracle Spatial or Locator OO4O code
    Spatial PL/SQL Packages by Example
    Catalog Registry Tool
    Image Catalog Tool
    Oracle Spatial PL/SQL and VB6 Source Code


Search

Browse

RSS / Atom

Email me

textpattern

Creative Commons License
All Blog Articles, Data Models and Free Source Code by Simon Greener, The SpatialDB Advisor is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Spatial Companion For Oracle (SC4O)

Friday March 09 2012 at 03:33

KeywordsOracle JTS ST_Union ST_Intersection ST_Difference ST_XOR ST_Buffer ST_Area ST_Length ST_HausdorffSimilarityMeasure ST_AreaSimilarityMeasure ST_MinimumBoundingCircle ST_Densify ST_CoordinateRounder ST_Snap ST_SnapTo ST_SnapToSelf ST_Relate ST_Centroid ST_C
Summary

This article presents the Package Header for my Spatial Companion For Oracle (Sc4o) library of useful “extension” Java Topology Suite based functions can are deployed within the Oracle database’s Java Virtual Machine.

The following package requires the appropriate JAR files to be loaded into the Oracle database JVM. All the required files and installation instructions are available from the package download page. Fill in and submit the form to get access the actual download links.

This package provides access to a bunch of JTS and JASPA functions:

These functions work with point, line and polygon data, except for:

  • ST_PolygonBuilder

which will build polygons from input linestrings (in a resultset).

In addition, there a bunch of aggregate functions (not exposed as Oracle aggregates like sdo_aggr_union due to Oracle sort memory problems):

  • ST_AggrUnionPolygons (implements cascaded union for polygons)
  • ST_AggrUnionMixed (for points, lines or mixed input)

Note that in the package below an additional function is provided with a p_srid parameter. This is because the Java Topology Suite (v 1.12) libraries do not support geodetic/geographic (long/lat) data. If you use the second form, provide the srid of a projected coordinate system in which the actual geoprocessing will occur. The function transforms the supplied geodetic data into that projection, executes the computation, and then transforms the result back to the sdo_srid of p_geom1.

  1. define defaultSchema='&1'
  2. WHENEVER SQLERROR EXIT FAILURE;
  3. CREATE OR REPLACE
  4. package SC4O
  5. AUTHID CURRENT_USER
  6. AS
  7.   TYPE refcur_t IS REF Cursor;  -- SYS_REFCURSOR can also be used
  8.   -- For Buffer, some constants
  9.   --
  10.   CAP_ROUND  CONSTANT NUMBER := 1;
  11.   CAP_BUTT   CONSTANT NUMBER := 2;
  12.   CAP_SQUARE CONSTANT NUMBER := 3;
  13.   JOIN_ROUND CONSTANT NUMBER := 1;
  14.   JOIN_MITRE CONSTANT NUMBER := 2;
  15.   JOIN_BEVEL CONSTANT NUMBER := 3;
  16.   QUADRANT_SEGMENTS CONSTANT NUMBER := 8;
  17.   /** ============================ PROPERTIES ==================================== **/
  18.   /**
  19.   * ST_Area
  20.   * Computes area of supplied geometry.
  21.   *
  22.   * @param p_geom        : sdo_geometry : geometry subject to area calculation
  23.   * @param p_precision   : int : number of decimal places of precision when comparing ordinates.
  24.   * @return number       : Area of geometry
  25.   * @history    : Simon Greener, September 2011, Original Coding
  26.   * @copyright  : Simon Greener, 2011-2013
  27.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  28.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  29.   */
  30.   FUNCTION ST_Area(p_geom      IN mdsys.sdo_geometry,
  31.                    p_precision IN NUMBER)
  32.     RETURN NUMBER
  33.            Deterministic;
  34.   /**
  35.   * ST_Area
  36.   * Computes area of supplied geodetic geometry.
  37.   * Computations occur in projected space described by p_srid parameter.
  38.   *
  39.   * @param p_geom        : sdo_geometry : geometry subject to area calculation
  40.   * @param p_precision   : int : number of decimal places of precision when comparing ordinates.
  41.   * @param p_srid        : int : SRID of projected space in which actual overlay occurs before
  42.   *                              being projected back to p_geom1.sdo_srid.
  43.   * @return number       : Area of geometry
  44.   * @history    : Simon Greener, September 2011, Original Coding
  45.   * @copyright  : Simon Greener, 2011-2013
  46.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  47.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  48.   */
  49.   FUNCTION ST_Area(p_geom      IN mdsys.sdo_geometry,
  50.                    p_precision IN NUMBER,
  51.                    p_srid      IN NUMBER)
  52.     RETURN NUMBER
  53.            Deterministic;
  54.   /**
  55.   * ST_Length
  56.   * Computes Length of supplied geometry.
  57.   *
  58.   * @param p_geom        : sdo_geometry : geometry subject to Length calculation
  59.   * @param p_precision   : int : number of decimal places of precision when comparing ordinates.
  60.   * @return  number      : Length of geometry
  61.   * @history    : Simon Greener, September 2011, Original Coding
  62.   * @copyright  : Simon Greener, 2011-2013
  63.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  64.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  65.   */
  66.   FUNCTION ST_Length(p_geom      IN mdsys.sdo_geometry,
  67.                      p_precision IN NUMBER)
  68.     RETURN NUMBER
  69.            Deterministic;
  70.   /**
  71.   * ST_Length
  72.   * Computes Length of supplied geodetic geometry.
  73.   * Computations occur in projected space described by p_srid parameter.
  74.   *
  75.   * @param p_geom        : sdo_geometry : geometry subject to Length calculation
  76.   * @param p_precision   : int : number of decimal places of precision when comparing ordinates.
  77.   * @param p_srid        : int : SRID of projected space in which actual overlay occurs before
  78.   *                              being projected back to p_geom1.sdo_srid.
  79.   * @return number       : Length of geometry
  80.   * @history    : Simon Greener, September 2011, Original Coding
  81.   * @copyright  : Simon Greener, 2011-2013
  82.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  83.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  84.   */
  85.   FUNCTION ST_Length(p_geom      IN mdsys.sdo_geometry,
  86.                      p_precision IN NUMBER,
  87.                      p_srid      IN NUMBER)
  88.     RETURN NUMBER
  89.            Deterministic;
  90.   /**
  91.   * ST_Envelope
  92.   * Method for getting MBR or envelope of a geometry object
  93.   *
  94.   * @param p_geom   : sdo_geometry : sdo_geometry object
  95.   * @param p_precision   : int : number of decimal places of precision when comparing ordinates.
  96.   * @return SDO_GEOMETRY : MBR as Polygon
  97.   * @history    : Simon Greener, January 2012, Original Coding
  98.   * @copyright  : Simon Greener, 2011-2013
  99.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  100.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  101.   */
  102.   FUNCTION ST_Envelope(p_geom      IN mdsys.sdo_geometry,
  103.                        p_precision IN NUMBER)
  104.     RETURN mdsys.sdo_geometry
  105.            deterministic;
  106.   /**
  107.   * ST_MakeEnvelope
  108.   * Method for turning an MBR or envelope into a geometry object (polygon mainly)
  109.   *
  110.   * @param p_minx        : number : minimum x ordinate of MBR
  111.   * @param p_miny        : number : minimum y ordinate of MBR
  112.   * @param p_maxx        : number : maximum x ordinate of MBR
  113.   * @param p_maxx        : number : maximum y ordinate of MBR
  114.   * @param p_srid        : pls_integer : srid of returned geometry
  115.   * @param p_precision   : pls_integer : number of decimal places of precision when comparing ordinates.
  116.   * @return SDO_GEOMETRY : MBR as Polygon
  117.   * @history    : Simon Greener, March 2012, Original Coding
  118.   * @copyright  : Simon Greener, 2011-2013
  119.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  120.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  121.   */
  122.   FUNCTION ST_MakeEnvelope(p_minx IN NUMBER, p_miny IN NUMBER,
  123.                            p_maxx IN NUMBER, p_maxy IN NUMBER,
  124.                            p_srid IN pls_integer,
  125.                            p_precision IN pls_integer)
  126.     RETURN mdsys.sdo_geometry Deterministic;
  127.   FUNCTION ST_IsValid(p_geom  IN mdsys.sdo_geometry )
  128.     RETURN varchar2 Deterministic;
  129.   FUNCTION ST_IsSimple(p_geom IN mdsys.sdo_geometry )
  130.     RETURN varchar2 Deterministic;
  131.   FUNCTION ST_Dimension(p_geom IN mdsys.sdo_geometry)
  132.     RETURN varchar2 Deterministic;
  133.   FUNCTION ST_CoordDim(p_geom IN mdsys.sdo_geometry)
  134.     RETURN varchar2 Deterministic;
  135.   /** ========================== OVERLAY ======================== **/
  136.   /**
  137.   * ST_Union
  138.   * Unions two geometries together using suppied p_precision to compare coordinates.
  139.   *
  140.   * @param p_geom1       : sdo_geometry : first geometry subject to overlay action
  141.   * @param p_geom2       : sdo_geometry : second geometry subject to overlay action
  142.   * @param p_precision   : int : number of decimal places of precision when comparing ordinates.
  143.   * @param p_distanceTolerance : Number : Optional maximum distance difference (see ST_TopologyPreservingSimplify)
  144.   *                                       for use with simplifying the resultant geometry. Enter 0.0 for no simplification.
  145.   * @return SDO_GEOMETRY : Result of Union
  146.   * @history    : Simon Greener, August 2011, Original Coding
  147.   * @copyright  : Simon Greener, 2011-2013
  148.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  149.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  150.   */
  151.   FUNCTION ST_Union(p_geom1             IN mdsys.sdo_geometry,
  152.                     p_geom2             IN mdsys.sdo_geometry,
  153.                     p_precision         IN NUMBER)
  154.     RETURN mdsys.sdo_geometry
  155.            Deterministic;
  156.   /**
  157.   * ST_Union
  158.   * Unions two geodetic geometries together using suppied p_precision to compare coordinates.
  159.   * Computations occur in projected space described by p_srid parameter.
  160.   *
  161.   * @param p_geom1       : sdo_geometry : first geometry subject to overlay action
  162.   * @param p_geom2       : sdo_geometry : second geometry subject to overlay action
  163.   * @param p_precision   : int : number of decimal places of precision when comparing ordinates.
  164.   * @param p_srid        : int : SRID of projected space in which actual overlay occurs before
  165.   *                              being projected back to p_geom1.sdo_srid.
  166.   * @return SDO_GEOMETRY : Result of Union
  167.   * @history    : Simon Greener, August 2011, Original Coding
  168.   * @copyright  : Simon Greener, 2011-2013
  169.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  170.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  171.   */
  172.   FUNCTION ST_Union(p_geom1             IN mdsys.sdo_geometry,
  173.                     p_geom2             IN mdsys.sdo_geometry,
  174.                     p_precision         IN NUMBER,
  175.                     p_srid              IN NUMBER)
  176.     RETURN mdsys.sdo_geometry
  177.            Deterministic;
  178.   /**
  179.   * ST_AggrUnionPolygons
  180.   * Unions a set of sdo_geometry polygons.
  181.   *
  182.   * @param      : p_geomset     : sdo_geometry_array : Collection of SDO_GEOMETRY polygon objects.
  183.   * @param      : p_precision   : int : number of decimal places of precision when comparing ordinates.
  184.   * @param      : p_distanceTolerance : Number : Optional maximum distance difference (see ST_TopologyPreservingSimplify)
  185.   *                                       for use with simplifying the resultant geometry. Enter 0.0 for no simplification.
  186.   * @return     : SDO_GEOMETRY : Result of Union (single or multipolygon)
  187.   * @note       : The underlying JTS code uses planar arithmetic. For long/lat data it is highly recommended that
  188.   *               the geometries in p_geomset are projected into a suitable SRID before calling and then tranformed back
  189.   *               to the original SRID after processing. See example:
  190.   * @example    : select sdo_cs.transform(
  191.   *                        sc4o.ST_AggrUnionPolygons(CAST(COLLECT(sdo_cs.transform(a.geom,32630)) as mdsys.sdo_geometry_array),2,0.5),
  192.   *                        8307) as uGeom
  193.   *                 from provinces a;
  194.   * @history    : Simon Greener, August 2011, Original Coding
  195.   * @copyright  : Simon Greener, 2011-2013
  196.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  197.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  198.   */
  199.   FUNCTION ST_AggrUnionPolygons(p_geomset           IN mdsys.sdo_geometry_array,
  200.                                 p_precision         IN NUMBER,
  201.                                 p_distanceTolerance IN NUMBER)
  202.     RETURN mdsys.sdo_geometry
  203.            Deterministic;
  204.   /**
  205.   * ST_AggrUnionMixed
  206.   * Unions a set of sdo_geometry objects (can be mix of polygons, lines etc).
  207.   *
  208.   * @param      : p_geomset     : sdo_geometry_array : Collection of SDO_GEOMETRY objects.
  209.   * @param      : p_precision   : int : number of decimal places of precision when comparing ordinates.
  210.   * @param      : p_distanceTolerance : Number : Optional maximum distance difference (see ST_TopologyPreservingSimplify)
  211.   *                                       for use with simplifying the resultant geometry. Enter 0.0 for no simplification.
  212.   * @return     : SDO_GEOMETRY : Result of Union
  213.   * @note       : The underlying JTS code uses planar arithmetic. For long/lat data it is highly recommended that
  214.   *               the geometries in p_geomset are projected into a suitable SRID before calling and then tranformed back
  215.   *               to the original SRID after processing. See example:
  216.   * @example    : select sdo_cs.transform(
  217.   *                        sc4o.ST_AggrUnionMixed(CAST(COLLECT(sdo_cs.transform(a.geom,32630)) as mdsys.sdo_geometry_array),2,0.5),
  218.   *                        8307) as uGeom
  219.   *                 from provinces a;
  220.   * @history    : Simon Greener, August 2011, Original Coding
  221.   * @copyright  : Simon Greener, 2011-2013
  222.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  223.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  224.   */
  225.   FUNCTION ST_AggrUnionMixed(p_geomset           IN mdsys.sdo_geometry_array,
  226.                              p_precision         IN NUMBER,
  227.                              p_distanceTolerance IN NUMBER)
  228.     RETURN mdsys.sdo_geometry
  229.            Deterministic;
  230.  /**
  231.   * ST_AggrUnionPolygons
  232.   * Unions a result set of sdo_geometry polygons.
  233.   *
  234.   * @param      : p_resultSet   : SC4O.refcur_t or CURSOR : SQL statement defining a ref cursor collection of SDO_GEOMETRY polygon objects.
  235.   * @param      : p_precision   : int : number of decimal places of precision when comparing ordinates.
  236.   * @param      : p_distanceTolerance : Number : Optional maximum distance difference (see ST_TopologyPreservingSimplify)
  237.   *                                       for use with simplifying the resultant geometry. Enter 0.0 for no simplification.
  238.   * @return     : SDO_GEOMETRY : Result of Union (single or multipolygon)
  239.   * @note       : The underlying JTS code uses planar arithmetic. For long/lat data it is highly recommended that
  240.   *               the geometries in p_geomset are projected into a suitable SRID before calling and then tranformed back
  241.   *               to the original SRID after processing. See example:
  242.   * @example    : select sdo_cs.transform(
  243.   *                        sc4o.ST_AggrUnionPolygons(CURSOR(SELECT sdo_cs.transform(b.geom,32630) FROM provinces b),2,0.5),
  244.   *                        8307) as uGeom
  245.   *                 from provinces a;
  246.   * @history    : Simon Greener, August 2011, Original Coding
  247.   * @copyright  : Simon Greener, 2011-2013
  248.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  249.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  250.   */
  251.   FUNCTION ST_AggrUnionPolygons(p_resultSet         IN &&defaultSchema..SC4O.refcur_t,
  252.                                 p_precision         IN NUMBER,
  253.                                 p_distanceTolerance IN NUMBER)
  254.     RETURN mdsys.sdo_geometry
  255.            Deterministic;
  256.  /**
  257.   * ST_AggrUnionMixed
  258.   * Unions a result set of sdo_geometry objects (can be mix of polygons, lines etc).
  259.   *
  260.   * @param      : p_resultSet   : SC4O.refcur_t or CURSOR : SQL statement defining a ref cursor collection of SDO_GEOMETRY objects.
  261.   * @param      : p_precision   : int : number of decimal places of precision when comparing ordinates.
  262.   * @param      : p_distanceTolerance : Number : Optional maximum distance difference (see ST_TopologyPreservingSimplify)
  263.   *                                       for use with simplifying the resultant geometry. Enter 0.0 for no simplification.
  264.   * @return     : SDO_GEOMETRY : Result of Union
  265.   * @note       : The underlying JTS code uses planar arithmetic. For long/lat data it is highly recommended that
  266.   *               the geometries in p_geomset are projected into a suitable SRID before calling and then tranformed back
  267.   *               to the original SRID after processing. See example:
  268.   * @example    : select sdo_cs.transform(
  269.   *                        sc4o.ST_AggrUnionPolygons(CURSOR(SELECT sdo_cs.transform(b.geom,32630) FROM provinces b),2,0.5),
  270.   *                        8307) as uGeom
  271.   *                 from provinces a;
  272.   * @history    : Simon Greener, August 2011, Original Coding
  273.   * @copyright  : Simon Greener, 2011-2013
  274.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  275.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  276.   */
  277.   FUNCTION ST_AggrUnionMixed(p_resultSet         IN &&defaultSchema..SC4O.refcur_t,
  278.                              p_precision         IN NUMBER,
  279.                              p_distanceTolerance IN NUMBER)
  280.     RETURN mdsys.sdo_geometry
  281.            Deterministic;
  282.  /**
  283.   * ST_AggrUnionPolygons
  284.   * Unions all sdo_geometry polygon objects in a column of a database objects eg view/table etc.
  285.   *
  286.   * @param      : p_tableName   : varchar2 : name of existing table/view etc whose contents will be unioned.
  287.   * @param      : p_columnName  : varchar2 : Name of sdo_geometry column in p_tableName holding polygons for unioning.
  288.   * @param      : p_precision   : int : number of decimal places of precision when comparing ordinates.
  289.   * @param      : p_distanceTolerance : Number : Optional maximum distance difference (see ST_TopologyPreservingSimplify)
  290.   *                                       for use with simplifying the resultant geometry. Enter 0.0 for no simplification.
  291.   * @return     : SDO_GEOMETRY : Result of Union (single or multipolygon)
  292.   * @note       : The underlying JTS code uses planar arithmetic. For long/lat data it is highly recommended that
  293.   *               the geometries in p_geomset are projected into a suitable SRID before calling and then tranformed back
  294.   *               to the original SRID after processing. See example:
  295.   * @example    : select sdo_cs.transform(sc4o.ST_AggrUnionPolygons('PROVS32630','GEOM',2,0.5),8307) as uGeom
  296.   *                 from dual a;
  297.   * @history    : Simon Greener, August 2011, Original Coding
  298.   * @copyright  : Simon Greener, 2011-2013
  299.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  300.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  301.   */
  302.   FUNCTION ST_AggrUnionPolygons(p_tableName         IN varchar2,
  303.                                 p_columnName        IN varchar2,
  304.                                 p_precision         IN NUMBER,
  305.                                 p_distanceTolerance IN NUMBER)
  306.     RETURN mdsys.sdo_geometry
  307.            Deterministic;
  308.  /**
  309.   * ST_AggrUnionMixed
  310.   * Unions all sdo_geometry objects (can be mix of polygons, lines etc) in a column of a database object eg view/table etc.
  311.   *
  312.   * @param      : p_tableName   : varchar2 : name of existing table/view etc whose contents will be unioned.
  313.   * @param      : p_columnName  : varchar2 : Name of sdo_geometry column in p_tableName holding polygons for unioning.
  314.   * @param      : p_precision   : int : number of decimal places of precision when comparing ordinates.
  315.   * @param      : p_distanceTolerance : Number : Optional maximum distance difference (see ST_TopologyPreservingSimplify)
  316.   *                                       for use with simplifying the resultant geometry. Enter 0.0 for no simplification.
  317.   * @return     : SDO_GEOMETRY : Result of Union (single or multipolygon)
  318.   * @note       : The underlying JTS code uses planar arithmetic. For long/lat data it is highly recommended that
  319.   *               the geometries in p_geomset are projected into a suitable SRID before calling and then tranformed back
  320.   *               to the original SRID after processing. See example:
  321.   * @example    : select sdo_cs.transform(sc4o.ST_AggrUnionMixed('PROVS32630','GEOM',2,0.5),8307) as uGeom
  322.   *                 from dual a;
  323.   * @history    : Simon Greener, August 2011, Original Coding
  324.   * @copyright  : Simon Greener, 2011-2013
  325.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  326.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  327.   */
  328.   FUNCTION ST_AggrUnionMixed(p_tableName         IN varchar2,
  329.                              p_columnName        IN varchar2,
  330.                              p_precision         IN NUMBER,
  331.                              p_distanceTolerance IN NUMBER)
  332.     RETURN mdsys.sdo_geometry
  333.            Deterministic;
  334.   /**
  335.   * ST_Difference
  336.   * Computes difference between two geometries using suppied p_precision to compare coordinates.
  337.   *
  338.   * @param p_geom1       : sdo_geometry : first geometry subject to overlay action
  339.   * @param p_geom2       : sdo_geometry : second geometry subject to overlay action
  340.   * @param p_precision   : int : number of decimal places of precision when comparing ordinates.
  341.   * @return SDO_GEOMETRY : Result of Difference
  342.   * @history    : Simon Greener, August 2011, Original Coding
  343.   * @copyright  : Simon Greener, 2011-2013
  344.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  345.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  346.   */
  347.   FUNCTION ST_Difference(p_geom1     IN mdsys.sdo_geometry,
  348.                          p_geom2     IN mdsys.sdo_geometry,
  349.                          p_precision IN NUMBER)
  350.     RETURN mdsys.sdo_geometry
  351.            Deterministic;
  352.   /**
  353.   * ST_Difference
  354.   * Wrapper Function ST_that enables computation of geometry difference for geodetic (long/lat)
  355.   * geometries.  Computations occur in projected space described by p_srid parameter.
  356.   *
  357.   * @param p_geom1       : sdo_geometry : first geometry subject to overlay action
  358.   * @param p_geom2       : sdo_geometry : second geometry subject to overlay action
  359.   * @param p_precision   : int : number of decimal places of precision when comparing ordinates.
  360.   * @param p_srid        : int : SRID of projected space in which actual overlay occurs before
  361.   *                              being projected back to p_geom1.sdo_srid.
  362.   * @return SDO_GEOMETRY : Result of Difference
  363.   * @history    : Simon Greener, August 2011, Original Coding
  364.   * @copyright  : Simon Greener, 2011-2013
  365.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  366.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  367.   */
  368.   FUNCTION ST_Difference(p_geom1     IN mdsys.sdo_geometry,
  369.                          p_geom2     IN mdsys.sdo_geometry,
  370.                          p_precision IN NUMBER,
  371.                          p_srid      IN NUMBER)
  372.     RETURN mdsys.sdo_geometry
  373.            Deterministic;
  374.   /**
  375.   * ST_Intersection
  376.   * Computes intersection between two geometries using suppied p_precision to compare coordinates.
  377.   *
  378.   * @param p_geom1       : sdo_geometry : first geometry subject to overlay action
  379.   * @param p_geom2       : sdo_geometry : second geometry subject to overlay action
  380.   * @param p_precision   : int : number of decimal places of precision when comparing ordinates.
  381.   * @return SDO_GEOMETRY : Result of Intersection
  382.   * @history    : Simon Greener, August 2011, Original Coding
  383.   * @copyright  : Simon Greener, 2011-2013
  384.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  385.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  386.   */
  387.   FUNCTION ST_Intersection(p_geom1     IN mdsys.sdo_geometry,
  388.                            p_geom2     IN mdsys.sdo_geometry,
  389.                            p_precision IN NUMBER)
  390.     RETURN mdsys.sdo_geometry
  391.            Deterministic;
  392.   /**
  393.   * ST_Intersection
  394.   * Wrapper Function ST_that enables computation of geometry intersection for geodetic (long/lat)
  395.   * geometries.  Computations occur in projected space described by p_srid parameter.
  396.   *
  397.   * @param p_geom1       : sdo_geometry : first geometry subject to overlay action
  398.   * @param p_geom2       : sdo_geometry : second geometry subject to overlay action
  399.   * @param p_precision   : int : number of decimal places of precision when comparing ordinates.
  400.   * @param p_srid        : int : SRID of projected space in which actual overlay occurs before
  401.   *                              being projected back to p_geom1.sdo_srid.
  402.   * @return SDO_GEOMETRY : Result of Intersection
  403.   * @history    : Simon Greener, August 2011, Original Coding
  404.   * @copyright  : Simon Greener, 2011-2013
  405.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  406.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  407.   */
  408.   FUNCTION ST_Intersection(p_geom1     IN mdsys.sdo_geometry,
  409.                            p_geom2     IN mdsys.sdo_geometry,
  410.                            p_precision IN NUMBER,
  411.                            p_srid      IN NUMBER )
  412.     RETURN mdsys.sdo_geometry
  413.            Deterministic;
  414.   /**
  415.   * ST_Xor
  416.   * Computes xor between two geometries using suppied p_precision to compare coordinates.
  417.   *
  418.   * @param p_geom1       : sdo_geometry : first geometry subject to overlay action
  419.   * @param p_geom2       : sdo_geometry : second geometry subject to overlay action
  420.   * @param p_precision   : int : number of decimal places of precision when comparing ordinates.
  421.   * @return SDO_GEOMETRY : Result of Xor
  422.   * @history    : Simon Greener, August 2011, Original Coding
  423.   * @copyright  : Simon Greener, 2011-2013
  424.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  425.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  426.   */
  427.   FUNCTION ST_Xor(p_geom1     IN mdsys.sdo_geometry,
  428.                   p_geom2     IN mdsys.sdo_geometry,
  429.                   p_precision IN NUMBER)
  430.     RETURN mdsys.sdo_geometry
  431.            Deterministic;
  432.   /**
  433.   * ST_Xor
  434.   * Wrapper Function ST_that enables computation of geometry xor for geodetic (long/lat)
  435.   * geometries.  Computations occur in projected space described by p_srid parameter.
  436.   *
  437.   * @param p_geom1       : sdo_geometry : first geometry subject to overlay action
  438.   * @param p_geom2       : sdo_geometry : second geometry subject to overlay action
  439.   * @param p_precision   : int : number of decimal places of precision when comparing ordinates.
  440.   * @param p_srid        : int : SRID of projected space in which actual overlay occurs before
  441.   *                              being projected back to p_geom1.sdo_srid.
  442.   * @return SDO_GEOMETRY : Result of Xor
  443.   * @history    : Simon Greener, August 2011, Original Coding
  444.   * @copyright  : Simon Greener, 2011-2013
  445.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  446.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  447.   */
  448.   FUNCTION ST_Xor(p_geom1     IN mdsys.sdo_geometry,
  449.                   p_geom2     IN mdsys.sdo_geometry,
  450.                   p_precision IN NUMBER,
  451.                   p_srid      IN NUMBER)
  452.     RETURN mdsys.sdo_geometry
  453.            Deterministic;
  454.   /**
  455.   * ST_SymDifference (wrapper over Xor)
  456.   * Computes symbolic difference between two geometries using suppied p_precision to compare coordinates.
  457.   *
  458.   * @param p_geom1       : sdo_geometry : first geometry subject to overlay action
  459.   * @param p_geom2       : sdo_geometry : second geometry subject to overlay action
  460.   * @param p_precision   : int : number of decimal places of precision when comparing ordinates.
  461.   * @return SDO_GEOMETRY : Result of SymDifference
  462.   * @history    : Simon Greener, August 2011, Original Coding
  463.   * @copyright  : Simon Greener, 2011-2013
  464.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  465.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  466.   */
  467.   FUNCTION ST_SymDifference(p_geom1     IN mdsys.sdo_geometry,
  468.                             p_geom2     IN mdsys.sdo_geometry,
  469.                             p_precision IN NUMBER)
  470.     RETURN mdsys.sdo_geometry
  471.            Deterministic;
  472.   /**
  473.   * ST_SymDifference
  474.   * Wrapper Function ST_(over Xor) that enables computation of geometry symbolic difference for geodetic (long/lat)
  475.   * geometries.  Computations occur in projected space described by p_srid parameter.
  476.   *
  477.   * @param p_geom1       : sdo_geometry : first geometry subject to overlay action
  478.   * @param p_geom2       : sdo_geometry : second geometry subject to overlay action
  479.   * @param p_precision   : int : number of decimal places of precision when comparing ordinates.
  480.   * @param p_srid        : int : SRID of projected space in which actual overlay occurs before
  481.   *                              being projected back to p_geom1.sdo_srid.
  482.   * @return SDO_GEOMETRY : Result of SymDifference
  483.   * @history    : Simon Greener, August 2011, Original Coding
  484.   * @copyright  : Simon Greener, 2011-2013
  485.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  486.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  487.   */
  488.   FUNCTION ST_SymDifference(p_geom1     IN mdsys.sdo_geometry,
  489.                             p_geom2     IN mdsys.sdo_geometry,
  490.                             p_precision IN NUMBER,
  491.                             p_srid      IN NUMBER )
  492.     RETURN mdsys.sdo_geometry
  493.            Deterministic;
  494.   /** ================ Comparisons ================= */
  495.   /**
  496.   * ST_HausdorffSimilarityMeasure
  497.   * Measures the degree of similarity between two sdo_geometrys
  498.   * using JTS's Hausdorff distance metric.
  499.   * The measure is normalized to lie in the range [0, 1].
  500.   * Higher measures indicate a great degree of similarity.
  501.   * <p>
  502.   * The measure is computed by computing the Hausdorff distance
  503.   * between the input geometries, and then normalizing
  504.   * this by dividing it by the diagonal distance across
  505.   * the envelope of the combined geometries.
  506.   *
  507.   * @param p_geom1     : sdo_geometry : first geometry subject to comparison
  508.   * @param p_geom2     : sdo_geometry : second geometry subject to comparison
  509.   * @param p_precision : int : number of decimal places of precision
  510.   * @return     double : Result of comparison
  511.   * @history    : Simon Greener, August 2011, Original Coding
  512.   * @copyright  : Simon Greener, 2011-2013
  513.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  514.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  515.   **/
  516.   FUNCTION ST_HausdorffSimilarityMeasure(p_geom1     IN mdsys.sdo_geometry,
  517.                                          p_geom2     IN mdsys.sdo_geometry,
  518.                                          p_precision IN NUMBER)
  519.     RETURN NUMBER deterministic;
  520.   /**
  521.   * ST_HausdorffSimilarityMeasure
  522.   * Wrapper. Computations occur in projected space described by p_srid parameter.
  523.   *
  524.   * @param p_geom1     : sdo_geometry : first geometry subject to comparison
  525.   * @param p_geom2     : sdo_geometry : second geometry subject to comparison
  526.   * @param p_precision : int : number of decimal places of precision
  527.   * @param p_srid      : int : SRID of projected space in which actual overlay occurs before
  528.   *                            being projected back to p_geom1.sdo_srid.
  529.   * @return     double : Result of comparison
  530.   * @history    : Simon Greener, August 2011, Original Coding
  531.   * @copyright  : Simon Greener, 2011-2013
  532.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  533.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  534.   **/
  535.   FUNCTION ST_HausdorffSimilarityMeasure(p_geom1     IN mdsys.sdo_geometry,
  536.                                          p_geom2     IN mdsys.sdo_geometry,
  537.                                          p_precision IN NUMBER,
  538.                                          p_srid      IN NUMBER )
  539.     RETURN NUMBER deterministic;
  540.   /**
  541.   * ST_AreaSimilarityMeasure
  542.   * Measures the degree of similarity between two {@link Geometry}s
  543.   * using the area of intersection between the geometries.
  544.   * The measure is normalized to lie in the range [0, 1].
  545.   * Higher measures indicate a great degree of similarity.
  546.   * <p>
  547.   * NOTE: Currently experimental and incomplete.
  548.   *
  549.   * @param p_geom1     : sdo_geometry : first geometry subject to comparison
  550.   * @param p_geom2     : sdo_geometry : second geometry subject to comparison
  551.   * @param p_precision : int : number of decimal places of precision
  552.   * @return     double : Result of comparison
  553.   * @history    : Simon Greener, August 2011, Original Coding
  554.   * @copyright  : Simon Greener, 2011-2013
  555.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  556.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  557.   **/
  558.   FUNCTION ST_AreaSimilarityMeasure(p_poly1     IN mdsys.sdo_geometry,
  559.                                     p_poly2     IN mdsys.sdo_geometry,
  560.                                     p_precision IN NUMBER)
  561.     RETURN NUMBER deterministic;
  562.   /**
  563.   * ST_AreaSimilarityMeasure
  564.   * Wrapper. Computations occur in projected space described by p_srid parameter.
  565.   *
  566.   * @param p_geom1     : sdo_geometry : first geometry subject to comparison
  567.   * @param p_geom2     : sdo_geometry : second geometry subject to comparison
  568.   * @param p_precision : int : number of decimal places of precision
  569.   * @param p_srid      : int : SRID of projected space in which actual overlay occurs before
  570.   *                            being projected back to p_geom1.sdo_srid.
  571.   * @return     double : Result of comparison
  572.   * @history    : Simon Greener, August 2011, Original Coding
  573.   * @copyright  : Simon Greener, 2011-2013
  574.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  575.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  576.   **/
  577.   FUNCTION ST_AreaSimilarityMeasure(p_poly1     IN mdsys.sdo_geometry,
  578.                                     p_poly2     IN mdsys.sdo_geometry,
  579.                                     p_precision IN NUMBER,
  580.                                     p_srid      IN NUMBER )
  581.     RETURN NUMBER deterministic;
  582.   /**
  583.     * ST_Relate
  584.     * Implements a license free version of sdo_geom.RELATE.
  585.     * @note Supports JTS named topological relationships and not Oracle specific keywords like OVERLAPBDYDISJOINT
  586.     * @param p_geom1     : sdo_geometry : geometry which will be compared to second
  587.     * @param p_mask      : varchar2     : Mask containing DETERMINE, ANYINTERACT or a list of comma separated topological relationships
  588.     * @param p_geom2     : sdo_geometry : geometry which will be compared to first.
  589.     * @param p_precision : number of decimal places of precision of a geometry
  590.     * @return String     : Result of processing
  591.     * @throws SQLException
  592.     * @history    : Simon Greener, November 2011, Original Coding; March 2012 Improved return values.
  593.     * @copyright  : Simon Greener, 2011-2013
  594.     * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  595.     *               http://creativecommons.org/licenses/by-sa/2.5/au/
  596.     */
  597.   FUNCTION ST_Relate(p_geom1     IN mdsys.sdo_geometry,
  598.                      p_mask      IN varchar2,
  599.                      p_geom2     IN mdsys.sdo_geometry,
  600.                      p_precision IN NUMBER)
  601.     RETURN varchar2 Deterministic;
  602.   /**  ======================== PROCESSING ================== **/
  603.   /**
  604.   * ST_MinimumBoundingCircle
  605.   * Computes the Minimum Bounding Circle (MBC) for the points in a Geometry.
  606.   * The MBC is the smallest circle which contains all the input points (this
  607.   * is sometimes known as the Smallest Enclosing Circle). This is equivalent
  608.   * to computing the Maximum Diameter of the input point set.
  609.   * @param p_geom      : sdo_geometry : first geometry subject to MBC calculation
  610.   * @param p_precision : int : number of decimal places of precision
  611.   * @return  circle    : sdo_geometry : Result of MBC calculation
  612.   * @author Martin Davis, JTS 1.12
  613.   * @history    : Simon Greener, August 2011, Original Coding
  614.   * @copyright  : Simon Greener, 2011-2013
  615.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  616.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  617.   **/
  618.   FUNCTION ST_MinimumBoundingCircle(p_geom      IN mdsys.sdo_geometry,
  619.                                     p_precision IN NUMBER)
  620.     RETURN mdsys.sdo_geometry deterministic;
  621.   /**
  622.   * ST_MinimumBoundingCircle
  623.   * Computes the Minimum Bounding Circle (MBC) for the points in a Geometry.
  624.   * The MBC is the smallest circle which contains all the input points (this
  625.   * is sometimes known as the Smallest Enclosing Circle). This is equivalent
  626.   * to computing the Maximum Diameter of the input point set.
  627.   * @param p_geom      : sdo_geometry : first geometry subject to MBC calculation
  628.   * @param p_precision : int : number of decimal places of precision
  629.   * @param p_srid      : int : SRID of projected space in which actual overlay occurs before
  630.   *                            being projected back to p_geom1.sdo_srid.
  631.   * @return  circle    : sdo_geometry : Result of MBC calculation
  632.   * @author Martin Davis, JTS 1.12
  633.   * @history    : Simon Greener, August 2011, Original Coding
  634.   * @copyright  : Simon Greener, 2011-2013
  635.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  636.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  637.   **/
  638.   FUNCTION ST_MinimumBoundingCircle(p_geom      IN mdsys.sdo_geometry,
  639.                                     p_precision IN NUMBER,
  640.                                     p_srid      IN NUMBER )
  641.     RETURN mdsys.sdo_geometry deterministic;
  642.   /**
  643.   * ST_Buffer
  644.   * Buffer a geodetic geometry using variety of parameters including single siding.
  645.   * Allows for executing using normal defaults.
  646.   *
  647.   * @param p_geom             : sdo_geometry : first geometry subject to overlay action
  648.   * @param p_distance         : number : buffer distance
  649.   * @param p_precision        : int : number of decimal places of precision
  650.   * @param p_endCapStyle      : int : One of BufferParameters.CAP_ROUND,BufferParameters.CAP_BUTT, BufferParameters.CAP_SQUARE
  651.   * @param p_joinStyle        : int : One of BufferParameters.JOIN_ROUND, BufferParameters.JOIN_MITRE, or BufferParameters.JOIN_BEVEL
  652.   * @param p_quadrantSegments : int : Stroking of curves
  653.   * @param p_singleSided      : int : If 1(true), p_distance > 0 means LEFT sided buffer else right sided
  654.   * @param p_srid             : int : SRID of projected space in which actual overlay occurs before
  655.   *                                   being projected back to p_geom1.sdo_srid.
  656.   * @return SDO_GEOMETRY      : Result of buffer
  657.   * @history    : Simon Greener, August 2011, Original Coding
  658.   * @copyright  : Simon Greener, 2011-2013
  659.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  660.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  661.   */
  662.   FUNCTION ST_Buffer(p_geom             IN mdsys.sdo_geometry,
  663.                      p_distance         IN NUMBER,
  664.                      p_precision        IN NUMBER,
  665.                      p_endCapStyle      IN NUMBER  DEFAULT &&defaultSchema..SC4O.CAP_ROUND,
  666.                      p_joinStyle        IN NUMBER  DEFAULT &&defaultSchema..SC4O.JOIN_ROUND,
  667.                      p_quadrantSegments IN NUMBER  DEFAULT &&defaultSchema..SC4O.QUADRANT_SEGMENTS,
  668.                      p_singleSided      IN BOOLEAN DEFAULT FALSE,
  669.                      p_srid             IN NUMBER  DEFAULT NULL)
  670.     RETURN mdsys.sdo_geometry
  671.            Deterministic;
  672.   /**
  673.   * ST_Buffer
  674.   * Actual wrapper Function ST_over Java class for which all parameters must be supplied.
  675.   *
  676.   * @param p_geom             : sdo_geometry : first geometry subject to overlay action
  677.   * @param p_distance         : number : buffer distance
  678.   * @param p_precision        : int : number of decimal places of precision
  679.   * @param p_endCapStyle      : int : One of BufferParameters.CAP_ROUND,BufferParameters.CAP_BUTT, BufferParameters.CAP_SQUARE
  680.   * @param p_joinStyle        : int : One of BufferParameters.JOIN_ROUND, BufferParameters.JOIN_MITRE, or BufferParameters.JOIN_BEVEL
  681.   * @param p_quadrantSegments : int : Stroking of curves
  682.   * @param p_singleSided      : int : If 1(true), p_distance > 0 means LEFT sided buffer else right sided
  683.   * @return SDO_GEOMETRY      : Result of buffer
  684.   * @history    : Simon Greener, August 2011, Original Coding
  685.   * @copyright  : Simon Greener, 2011-2013
  686.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  687.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  688.   */
  689.   FUNCTION ST_Buffer(p_geom             IN mdsys.sdo_geometry,
  690.                      p_distance         IN NUMBER,
  691.                      p_precision        IN NUMBER,
  692.                      p_endCapStyle      IN NUMBER,
  693.                      p_joinStyle        IN NUMBER,
  694.                      p_quadrantSegments IN NUMBER,
  695.                      p_singleSided      IN NUMBER )
  696.     RETURN mdsys.sdo_geometry
  697.            Deterministic;
  698.   /**
  699.   * ST_Centroid
  700.   *
  701.   * @param p_geom        : sdo_geometry : geometry for which a centroid is to be calculated by JTS
  702.   * @param p_precision   : int : number of decimal places of precision when comparing ordinates.
  703.   * @param _interior     : int : if +ve computes an interior point of this Geometry.
  704.   *                              An interior point is guaranteed to lie in the interior
  705.   *                              of the Geometry, if it possible to calculate such a
  706.   *                              point exactly. Otherwise, the point may lie on the
  707.   *                              boundary of the geometry.
  708.   * @return sdo_geometry : centroid as calculated by JTS
  709.   * @history    : Simon Greener, November 2011, Original Coding
  710.   * @copyright  : Simon Greener, 2011-2013
  711.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  712.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  713.   **/
  714.   FUNCTION ST_Centroid(p_geom      IN mdsys.sdo_geometry,
  715.                        p_precision IN NUMBER,
  716.                        p_interior  IN NUMBER DEFAULT 1)
  717.     RETURN mdsys.sdo_geometry
  718.            deterministic;
  719.   /**
  720.   * ST_ConvexHull
  721.   *
  722.   * @param p_geom        : sdo_geometry : geometry for which a ConvexHull is to be calculated by JTS
  723.   * @param p_precision   : int : number of decimal places of precision when comparing ordinates.
  724.   * @return sdo_geometry : centroid as calculated by JTS
  725.   * @history    : Simon Greener, November 2011, Original Coding
  726.   * @copyright  : Simon Greener, 2011-2013
  727.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  728.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  729.   **/
  730.   FUNCTION ST_ConvexHull(p_geom      IN mdsys.sdo_geometry,
  731.                          p_precision IN NUMBER)
  732.     RETURN mdsys.sdo_geometry
  733.            deterministic;
  734.   /** ============================ EDIT ==================================== **/
  735.   /**
  736.   * ST_Densify
  737.   * Densifies a geometry using a given distance tolerance,
  738.   * and respecting the input geometry's PrecisionModel
  739.   * @param p_geom      : sdo_geometry : first geometry subject to MBC calculation
  740.   * @param p_precision : int : number of decimal places of precision
  741.   * @param p_distanceTolerance : the distance tolerance to densify
  742.   * @return SDO_GEOMETRY : The densified geometry
  743.   * @author Martin Davis, JTS 1.12
  744.   * @history    : Simon Greener, August 2011, Original Coding
  745.   * @copyright  : Simon Greener, 2011-2013
  746.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  747.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  748.   **/
  749.   FUNCTION ST_Densify(p_geom              IN mdsys.sdo_geometry,
  750.                       p_precision         IN NUMBER,
  751.                       p_distanceTolerance IN NUMBER)
  752.     RETURN mdsys.sdo_geometry deterministic;
  753.   /**
  754.   * ST_Densify
  755.   * Densifies a geometry using a given distance tolerance,
  756.   * and respecting the input geometry's PrecisionModel
  757.   * Computations occur in projected space described by p_srid parameter.
  758.   * @param p_geom              : sdo_geometry : first geometry subject to MBC calculation
  759.   * @param p_precision         : int          : number of decimal places of precision
  760.   * @param p_distanceTolerance : double       : the distance tolerance to densify
  761.   * @param p_srid              : int          : SRID of projected space in which actual overlay occurs before
  762.   *                                             being projected back to p_geom1.sdo_srid.
  763.   * @return SDO_GEOMETRY : The densified geometry
  764.   * @author Martin Davis, JTS 1.12
  765.   * @history    : Simon Greener, August 2011, Original Coding
  766.   * @copyright  : Simon Greener, 2011-2013
  767.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  768.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  769.   **/
  770.   FUNCTION ST_Densify(p_geom              IN mdsys.sdo_geometry,
  771.                       p_precision         IN NUMBER,
  772.                       p_distanceTolerance IN NUMBER,
  773.                       p_srid              IN NUMBER)
  774.     RETURN mdsys.sdo_geometry
  775.            deterministic;
  776.   /**
  777.    * ST_LineMerger
  778.    * Takes set of linestring geometries and constructs a collection of linear components
  779.    * that form maximal-length linestrings. The linear components are returned as a MultiLineString.
  780.    * @param p_resultSet  : RefCur_T : Ref Cursor of Linestring Geometries  
  781.    * @param p_precision  : int   : Number of decimal places of precision when comparing ordinates.
  782.    * @return STRUCT      : Collection of linear sdo_geometries as MultiLineString.
  783.    * @throws SQLException
  784.    * @history    : Simon Greener, January 2012, Original Coding
  785.    * @copyright  : Simon Greener, 2011-2013
  786.    * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  787.    *               http://creativecommons.org/licenses/by-sa/2.5/au/
  788.    **/
  789.   FUNCTION ST_LineMerger(p_resultSet IN &&defaultSchema..SC4O.refcur_t,
  790.                          p_precision IN NUMBER)
  791.     RETURN mdsys.sdo_geometry
  792.            Deterministic;
  793.   /**
  794.    * ST_LineMerger
  795.    * Takes set of linestring geometries and constructs a collection of linear components
  796.    * that form maximal-length linestrings. The linear components are returned as a MultiLineString.
  797.   * @param p_geomset     : sdo_geometry_array : Table of Linestring Geometries  
  798.    * @param p_precision  : int           : Number of decimal places of precision when comparing ordinates.
  799.    * @return STRUCT      : Collection of linear sdo_geometries as MultiLineString.
  800.    * @throws SQLException
  801.    * @history    : Simon Greener, January 2012, Original Coding
  802.    * @copyright  : Simon Greener, 2011-2013
  803.    * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  804.    *               http://creativecommons.org/licenses/by-sa/2.5/au/
  805.    **/
  806.   FUNCTION ST_LineMerger(p_geomset   IN mdsys.sdo_geometry_array,
  807.                          p_precision IN NUMBER)
  808.     RETURN mdsys.sdo_geometry
  809.            Deterministic;
  810.   /**
  811.    * ST_NodeLinestrings
  812.    * Takes a GeometryCollection of linestring geometries and ensures nodes
  813.    * are created at all topological intersections
  814.    * common vertex is inserted into each linestring).
  815.    * @param p_geometry  : sdo_geometry : Collection of linestrings
  816.    * @param p_precision : int          : Number of decimal places of precision when comparing ordinates.
  817.    * @return STRUCT     : Collection of linear sdo_geometries as MultiLineString.
  818.    * @throws SQLException
  819.    * @history    : Simon Greener, February 2013, Original Coding
  820.    * @copyright  : Simon Greener, 2011-2013
  821.    * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  822.    *               http://creativecommons.org/licenses/by-sa/2.5/au/
  823.    **/
  824.   FUNCTION ST_NodeLinestrings(p_geometry  IN mdsys.sdo_geometry,
  825.                               p_precision IN NUMBER)
  826.     RETURN mdsys.sdo_geometry
  827.            Deterministic;
  828.   /**
  829.    * ST_NodeLinestrings
  830.    * Takes ref cursor containing linestring geometries and ensures nodes
  831.    * are created at all topological intersections
  832.    * @param p_resultSet  : RefCur_T : Ref Cursor of Linestring Geometries
  833.    * @param p_precision  : int   : Number of decimal places of precision when comparing ordinates.
  834.    * @return STRUCT      : Collection of linear sdo_geometries as MultiLineString.
  835.    * @throws SQLException
  836.    * @history    : Simon Greener, February 2013, Original Coding
  837.    * @copyright  : Simon Greener, 2011-2013
  838.    * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  839.    *               http://creativecommons.org/licenses/by-sa/2.5/au/
  840.    **/
  841.   FUNCTION ST_NodeLinestrings(p_resultSet IN &&defaultSchema..SC4O.refcur_t,
  842.                               p_precision IN NUMBER)
  843.     RETURN mdsys.sdo_geometry
  844.            Deterministic;
  845.   /**
  846.    * ST_NodeLinestrings
  847.    * Takes an array containing linestring geometries and ensures nodes
  848.    * are created at all topological intersections
  849.    * @param p_geomset   : sdo_geometry_array : Table of Linestring Geometries
  850.    * @param p_precision : int                : Number of decimal places of precision when comparing ordinates.
  851.    * @return STRUCT     : Collection of linear sdo_geometries as MultiLineString.
  852.    * @throws SQLException
  853.    * @history    : Simon Greener, February 2013, Original Coding
  854.    * @copyright  : Simon Greener, 2011-2013
  855.    * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  856.    *               http://creativecommons.org/licenses/by-sa/2.5/au/
  857.    */
  858.   FUNCTION ST_NodeLinestrings(p_geomset   IN mdsys.sdo_geometry_array,
  859.                               p_precision IN NUMBER)
  860.     RETURN mdsys.sdo_geometry
  861.            Deterministic;
  862.   /**
  863.    * ST_PolygonBuilder
  864.    * Method for building a polygon from a set of linestrings
  865.    *
  866.    * @param p_resultSet   : Ref Cursor   : Collection of sdo_geometry (linestrings from which polygons will be built)
  867.    * @param p_precision   : int : number of decimal places of precision when comparing ordinates.
  868.    * @return SDO_GEOMETRY : Polygon, MultiPolygon or NULL geometry depending on success of processing.
  869.    * @history    : Simon Greener, August 2011, Original Coding
  870.    * @copyright  : Simon Greener, 2011-2013
  871.    * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  872.    *               http://creativecommons.org/licenses/by-sa/2.5/au/
  873.   **/
  874.   FUNCTION ST_PolygonBuilder(p_resultSet IN &&defaultSchema..SC4O.refcur_t,
  875.                              p_precision IN NUMBER)
  876.     RETURN mdsys.sdo_geometry
  877.            Deterministic;
  878.   /**
  879.    * ST_PolygonBuilder
  880.    * Method for building a polygon from a set of linestrings
  881.    *
  882.    * @param p_geomset     : sdo_geometry_array : Array of Linestring Geometries  
  883.    * @param p_precision   : int : number of decimal places of precision when comparing ordinates.
  884.    * @return SDO_GEOMETRY : Polygon, MultiPolygon or NULL geometry depending on success of processing.
  885.    * @history    : Simon Greener, February 2012, Original Coding
  886.    * @copyright  : Simon Greener, 2011-2013
  887.    * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  888.    *               http://creativecommons.org/licenses/by-sa/2.5/au/
  889.   **/
  890.   FUNCTION ST_PolygonBuilder(p_geomset   IN mdsys.sdo_geometry_array,
  891.                              p_precision IN NUMBER)
  892.     RETURN mdsys.sdo_geometry
  893.            Deterministic;
  894.   /**
  895.    * ST_PolygonBuilder
  896.    * Method for building a polygon from a set of linestrings
  897.    *
  898.    * @param p_geometry    : mdsys.sdo_geometry : Single geometry containing Linestring(s)
  899.    * @param p_precision   : int : number of decimal places of precision when comparing ordinates.
  900.    * @return SDO_GEOMETRY : Polygon, MultiPolygon or NULL geometry depending on success of processing.
  901.    * @history    : Simon Greener, February 2012, Original Coding
  902.    * @copyright  : Simon Greener, 2011-2013
  903.    * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  904.    *               http://creativecommons.org/licenses/by-sa/2.5/au/
  905.   **/
  906.   FUNCTION ST_PolygonBuilder(p_geometry  IN mdsys.sdo_geometry,
  907.                              p_precision IN NUMBER)
  908.     RETURN mdsys.sdo_geometry
  909.            Deterministic;
  910.   /**
  911.    * ST_DelaunayTriangles
  912.    * Method for creating a delaunay triangulation from a geometry input (eg multipoints)
  913.    *
  914.    * @param p_geometry    : mdsys.sdo_geometry : Single sdo_geometry object from whose vertices the delaunay triangles will be build.
  915.    * @param p_tolerance   : number             : Snapping tolerance which will be used to improved the robustness of the triangulation computation.
  916.    * @param p_precision   : Number             : number of decimal places of precision when comparing ordinates.
  917.    * @return SDO_GEOMETRY : Collection of Polygon geometries.
  918.    * @history    : Simon Greener, February 2012, Original Coding
  919.    * @copyright  : Simon Greener, 2011-2013
  920.    * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  921.    *               http://creativecommons.org/licenses/by-sa/2.5/au/
  922.   **/
  923.   FUNCTION ST_DelaunayTriangles(p_geometry  IN mdsys.sdo_geometry,
  924.                                 p_tolerance IN NUMBER,
  925.                                 p_precision IN NUMBER)
  926.     RETURN mdsys.sdo_geometry
  927.            Deterministic;
  928.  /**
  929.    * ST_DelaunayTriangles
  930.    * Method for creating a delaunay triangulation from a geometry input (eg multipoints)
  931.    *
  932.    * @param p_resultSet   : Ref Cursor : Selection of sdo_geometry objects from whose vertices the Delaunay Triangles will be built
  933.    * @param p_tolerance   : number     : Snapping tolerance which will be used to improved the robustness of the triangulation computation.
  934.    * @param p_precision   : Number     : number of decimal places of precision when comparing ordinates.
  935.    * @return SDO_GEOMETRY : Collection of Polygon geometries.
  936.    * @history    : Simon Greener, February 2012, Original Coding
  937.    * @copyright  : Simon Greener, 2011-2013
  938.    * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  939.    *               http://creativecommons.org/licenses/by-sa/2.5/au/
  940.   **/
  941.   FUNCTION ST_DelaunayTriangles(p_resultSet IN &&defaultSchema..SC4O.refcur_t,
  942.                                 p_tolerance IN NUMBER,
  943.                                 p_precision IN NUMBER)
  944.     RETURN mdsys.sdo_geometry
  945.            Deterministic;
  946.  /**
  947.    * ST_DelaunayTriangles
  948.    * Method for creating a delaunay triangulation from a geometry input (eg multipoints)
  949.    *
  950.    * @param p_geomset     : sdo_geometry_array : Array of sdo_geometry objects from whose vertices the delaunay triangles will be build.
  951.    * @param p_tolerance   : number             : Snapping tolerance which will be used to improved the robustness of the triangulation computation.
  952.    * @param p_precision   : Number             : number of decimal places of precision when comparing ordinates.
  953.    * @return SDO_GEOMETRY : Collection of Polygon geometries.
  954.    * @history    : Simon Greener, February 2012, Original Coding
  955.    * @copyright  : Simon Greener, 2011-2013
  956.    * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  957.    *               http://creativecommons.org/licenses/by-sa/2.5/au/
  958.   **/
  959.   FUNCTION ST_DelaunayTriangles(p_geomset   IN mdsys.sdo_geometry_array,
  960.                                 p_tolerance IN NUMBER,
  961.                                 p_precision IN NUMBER)
  962.     RETURN mdsys.sdo_geometry
  963.            Deterministic;
  964.   /**
  965.    * ST_Voronoi
  966.    * Method for creating a Voronoi diagram from a geometry input (eg multipoints)
  967.    *
  968.    * @param p_geometry    : sdo_geometry : Single geometry containing source points from whom the voronoi will be built.
  969.    * @param p_envelope    : sdo_geometry : Single geometry containing limiting envelope for triangulation
  970.    * @param p_tolerance   : number       : Snapping tolerance (coordinate sysstem units only) which will be used
  971.    *                                       to improved the robustness of the computation.
  972.    * @param p_precision   : Number       : number of decimal places of precision when comparing ordinates.
  973.    * @return SDO_GEOMETRY : Collection of Polygon geometries.
  974.    * @history    : Simon Greener, February 2012, Original Coding
  975.    * @copyright  : Simon Greener, 2011-2013
  976.    * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  977.    *               http://creativecommons.org/licenses/by-sa/2.5/au/
  978.   **/
  979.   FUNCTION ST_Voronoi(p_geometry  IN mdsys.sdo_geometry,
  980.                       p_envelope  IN mdsys.sdo_geometry,
  981.                       p_tolerance IN NUMBER,
  982.                       p_precision IN NUMBER)
  983.     RETURN mdsys.sdo_geometry
  984.            Deterministic;
  985.  /**
  986.    * ST_Voronoi
  987.    * Method for creating a Voronoi diagram from a selection of geometry objects.
  988.    *
  989.    * @param p_resultSet   : Ref Cursor : Selection (cursor) of sdo_geometry objects from whose vertices the voronoi will be built.
  990.    * @param p_envelope    : sdo_geometry : Single geometry containing limiting envelope for triangulation
  991.    * @param p_tolerance   : number     : Snapping tolerance which will be used to improved the robustness of the triangulation computation.
  992.    * @param p_precision   : Number     : number of decimal places of precision when comparing ordinates.
  993.    * @return SDO_GEOMETRY : Collection of Polygon geometries.
  994.    * @history    : Simon Greener, February 2012, Original Coding
  995.    * @copyright  : Simon Greener, 2011-2013
  996.    * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  997.    *               http://creativecommons.org/licenses/by-sa/2.5/au/
  998.   **/
  999.   FUNCTION ST_Voronoi(p_resultSet IN &&defaultSchema..SC4O.refcur_t,
  1000.                       p_envelope  IN mdsys.sdo_geometry,
  1001.                       p_tolerance IN NUMBER,
  1002.                       p_precision IN NUMBER)
  1003.     RETURN mdsys.sdo_geometry
  1004.            Deterministic;
  1005.  /**
  1006.    * ST_Voronoi
  1007.    * Method for creating a Voronoi diagram from an array of geometry objects.
  1008.    *
  1009.    * @param p_geomset     : sdo_geometry_array : Array of sdo_geometry objects from whose points the voronoi will be built.
  1010.    * @param p_envelope    : sdo_geometry : Single geometry containing limiting envelope for triangulation
  1011.    * @param p_tolerance   : number             : Snapping tolerance which will be used to improved the robustness of the triangulation computation.
  1012.    * @param p_precision   : Number             : number of decimal places of precision when comparing ordinates.
  1013.    * @return SDO_GEOMETRY : Collection of Polygon geometries.
  1014.    * @history    : Simon Greener, February 2012, Original Coding
  1015.    * @copyright  : Simon Greener, 2011-2013
  1016.    * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1017.    *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1018.   **/
  1019.   FUNCTION ST_Voronoi(p_geomset   IN mdsys.sdo_geometry_array,
  1020.                       p_envelope  IN mdsys.sdo_geometry,
  1021.                       p_tolerance IN NUMBER,
  1022.                       p_precision IN NUMBER)
  1023.     RETURN mdsys.sdo_geometry
  1024.            Deterministic;
  1025.    /**
  1026.     * ST_InterpolateZ
  1027.     * @param p_point : mdsys.sdo_geometry : Point for which Z ordinate's value is to be computed
  1028.     * @param p_geom1 : mdsys.sdo_geometry : First corner geometry 3D point
  1029.     * @param p_geom2 : mdsys.sdo_geometry : Second corner geometry 3D point
  1030.     * @param p_geom3 : mdsys.sdo_geometry : Third corner geometry 3D point
  1031.     * @return Number : Result of Interpolation
  1032.     * @throws SQLException
  1033.     * @history    : Simon Greener, March 2012, Original Coding
  1034.     * @copyright  : Simon Greener, 2011-2013
  1035.     * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1036.     *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1037.    **/
  1038.    FUNCTION ST_InterpolateZ(p_point IN mdsys.sdo_geometry,
  1039.                             p_geom1 IN mdsys.sdo_geometry,
  1040.                             p_geom2 IN mdsys.sdo_geometry,
  1041.                             p_geom3 IN mdsys.sdo_geometry)
  1042.     RETURN NUMBER Deterministic;
  1043.    /**
  1044.      * ST_InterpolateZ
  1045.      * @param _point         : STRUCT : Point for which Z ordinate's value is to be computed
  1046.      * @param _facet         : STRUCT : 3 vertex triangular polygon
  1047.      * @return double        : Result of Interpolation
  1048.      * @throws SQLException
  1049.      * @history    : Simon Greener, March 2012, Original Coding
  1050.      * @copyright  : Simon Greener, 2011-2013
  1051.      * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1052.      *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1053.     **/
  1054.    FUNCTION ST_InterpolateZ(p_point IN mdsys.sdo_geometry,
  1055.                             p_facet IN mdsys.sdo_geometry)
  1056.     RETURN mdsys.sdo_geometry Deterministic;
  1057.   /**
  1058.     * ST_Snap
  1059.     * Snaps both geometries to each other with both being able to move.
  1060.     * Returns compound sdo_geometry ie x004
  1061.     *
  1062.     * @param p_geom1         : sdo_geometry : first snapping geometry
  1063.     * @param p_geom2         : sdo_geometry : second snapping geometry
  1064.     * @param p_snapTolerance : double : Distance tolerance is used to control where snapping is performed.
  1065.     * @param p_precision     : number of decimal places of precision of a geometry
  1066.     * @return SDO_GEOMETRY   : Result of snap which is always a compound geometry x004
  1067.     * @throws SQLException
  1068.     * @history    : Simon Greener, September 2011, Original Coding
  1069.     * @copyright  : Simon Greener, 2011-2013
  1070.     * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1071.     *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1072.    **/
  1073.    FUNCTION ST_Snap(p_geom1         IN mdsys.sdo_geometry,
  1074.                     p_geom2         IN mdsys.sdo_geometry,
  1075.                     p_snapTolerance IN NUMBER,
  1076.                     p_precision     IN NUMBER)
  1077.      RETURN mdsys.sdo_geometry deterministic;
  1078.   /**
  1079.    * ST_Snap
  1080.    * Snaps both geometries to each other with both being able to move.
  1081.    * Returns compound sdo_geometry ie x004
  1082.    * Computations occur in projected space described by p_srid parameter.
  1083.    *
  1084.    * @param p_geom1         : sdo_geometry : first snapping geometry
  1085.    * @param p_geom2         : sdo_geometry : second snapping geometry
  1086.    * @param p_snapTolerance : double : Distance tolerance is used to control where snapping is performed.
  1087.    * @param p_precision     : number of decimal places of precision of a geometry
  1088.    * @param p_srid          : int : SRID of projected space in which actual overlay occurs before
  1089.    *                                being projected back to p_geom1.sdo_srid.
  1090.    * @return SDO_GEOMETRY  : Result of snap. Is always a compound geometry x004
  1091.    * @throws SQLException
  1092.    * @history    : Simon Greener, September 2011, Original Coding
  1093.    * @copyright  : Simon Greener, 2011-2013
  1094.    * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1095.    *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1096.    **/
  1097.    FUNCTION ST_Snap(p_geom1         IN mdsys.sdo_geometry,
  1098.                     p_geom2         IN mdsys.sdo_geometry,
  1099.                     p_snapTolerance IN NUMBER,
  1100.                     p_precision     IN NUMBER,
  1101.                     p_srid          IN NUMBER)
  1102.      RETURN mdsys.sdo_geometry deterministic;
  1103.   /**
  1104.    * ST_SnapTo
  1105.    * Snaps the vertices in the component LineStrings of the source geometry to the vertices of the given snap geometry.
  1106.    *
  1107.    * @param p_geom1         : sdo_geometry : geometry which will be snapped to the second geometry
  1108.    * @param p_snapGeom      : sdo_geometry : the snapTo geometry
  1109.    * @param p_snapTolerance : double : Distance tolerance is used to control where snapping is performed.
  1110.    * @param p_precision     : number of decimal places of precision of a geometry
  1111.    * @return SDO_GEOMETRY  : Result of snapTo
  1112.    * @throws SQLException
  1113.    * @history    : Simon Greener, September 2011, Original Coding
  1114.    * @copyright  : Simon Greener, 2011-2013
  1115.    * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1116.    *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1117.   **/
  1118.   FUNCTION ST_SnapTo(p_geom1         IN mdsys.sdo_geometry,
  1119.                      p_snapGeom      IN mdsys.sdo_geometry,
  1120.                      p_snapTolerance IN NUMBER,
  1121.                      p_precision     IN NUMBER)
  1122.     RETURN mdsys.sdo_geometry deterministic;
  1123.   /**
  1124.    * ST_SnapTo
  1125.    * Snaps the vertices in the component LineStrings of the source geometry to the vertices of the given snap geometry.
  1126.    * Computations occur in projected space described by p_srid parameter.
  1127.    *
  1128.    * @param p_geom1         : sdo_geometry : geometry which will be snapped to the second geometry
  1129.    * @param p_snapGeom      : sdo_geometry : the snapTo geometry
  1130.    * @param p_snapTolerance : double : Distance tolerance is used to control where snapping is performed.
  1131.    * @param p_precision     : number of decimal places of precision of a geometry
  1132.    * @param p_srid          : int : SRID of projected space in which actual overlay occurs before
  1133.    *                                being projected back to p_geom1.sdo_srid.
  1134.    * @return SDO_GEOMETRY  : Result of snapTo
  1135.    * @throws SQLException
  1136.    * @history    : Simon Greener, September 2011, Original Coding
  1137.    * @copyright  : Simon Greener, 2011-2013
  1138.    * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1139.    *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1140.   **/
  1141.   FUNCTION ST_SnapTo(p_geom1         IN mdsys.sdo_geometry,
  1142.                      p_snapGeom      IN mdsys.sdo_geometry,
  1143.                      p_snapTolerance IN NUMBER,
  1144.                      p_precision     IN NUMBER,
  1145.                      p_srid          IN NUMBER)
  1146.     RETURN mdsys.sdo_geometry deterministic;
  1147.   /**
  1148.    * ST_SnapToSelf
  1149.    * Snaps the vertices in the component LineStrings of the source geometry to itself.
  1150.    *
  1151.    * @param p_geom          : sdo_geometry : geometry which will be snapped to itself
  1152.    * @param p_snapTolerance : double : Distance tolerance is used to control where snapping is performed.
  1153.    * @param p_precision     : number of decimal places of precision of a geometry
  1154.    * @param p_srid          : int : SRID of projected space in which actual overlay occurs before
  1155.    *                                being projected back to p_geom1.sdo_srid.
  1156.    * @return SDO_GEOMETRY   : Result of snapToSelf
  1157.    * @throws SQLException
  1158.    * @history    : Simon Greener, September 2011, Original Coding
  1159.    * @copyright  : Simon Greener, 2011-2013
  1160.    * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1161.    *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1162.   **/
  1163.   FUNCTION ST_SnapToSelf(p_geom          IN mdsys.sdo_geometry,
  1164.                          p_snapTolerance IN NUMBER,
  1165.                          p_precision     IN NUMBER)
  1166.     RETURN mdsys.sdo_geometry deterministic;
  1167.   /**
  1168.    * ST_SnapToSelf
  1169.    * Snaps the vertices in the component LineStrings of the source geometry to itself.
  1170.    * Computations occur in projected space described by p_srid parameter.
  1171.    *
  1172.    * @param p_geom          : sdo_geometry : geometry which will be snapped to itself
  1173.    * @param p_snapTolerance : double : Distance tolerance is used to control where snapping is performed.
  1174.    * @param p_precision     : number of decimal places of precision of a geometry
  1175.    * @param p_srid          : int : SRID of projected space in which actual overlay occurs before
  1176.    *                                being projected back to p_geom1.sdo_srid.
  1177.    * @return SDO_GEOMETRY   : Result of snapToSelf
  1178.    * @throws SQLException
  1179.    * @history    : Simon Greener, September 2011, Original Coding
  1180.    * @copyright  : Simon Greener, 2011-2013
  1181.    * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1182.    *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1183.   **/
  1184.   FUNCTION ST_SnapToSelf(p_geom          IN mdsys.sdo_geometry,
  1185.                          p_snapTolerance IN NUMBER,
  1186.                          p_precision     IN NUMBER,
  1187.                          p_srid          IN NUMBER)
  1188.     RETURN mdsys.sdo_geometry deterministic;
  1189.   /**
  1190.    * ST_CoordinateRounder
  1191.    * Method for rounding the coordinates of a geometry to a particular precision
  1192.    *
  1193.    * @param p_geom        : sdo_geometry : sdo_geometry object
  1194.    * @param p_precision   : int          : number of decimal places of precision when rounding ordinates
  1195.    * @return SDO_GEOMETRY : MBR as Polygon
  1196.    * @history    : Simon Greener, January 2012, Original Coding
  1197.    * @copyright  : Simon Greener, 2011-2013
  1198.    * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1199.    *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1200.   **/
  1201.   FUNCTION ST_CoordinateRounder(p_geom      IN mdsys.sdo_geometry,
  1202.                                 p_precision IN NUMBER)
  1203.     RETURN mdsys.sdo_geometry
  1204.            deterministic;
  1205.   /** =========================== Simplification ======================== **/
  1206.   /**
  1207.    * ST_DouglasPeuckerSimplify
  1208.    *
  1209.    * @param p_geom              : sdo_geometry : geometry for which a Douglas Peucker based simplification is to be calculated by JTS
  1210.    * @param p_distanceTolerance : Number       : The maximum distance difference (similar to the one used in the Douglas-Peucker algorithm)
  1211.    * @param p_precision         : int          : number of decimal places of precision when comparing ordinates.
  1212.    * @return sdo_geometry       : Simplified geometry as calculated by JTS
  1213.    * @Notes: Simplifies a {@link Geometry} using the standard Douglas-Peucker algorithm.
  1214.    *         Ensures that any polygonal geometries returned are valid.
  1215.    *         In general D-P does not preserve topology e.g. polygons can be split, collapse to lines or disappear
  1216.    *         holes can be created or disappear, and lines can cross. However, this implementation attempts always
  1217.    *         to preserve topology. Switch to not preserve topology is not exposed to PL/SQL.
  1218.    * @history    : Simon Greener, January 2012, Original Coding
  1219.    * @copyright  : Simon Greener, 2011-2013
  1220.    * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1221.    *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1222.   **/
  1223.   FUNCTION ST_DouglasPeuckerSimplify(p_geom              IN mdsys.sdo_geometry,
  1224.                                      p_distanceTolerance IN NUMBER,
  1225.                                      p_precision         IN NUMBER)
  1226.     RETURN mdsys.sdo_geometry
  1227.            deterministic;
  1228.   /**
  1229.   * ST_TopologyPreservingSimplify
  1230.   *
  1231.   * @param p_geom              : sdo_geometry : geometry for which simplification is to be calculated by JTS
  1232.   * @param p_distanceTolerance : Number       : The maximum distance difference (similar to the one used in the Douglas-Peucker algorithm)
  1233.   * @param p_precision         : int          : number of decimal places of precision when comparing ordinates.
  1234.   * @return sdo_geometry       : Simplified geometry as calculated by JTS
  1235.   * @Notes: The simplification uses a maximum distance difference algorithm
  1236.   * similar to the one used in the Douglas-Peucker algorithm.
  1237.   * In particular, if the input is an polygon geometry
  1238.   * - The result has the same number of shells and holes (rings) as the input, in the same order
  1239.   * - The result rings touch at no more than the number of touching point in the input
  1240.   *   (although they may touch at fewer points).  
  1241.   * (The key implication of this constraint is that the output will be topologically valid if the input was.)
  1242.   * @history    : Simon Greener, January 2012, Original Coding
  1243.   * @copyright  : Simon Greener, 2011-2013
  1244.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1245.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1246.   **/
  1247.   FUNCTION ST_TopologyPreservingSimplify(p_geom              IN mdsys.sdo_geometry,
  1248.                                          p_distanceTolerance IN NUMBER,
  1249.                                          p_precision         IN NUMBER)
  1250.     RETURN mdsys.sdo_geometry
  1251.            deterministic;
  1252.   /** ============================= Input / Output =====================================*/
  1253.   -- Input
  1254.   /**
  1255.   * ST_GeomFromEWKT
  1256.   * Create SDO_GEOMETRY object from Extended Well Known Text formatted string.
  1257.   *
  1258.   * @param p_ewkt        : CLOB : EWKT string
  1259.   * @return SDO_GEOMETRY : Result of creation
  1260.   * @history    : Simon Greener, January 2012, Original Coding
  1261.   * @copyright  : Simon Greener, 2007, 2008, 2009, 2010, 2011, 2012
  1262.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1263.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1264.   *               This software is based on other open source projects. I am very grateful to:  
  1265.   *               - Java Topology Suite (JTS). http://sourceforge.net/projects/jts-topo-suite/
  1266.   *               - JAva SPAtial for SQL (JASPA) is free software redistributed under terms of the
  1267.   *                 GNU General Public License Version 2+. http://forge.osor.eu/projects/jaspa/
  1268.   *               - GeoTools. http://www.geotools.org/
  1269.   */
  1270.   FUNCTION ST_GeomFromEWKT(p_ewkt IN CLOB)
  1271.     RETURN mdsys.sdo_geometry Deterministic;
  1272.   /**
  1273.   * ST_GeomFromEWKT
  1274.   * Create SDO_GEOMETRY object from Extended Well Known Text formatted string.
  1275.   *
  1276.   * @param p_ewkt        : CLOB : EWKT string
  1277.   * @param p_srid        : Apply srid to created geometry (-1 == null) if doesn't have one.
  1278.   * @return SDO_GEOMETRY : Result of creation
  1279.   * @history    : Simon Greener, January 2012, Original Coding
  1280.   * @copyright  : Simon Greener, 2007, 2008, 2009, 2010, 2011, 2012
  1281.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1282.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1283.   *               This software is based on other open source projects. I am very grateful to:  
  1284.   *               - Java Topology Suite (JTS). http://sourceforge.net/projects/jts-topo-suite/
  1285.   *               - JAva SPAtial for SQL (JASPA) is free software redistributed under terms of the
  1286.   *                 GNU General Public License Version 2+. http://forge.osor.eu/projects/jaspa/
  1287.   *               - GeoTools. http://www.geotools.org/
  1288.   */
  1289.   FUNCTION ST_GeomFromEWKT(p_ewkt IN CLOB,
  1290.                            p_srid IN NUMBER)
  1291.     RETURN mdsys.sdo_geometry Deterministic;
  1292.   /**
  1293.   * ST_GeomFromEWKT
  1294.   * Create SDO_GEOMETRY object from Extended Well Known Text formatted string.
  1295.   *
  1296.   * @param p_ewkt        : varchar2 : EWKT string
  1297.   * @return SDO_GEOMETRY : Result of creation (NULL SDO_SRID returned)
  1298.   * @history    : Simon Greener, January 2012, Original Coding
  1299.   * @copyright  : Simon Greener, 2007, 2008, 2009, 2010, 2011, 2012
  1300.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1301.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1302.   *               This software is based on other open source projects. I am very grateful to:  
  1303.   *               - Java Topology Suite (JTS). http://sourceforge.net/projects/jts-topo-suite/
  1304.   *               - JAva SPAtial for SQL (JASPA) is free software redistributed under terms of the
  1305.   *                 GNU General Public License Version 2+. http://forge.osor.eu/projects/jaspa/
  1306.   *               - GeoTools. http://www.geotools.org/
  1307.   */
  1308.   FUNCTION ST_GeomFromEWKT(p_ewkt IN varchar2)
  1309.     RETURN mdsys.sdo_geometry Deterministic;
  1310.   /**
  1311.   * ST_GeomFromEWKT
  1312.   * Create SDO_GEOMETRY object from Extended Well Known Text formatted string.
  1313.   *
  1314.   * @param p_ewkt        : varchar2 : EWKT string
  1315.   * @param p_srid        : Apply srid to created geometry (-1 == null) if doesn't have one.
  1316.   * @return SDO_GEOMETRY : Result of creation
  1317.   * @history    : Simon Greener, January 2012, Original Coding
  1318.   * @copyright  : Simon Greener, 2007, 2008, 2009, 2010, 2011, 2012
  1319.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1320.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1321.   *               This software is based on other open source projects. I am very grateful to:  
  1322.   *               - Java Topology Suite (JTS). http://sourceforge.net/projects/jts-topo-suite/
  1323.   *               - JAva SPAtial for SQL (JASPA) is free software redistributed under terms of the
  1324.   *                 GNU General Public License Version 2+. http://forge.osor.eu/projects/jaspa/
  1325.   *               - GeoTools. http://www.geotools.org/
  1326.   */
  1327.   FUNCTION ST_GeomFromEWKT(p_ewkt IN varchar2,
  1328.                            p_srid IN NUMBER)
  1329.     RETURN mdsys.sdo_geometry Deterministic;
  1330.   /**
  1331.   * ST_GeomFromText
  1332.   * Create SDO_GEOMETRY object from Well Known Text (WKT) formatted string.
  1333.   *
  1334.   * @param p_wkt         : CLOB : WKT string (no SRID)
  1335.   * @return SDO_GEOMETRY : Result of creation
  1336.   * @history    : Simon Greener, January 2012, Original Coding
  1337.   * @copyright  : Simon Greener, 2007, 2008, 2009, 2010, 2011, 2012
  1338.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1339.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1340.   *               This software is based on other open source projects. I am very grateful to:  
  1341.   *               - Java Topology Suite (JTS). http://sourceforge.net/projects/jts-topo-suite/
  1342.   *               - JAva SPAtial for SQL (JASPA) is free software redistributed under terms of the
  1343.   *                 GNU General Public License Version 2+. http://forge.osor.eu/projects/jaspa/
  1344.   *               - GeoTools. http://www.geotools.org/
  1345.   */
  1346.   FUNCTION ST_GeomFromText(p_wkt IN CLOB)
  1347.     RETURN mdsys.sdo_geometry Deterministic;
  1348.   /**
  1349.   * ST_GeomFromText
  1350.   * Create SDO_GEOMETRY object from Extended Well Known Text formatted string.
  1351.   *
  1352.   * @param p_wkt         : CLOB : WKT string (no SRID)
  1353.   * @param p_srid        : Apply srid to created geometry (-1 == null)
  1354.   * @return SDO_GEOMETRY : Result of creation
  1355.   * @history    : Simon Greener, January 2012, Original Coding
  1356.   * @copyright  : Simon Greener, 2007, 2008, 2009, 2010, 2011, 2012
  1357.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1358.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1359.   *               This software is based on other open source projects. I am very grateful to:  
  1360.   *               - Java Topology Suite (JTS). http://sourceforge.net/projects/jts-topo-suite/
  1361.   *               - JAva SPAtial for SQL (JASPA) is free software redistributed under terms of the
  1362.   *                 GNU General Public License Version 2+. http://forge.osor.eu/projects/jaspa/
  1363.   *               - GeoTools. http://www.geotools.org/
  1364.   */
  1365.   FUNCTION ST_GeomFromText(p_wkt  IN CLOB,
  1366.                            p_srid IN NUMBER)
  1367.     RETURN mdsys.sdo_geometry Deterministic;
  1368.   /**
  1369.   * ST_GeomFromText
  1370.   * Create SDO_GEOMETRY object from Well Known Text formatted string.
  1371.   *
  1372.   * @param p_wkt         : varchar2 : WKT string (no SRID)
  1373.   * @return SDO_GEOMETRY : Result of creation
  1374.   * @history    : Simon Greener, January 2012, Original Coding
  1375.   * @copyright  : Simon Greener, 2007, 2008, 2009, 2010, 2011, 2012
  1376.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1377.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1378.   *               This software is based on other open source projects. I am very grateful to:  
  1379.   *               - Java Topology Suite (JTS). http://sourceforge.net/projects/jts-topo-suite/
  1380.   *               - JAva SPAtial for SQL (JASPA) is free software redistributed under terms of the
  1381.   *                 GNU General Public License Version 2+. http://forge.osor.eu/projects/jaspa/
  1382.   *               - GeoTools. http://www.geotools.org/
  1383.   */
  1384.   FUNCTION ST_GeomFromText(p_wkt IN varchar2)
  1385.     RETURN mdsys.sdo_geometry Deterministic;
  1386.   /**
  1387.   * ST_GeomFromText
  1388.   * Create SDO_GEOMETRY object from Extended Well Known Text formatted string.
  1389.   *
  1390.   * @param p_wkt         : varchar2 : WKT string (no SRID)
  1391.   * @param p_srid        : Apply srid to created geometry (-1 == null)
  1392.   * @return SDO_GEOMETRY : Result of creation
  1393.   * @history    : Simon Greener, January 2012, Original Coding
  1394.   * @copyright  : Simon Greener, 2007, 2008, 2009, 2010, 2011, 2012
  1395.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1396.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1397.   *               This software is based on other open source projects. I am very grateful to:  
  1398.   *               - Java Topology Suite (JTS). http://sourceforge.net/projects/jts-topo-suite/
  1399.   *               - JAva SPAtial for SQL (JASPA) is free software redistributed under terms of the
  1400.   *                 GNU General Public License Version 2+. http://forge.osor.eu/projects/jaspa/
  1401.   *               - GeoTools. http://www.geotools.org/
  1402.   */
  1403.   FUNCTION ST_GeomFromText(p_wkt IN varchar2,
  1404.                            p_srid IN NUMBER)
  1405.     RETURN mdsys.sdo_geometry Deterministic;
  1406.   /**
  1407.   * ST_GeomFromGML
  1408.   * Create SDO_GEOMETRY object from Geography Markup Language formatted string.
  1409.   *
  1410.   * @param p_gml         : varchar2 : GML string
  1411.   * @return SDO_GEOMETRY : Result of creation
  1412.   * @history    : Simon Greener, August 2012, Original Coding
  1413.   * @copyright  : Simon Greener, 2007, 2008, 2009, 2010, 2011, 2012
  1414.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1415.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1416.   *               This software is based on other open source projects. I am very grateful to:  
  1417.   *               - Java Topology Suite (JTS). http://sourceforge.net/projects/jts-topo-suite/
  1418.   *               - JAva SPAtial for SQL (JASPA) is free software redistributed under terms of the
  1419.   *                 GNU General Public License Version 2+. http://forge.osor.eu/projects/jaspa/
  1420.   *               - GeoTools. http://www.geotools.org/
  1421.   */
  1422.   FUNCTION ST_GeomFromGML(p_gml IN varchar2)
  1423.     RETURN mdsys.sdo_geometry Deterministic;
  1424.   -- Output
  1425.   /**
  1426.   * ST_AsText
  1427.   * Creates Well Known Text (WKT) from SDO_GEOMETRY Object
  1428.   *
  1429.   * @param p_geom : sdo_geometry : sdo_geometry object
  1430.   * @return WKT  : CLOB         : Result of creation
  1431.   * @history    : Simon Greener, August 2012, Original Coding
  1432.   * @copyright  : Simon Greener, 2007, 2008, 2009, 2010, 2011, 2012
  1433.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1434.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1435.   *               This software is based on other open source projects. I am very grateful to:  
  1436.   *               - Java Topology Suite (JTS). http://sourceforge.net/projects/jts-topo-suite/
  1437.   *               - JAva SPAtial for SQL (JASPA) is free software redistributed under terms of the
  1438.   *                 GNU General Public License Version 2+. http://forge.osor.eu/projects/jaspa/
  1439.   *               - GeoTools. http://www.geotools.org/
  1440.   */
  1441.   FUNCTION ST_AsText(p_geom IN sdo_geometry)
  1442.     RETURN CLOB deterministic;
  1443.   /**
  1444.   * ST_AsEWKT
  1445.   * Creates Extended Welll Known Text (EWKT) from SDO_GEOMETRY Object
  1446.   *
  1447.   * @param p_geom : sdo_geometry : sdo_geometry object
  1448.   * @return EWKT  : CLOB         : Result of creation
  1449.   * @history    : Simon Greener, August 2012, Original Coding
  1450.   * @copyright  : Simon Greener, 2007, 2008, 2009, 2010, 2011, 2012
  1451.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1452.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1453.   *               This software is based on other open source projects. I am very grateful to:  
  1454.   *               - Java Topology Suite (JTS). http://sourceforge.net/projects/jts-topo-suite/
  1455.   *               - JAva SPAtial for SQL (JASPA) is free software redistributed under terms of the
  1456.   *                 GNU General Public License Version 2+. http://forge.osor.eu/projects/jaspa/
  1457.   *               - GeoTools. http://www.geotools.org/
  1458.   */
  1459.   FUNCTION ST_AsEWKT(p_geom IN sdo_geometry)
  1460.     RETURN CLOB deterministic;
  1461.   /**
  1462.   * ST_AsGML
  1463.   * Creates GML from SDO_GEOMETRY Object
  1464.   *
  1465.   * @param p_geom : sdo_geometry : sdo_geometry object
  1466.   * @return GML   : CLOB         : Result of creation
  1467.   * @history    : Simon Greener, August 2012, Original Coding
  1468.   * @copyright  : Simon Greener, 2007, 2008, 2009, 2010, 2011, 2012
  1469.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1470.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1471.   *               This software is based on other open source projects. I am very grateful to:  
  1472.   *               - Java Topology Suite (JTS). http://sourceforge.net/projects/jts-topo-suite/
  1473.   *               - JAva SPAtial for SQL (JASPA) is free software redistributed under terms of the
  1474.   *                 GNU General Public License Version 2+. http://forge.osor.eu/projects/jaspa/
  1475.   *               - GeoTools. http://www.geotools.org/
  1476.   */
  1477.   FUNCTION ST_AsGML(p_geom IN sdo_geometry)
  1478.     RETURN CLOB deterministic;
  1479.   /** ============================= EDITORS =====================================*/
  1480.   /**
  1481.   * ST_DeleteVertex
  1482.   * Removes point/vertex from input geometry.
  1483.   *
  1484.   * @param p_geom        : sdo_geometry : Geometry to be modified
  1485.   * @param p_pointIndex  : int : vertex to be removed from 1..NumPoints with -1 being alias for last point.
  1486.   * @return SDO_GEOMETRY : Result of point removal
  1487.   * @history    : Simon Greener, January 2012, Original Coding
  1488.   * @copyright  : Simon Greener, 2007, 2008, 2009, 2010, 2011, 2012
  1489.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1490.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1491.   *               This software is based on other open source projects. I am very grateful to:
  1492.   *               - Java Topology Suite (JTS). http://sourceforge.net/projects/jts-topo-suite/
  1493.   *               - JAva SPAtial for SQL (JASPA) is free software redistributed under terms of the
  1494.   *                 GNU General Public License Version 2+. http://forge.osor.eu/projects/jaspa/
  1495.   *               - GeoTools. http://www.geotools.org/
  1496.   */
  1497.   FUNCTION ST_DeleteVertex(p_geom       IN sdo_geometry,
  1498.                            p_pointIndex IN NUMBER)
  1499.     RETURN mdsys.sdo_geometry deterministic;
  1500.   /**
  1501.   * ST_UpdateVertex
  1502.   * Changes point/vertex values in input geometry to those of the supplied point geometry
  1503.   *
  1504.   * @param p_geom        : sdo_geometry : Geometry to be modified
  1505.   * @param p_pointIndex  : int          : vertex to be changed to values in supplied point (1..NumPoints with -1 being alias for last point)
  1506.   * @param p_point       : sdo_geometry : The point geometry holding the new XYZM values
  1507.   * @return SDO_GEOMETRY : Result of point change
  1508.   * @history    : Simon Greener, January 2012, Original Coding
  1509.   * @copyright  : Simon Greener, 2007, 2008, 2009, 2010, 2011, 2012
  1510.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1511.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1512.   */
  1513.   FUNCTION ST_UpdateVertex(p_geom       IN sdo_geometry,
  1514.                            p_pointIndex IN NUMBER,
  1515.                            p_point      IN sdo_geometry)
  1516.     RETURN mdsys.sdo_geometry deterministic;
  1517.   /**
  1518.   * ST_InsertVertex
  1519.   * Adds supplied point geometry at the end of the input geometry
  1520.   *
  1521.   * @param p_geom        : sdo_geometry : Geometry to be modified
  1522.   * @param p_point       : sdo_geometry : The point geometry holding the new XYZM values
  1523.   * @return SDO_GEOMETRY : Result of point addition
  1524.   * @history    : Simon Greener, January 2012, Original Coding
  1525.   * @copyright  : Simon Greener, 2007, 2008, 2009, 2010, 2011, 2012
  1526.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1527.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1528.   */
  1529.   FUNCTION ST_InsertVertex(p_geom  IN sdo_geometry,
  1530.                            p_point IN sdo_geometry)
  1531.     RETURN mdsys.sdo_geometry deterministic;
  1532.   /**
  1533.   * ST_InsertVertex
  1534.   * Adds supplied point geometry at the supplied position in the input geometry
  1535.   *
  1536.   * @param p_geom        : sdo_geometry : Geometry to be modified
  1537.   * @param p_pointIndex  : int          : Position in input geometry where new point is to be inserted (1..NumPoints with -1 being "add to end of existing points")
  1538.   * @param p_point       : sdo_geometry : The point geometry holding the new XYZM values
  1539.   * @return SDO_GEOMETRY : Result of point addition
  1540.   * @history    : Simon Greener, January 2012, Original Coding
  1541.   * @copyright  : Simon Greener, 2007, 2008, 2009, 2010, 2011, 2012
  1542.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1543.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1544.   */
  1545.   FUNCTION ST_InsertVertex(p_geom       IN sdo_geometry,
  1546.                            p_pointIndex IN NUMBER,
  1547.                            p_point      IN sdo_geometry)
  1548.     RETURN mdsys.sdo_geometry deterministic;
  1549.   /**
  1550.   * ST_InsertVertex
  1551.   * Adds supplied point geometry at the supplied position in the input geometry
  1552.   *
  1553.   * @param p_geom        : sdo_geometry : Geometry to be modified
  1554.   * @param p_point       : sdo_geometry : The point geometry holding the new XYZM values
  1555.   * @param p_pointIndex  : int          : Position in input geometry where new point is to be inserted (1..NumPoints with -1 being "add to end of existing points")
  1556.   * @return SDO_GEOMETRY : Result of point addition
  1557.   * @history    : Simon Greener, January 2012, Original Coding
  1558.   * @copyright  : Simon Greener, 2007, 2008, 2009, 2010, 2011, 2012
  1559.   * @license    : Creative Commons Attribution-Share Alike 2.5 Australia License.
  1560.   *               http://creativecommons.org/licenses/by-sa/2.5/au/
  1561.   */
  1562.   FUNCTION ST_InsertVertex(p_geom       IN sdo_geometry,
  1563.                            p_point      IN sdo_geometry,
  1564.                            p_pointIndex IN NUMBER)
  1565.     RETURN mdsys.sdo_geometry deterministic;
  1566. END SC4O;
  1567. /
  1568. SHOW ERRORS

I hope this is of use to someone.

Creative Commons License

post this at del.icio.uspost this at Diggpost this at Technoratipost this at Redditpost this at Farkpost this at Yahoo! my webpost this at Windows Livepost this at Google Bookmarkspost this to Twitter

Comment [1]

Hey ,

I am trying to move from sde.St_geometry to sdo-geometry via sql wkt .However thye issue is because it doesnt support 3d. would be great if I could try it out with your package.

— Tharunya · 26 June 2015, 15:14 · #

META HTTP-EQUIV=