com.mizar.persistence.jpa.utils
Class JPAGeometryUtils

java.lang.Object
  extended by com.mizar.persistence.jpa.utils.JPAGeometryUtils

public class JPAGeometryUtils
extends java.lang.Object


Field Summary
static int SDO_ANY_INTERACTION
           
static int SDO_CONTAINS
           
static int SDO_COVEREDBY
           
static int SDO_COVERS
           
static int SDO_DISJOINT
           
static int SDO_EQUALS
           
static int SDO_INSIDE
           
static int SDO_ON
           
static int SDO_OVERLAPBDYDISJOINT
           
static int SDO_OVERLAPBDYINTERSECT
           
static int SDO_TOUCH
           
 
Constructor Summary
JPAGeometryUtils()
           
 
Method Summary
static oracle.spatial.geometry.JGeometry aggregateGeometries(javax.persistence.EntityManager em, java.util.List beans, double tolerance)
           
static oracle.sql.STRUCT convertJGeometry(oracle.spatial.geometry.JGeometry geom, javax.persistence.EntityManager em)
           
static boolean coversContains(javax.persistence.EntityManager em, oracle.spatial.geometry.JGeometry geom1, oracle.spatial.geometry.JGeometry geom2)
           
static oracle.spatial.geometry.JGeometry differenceGeometries(javax.persistence.EntityManager em, oracle.spatial.geometry.JGeometry geom1, oracle.spatial.geometry.JGeometry geom2)
          Substracts the second geometry from the first
static boolean geomEquality(javax.persistence.EntityManager em, oracle.spatial.geometry.JGeometry geom1, oracle.spatial.geometry.JGeometry geom2)
           
static oracle.spatial.geometry.JGeometry intersectGeometries(oracle.spatial.geometry.JGeometry geom1, oracle.spatial.geometry.JGeometry geom2, javax.persistence.EntityManager em)
           
static java.lang.String relate(javax.persistence.EntityManager em, oracle.spatial.geometry.JGeometry geom1, oracle.spatial.geometry.JGeometry geom2)
           
static oracle.spatial.geometry.JGeometry transformGeometry(javax.persistence.EntityManager em, oracle.spatial.geometry.JGeometry geom, int toSRID)
           
static oracle.spatial.geometry.JGeometry transformGeometry2D(javax.persistence.EntityManager em, oracle.spatial.geometry.JGeometry geom, int toSRID)
          This method guarrantees that the returned geometry will be 2D.
