Go to content Go to navigation and search

Home

Articles and Documentation


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) Package Documentation

Friday March 09 2012 at 14:33

KeywordsJASPA JTS union intersection difference xor Densify Voronoi Delaunay Locator
Summary

This article presents the Package Header for my Spatial Companion For Oracle (Sc4o) library of useful “extension” functions.

The following package requires the appropriate JAR files to be loaded into the Oracle database JVM.

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

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

  • Polygonizer

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):

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

Article Navigation:   Previous  

META HTTP-EQUIV=