static oracle.spatial.geometry.JGeometry unionGeometries(javax.persistence.EntityManager em, oracle.spatial.geometry.JGeometry geom1, oracle.spatial.geometry.JGeometry geom2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SDO_INSIDE

public static final int SDO_INSIDE
See Also:
Constant Field Values

SDO_CONTAINS

public static final int SDO_CONTAINS
See Also:
Constant Field Values

SDO_TOUCH

public static final int SDO_TOUCH
See Also:
Constant Field Values

SDO_COVEREDBY

public static final int SDO_COVEREDBY
See Also:
Constant Field Values

SDO_COVERS

public static final int SDO_COVERS
See Also:
Constant Field Values

SDO_EQUALS

public static final int SDO_EQUALS
See Also:
Constant Field Values

SDO_ON

public static final int SDO_ON
See Also:
Constant Field Values

SDO_OVERLAPBDYINTERSECT

public static final int SDO_OVERLAPBDYINTERSECT
See Also:
Constant Field Values

SDO_OVERLAPBDYDISJOINT

public static final int SDO_OVERLAPBDYDISJOINT
See Also:
Constant Field Values

SDO_ANY_INTERACTION

public static final int SDO_ANY_INTERACTION
See Also:
Constant Field Values

SDO_DISJOINT

public static final int SDO_DISJOINT
See Also:
Constant Field Values
Constructor Detail

JPAGeometryUtils

public JPAGeometryUtils()
Method Detail

transformGeometry

public static oracle.spatial.geometry.JGeometry transformGeometry(javax.persistence.EntityManager em,
                                                                  oracle.spatial.geometry.JGeometry geom,
                                                                  int toSRID)
                                                           throws java.sql.SQLException,
                                                                  javax.naming.NamingException,
                                                                  java.lang.Exception
Throws:
java.sql.SQLException
javax.naming.NamingException
java.lang.Exception

transformGeometry2D

public static oracle.spatial.geometry.JGeometry transformGeometry2D(javax.persistence.EntityManager em,
                                                                    oracle.spatial.geometry.JGeometry geom,
                                                                    int toSRID)
                                                             throws java.sql.SQLException,
                                                                    javax.naming.NamingException,
                                                                    java.lang.Exception
This method guarrantees that the returned geometry will be 2D. If the geometry is already 2D and the SRID matches toSRID the original SDO_GEOMETRY is passed back unchanged.

Parameters:
em -
geom -
toSRID -
Returns:
Throws:
java.sql.SQLException
javax.naming.NamingException
java.lang.Exception

convertJGeometry

public static oracle.sql.STRUCT convertJGeometry(oracle.spatial.geometry.JGeometry geom,
                                                 javax.persistence.EntityManager em)
                                          throws java.sql.SQLException,
                                                 java.lang.Exception
Throws:
java.sql.SQLException
java.lang.Exception

relate

public static java.lang.String relate(javax.persistence.EntityManager em,
                                      oracle.spatial.geometry.JGeometry geom1,
                                      oracle.spatial.geometry.JGeometry geom2)
                               throws java.sql.SQLException,
                                      java.lang.Exception
Throws:
java.sql.SQLException
java.lang.Exception

coversContains

public static boolean coversContains(javax.persistence.EntityManager em,
                                     oracle.spatial.geometry.JGeometry geom1,
                                     oracle.spatial.geometry.JGeometry geom2)
                              throws java.sql.SQLException,
                                     java.lang.Exception
Parameters:
em -
geom1 -
geom2 -
Returns:
Throws:
java.sql.SQLException
java.lang.Exception

differenceGeometries

public static oracle.spatial.geometry.JGeometry differenceGeometries(javax.persistence.EntityManager em,
                                                                     oracle.spatial.geometry.JGeometry geom1,
                                                                     oracle.spatial.geometry.JGeometry geom2)
                                                              throws java.sql.SQLException,
                                                                     java.lang.Exception
Substracts the second geometry from the first

Parameters:
em -
geom1 -
geom2 -
Returns:
Throws:
java.sql.SQLException
java.lang.Exception

geomEquality

public static boolean geomEquality(javax.persistence.EntityManager em,
                                   oracle.spatial.geometry.JGeometry geom1,
                                   oracle.spatial.geometry.JGeometry geom2)
                            throws java.sql.SQLException,
                                   java.lang.Exception
Throws:
java.sql.SQLException
java.lang.Exception

unionGeometries

public static oracle.spatial.geometry.JGeometry unionGeometries(javax.persistence.EntityManager em,
                                                                oracle.spatial.geometry.JGeometry geom1,
                                                                oracle.spatial.geometry.JGeometry geom2)
                                                         throws java.sql.SQLException,
                                                                java.lang.Exception
Throws:
java.sql.SQLException
java.lang.Exception

intersectGeometries

public static oracle.spatial.geometry.JGeometry intersectGeometries(oracle.spatial.geometry.JGeometry geom1,
                                                                    oracle.spatial.geometry.JGeometry geom2,
                                                                    javax.persistence.EntityManager em)
                                                             throws java.sql.SQLException,
                                                                    java.lang.Exception
Throws:
java.sql.SQLException
java.lang.Exception

aggregateGeometries

public static oracle.spatial.geometry.JGeometry aggregateGeometries(javax.persistence.EntityManager em,
                                                                    java.util.List beans,
                                                                    double tolerance)