public class OracleUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.awt.geom.Rectangle2D |
DEFAULT_BBOX |
static java.awt.geom.Rectangle2D |
DEFAULT_BBOX_DEGREE |
static java.awt.geom.Rectangle2D |
DEFAULT_BBOX_METER |
static java.lang.String |
DIMENSIONS_ID |
static java.lang.String |
ENVELOPE_ID |
static java.lang.String |
EXPONENTIAL_INDICES_CONDITION |
| Constructor and Description |
|---|
OracleUtils() |
| Modifier and Type | Method and Description |
|---|---|
static oracle.sql.Datum[] |
appendDatArrays(oracle.sql.Datum[] head,
oracle.sql.Datum[] tail) |
static oracle.sql.STRUCT |
appendGeometriesInStruct(org.gvsig.fmap.geom.Geometry[] geoms,
int _forced_type,
java.sql.Connection conn,
java.lang.String osrid,
boolean withSrid,
boolean agu_bien,
boolean _isGeoCS)
This method appends the geometries from a geometries array in one STRUCT.
|
static int[] |
appendIntArrays(int[] head,
int[] tail) |
static java.lang.String |
binaryUnionEnvs(org.gvsig.fmap.geom.primitive.Envelope[] enves,
java.lang.String ora_srid,
boolean is_geo,
java.lang.String tol,
java.sql.Connection conn,
int depth) |
static oracle.sql.STRUCT |
buildSTRUCT(org.gvsig.fmap.geom.Geometry geom,
int _forced_type,
java.sql.Connection conn,
java.lang.String osrid,
boolean withSrid,
boolean agu_bien,
boolean _isGeoCS)
Converts Geometry to STRUCT
|
static void |
copyFeatureTypeToOracleStoreParams(org.gvsig.fmap.dal.feature.EditableFeatureType efType,
OracleStoreParameters params) |
static org.gvsig.fmap.geom.Geometry |
createNullGeometry(int stype) |
static oracle.sql.STRUCT |
createStruct(oracle.sql.NUMBER type,
oracle.sql.NUMBER srid,
oracle.sql.Datum[] info,
oracle.sql.Datum[] ords,
java.sql.Connection conn)
Utility method to create a struct with the given data.
|
static double |
determinant(double[][] a,
int n)
Utility method to compute a matrix determinant
|
static int |
dimensionsFromSubtype(int subtype) |
static java.awt.geom.Rectangle2D |
doIntersect(java.awt.geom.Rectangle2D r1,
java.awt.geom.Rectangle2D r2) |
static org.gvsig.fmap.geom.Geometry |
envelopesToGeometry(java.util.ArrayList accum) |
static java.awt.geom.Rectangle2D |
envelopeToRectangle2D(org.gvsig.fmap.geom.primitive.Envelope envelope) |
static java.lang.String |
epsgToOracleSrid(java.lang.String epsg)
Get oracle srid from srs code(EPSG code)
|
static oracle.sql.STRUCT |
geometryToSTRUCT(org.gvsig.fmap.geom.Geometry geom,
java.sql.Connection conn,
int osrid,
boolean agu_b,
boolean hasSrid)
Utility method to convert a gvSIG Geometry into a oracle STRUCT
|
static java.lang.Object[] |
getCenterAndRadiousOfCirc(java.awt.geom.Point2D[] points)
Utility method to compute a circle's center and radius from three given
points.
|
static java.lang.String |
getCodeNumber(org.cresques.cts.IProjection p)
Gets the numeric code of a projection:
EPSG:4326 returns 4326
ESRI:1234 returns 1234
|
static java.lang.String |
getDerivedName(java.lang.String tname,
java.lang.String suffix) |
static oracle.sql.ARRAY |
getDevelopedInfoArray(oracle.sql.ARRAY info)
Utility method to deal with oracle info arrays.
|
static oracle.sql.ARRAY |
getDevelopedOrdsArray(oracle.sql.ARRAY ords,
int dim)
Utility method to deal with oracle coordinate arrays.
|
static java.lang.String |
getDimInfoAsString(oracle.sql.ARRAY dim_info) |
static org.gvsig.fmap.geom.primitive.Envelope |
getEarthEnvelope() |
static org.gvsig.fmap.geom.Geometry |
getFMapGeometryCollection(oracle.sql.Datum[] the_data,
int dim,
boolean tableHasSrid,
java.lang.String table_srid,
java.sql.Connection _conn) |
static org.gvsig.fmap.geom.Geometry |
getFMapGeometryMultiLineString(oracle.sql.Datum[] the_data,
int dim) |
static org.gvsig.fmap.geom.Geometry |
getFMapGeometryMultipolygon(oracle.sql.Datum[] the_data,
int dim) |
static org.gvsig.fmap.geom.Geometry |
getFMapGeometryPoint(oracle.sql.Datum[] the_data,
int dim) |
static org.gvsig.fmap.geom.Geometry |
getFMapGeometrySdoPoint(oracle.sql.Datum[] the_data,
int d) |
static java.lang.String |
getFormattedInteger(int n)
Utility method to get an ineteger as a formatted string.
|
static org.gvsig.fmap.geom.Geometry |
getGeometry(oracle.sql.STRUCT st,
boolean complex,
boolean __tablehassrid,
java.lang.String __tablesrid,
java.sql.Connection _conn)
Utility method to transform a struct into a IGeometry.
|
static int[] |
getGeoTypeSubTypeOfOracleCode(int code) |
static int[] |
getGeoTypeSubTypeOfStruct(oracle.sql.STRUCT sample) |
static int[] |
getGoodMergeCoupe(org.gvsig.fmap.geom.primitive.Envelope[] envs) |
static java.lang.Object[] |
getHolesForShells(java.util.List<LineString3D> all_ls)
This method tries to guess who is a shell and who is a hole from a set of
linestrings.
|
static java.lang.Object |
getId(org.gvsig.fmap.dal.feature.spi.FeatureReferenceProviderServices ref,
org.gvsig.fmap.dal.feature.FeatureType ft) |
static java.lang.String |
getIntersectsEnvelopeSelect(java.lang.String geo_col_name,
org.gvsig.fmap.geom.primitive.Envelope enve,
java.lang.String ora_srid,
boolean is_geo) |
static java.lang.String |
getIntersectsMultiRectSelect(java.lang.String geo_col_name,
org.gvsig.fmap.geom.Geometry geome,
java.lang.String ora_srid,
boolean is_geo,
java.sql.Connection conn) |
static boolean |
getIsGCS(java.lang.String oracleSRID2,
boolean thas)
Utility method to find out if a coordinate system is geodetic or not.
|
static oracle.sql.Datum[] |
getNthGroupOfThree(oracle.sql.Datum[] list,
int n) |
static int[] |
getNthGroupOfThree(int[] list,
int n) |
static java.lang.Object[] |
getOrdOfGroups(oracle.sql.Datum[] all,
java.lang.Object[] groups) |
static java.lang.Object[] |
getOrdOfGroups(double[] all,
java.lang.Object[] groups) |
static double[] |
getOrds(oracle.sql.Datum[] the_data)
Gets a struct's coordinates array.
|
static org.gvsig.fmap.geom.primitive.Primitive |
getPrimitive(oracle.sql.STRUCT st,
boolean complex)
Utility method to transform a struct into a IGeometry.
|
static java.lang.String |
getSdoConstructor(org.gvsig.fmap.geom.primitive.Envelope _enve,
java.lang.String ora_srid,
boolean is_geo) |
static java.lang.String |
getSdoConstructor(org.gvsig.fmap.geom.Geometry geome,
java.lang.String ora_srid,
boolean is_geo,
java.sql.Connection conn) |
static int |
getShapeTypeFromArray(java.util.ArrayList arrlist) |
static int |
getStructDimensions(oracle.sql.STRUCT st)
Gets the struct's dimension size.
|
static int |
getStructSRID(oracle.sql.Datum[] the_data)
Utility method to get struct's SRID.
|
static int |
getStructType(oracle.sql.Datum[] the_data)
Utility method to get struct's type.
|
static oracle.sql.Datum[] |
getSubSet(oracle.sql.Datum[] all,
int first_inc,
int last_inc) |
static double[] |
getSubSet(double[] all,
int first_inc,
int last_inc) |
static java.lang.Object[] |
groupByElement(oracle.sql.Datum[] all_elem) |
static java.lang.Object[] |
groupByElement(int[] all_elem) |
static boolean |
hasSeveralGeometryTypes(java.util.List tt,
boolean are_dims) |
static org.gvsig.fmap.geom.primitive.Envelope |
intersectEnvs(org.gvsig.fmap.geom.primitive.Envelope a,
org.gvsig.fmap.geom.primitive.Envelope b) |
static boolean |
isActuallyACollection(oracle.sql.Datum[] the_data) |
static boolean |
isCircle(oracle.sql.Datum[] the_data)
Utility method to find out if a struct is a circle.
|
static boolean |
isSimpleCollectionOfLines(oracle.sql.Datum[] all_elem) |
static int |
maxSizeForFieldType(int _type) |
static int |
oracleGTypeToFShapeType(int otype,
boolean complex)
Utility method.
|
static int |
oracleGTypeToGvsigGeometryType(int otype)
Utility method.
|
static java.lang.Integer |
oracleSridToEpsg(java.lang.String oraSRID)
Get EPSG SRS from Oracle SRS
|
static boolean |
polStructIsRectStruct(oracle.sql.ARRAY info,
oracle.sql.ARRAY ords)
Tells whether these arrays belong to a rectangle polygon.
|
static java.lang.String |
printArray(oracle.sql.NUMBER[] array) |
static void |
printStruct(oracle.sql.STRUCT st) |
static java.lang.String |
projectionToOracleSrid(org.cresques.cts.IProjection proj)
Get Oracle SRS from gvSIG projection
|
static org.gvsig.fmap.geom.Geometry |
readGeometry3D(java.net.URL filepath,
boolean polygon)
COnstructs a geometry from a file that contains a vertex per line:
x1 y1 z1 x2 y2 z2 ...
|
static oracle.sql.STRUCT |
rectangleToStruct(java.awt.geom.Rectangle2D r,
boolean hasSrid,
boolean isView,
boolean _isGeogCS,
java.lang.String osrid,
java.sql.Connection __conn) |
static oracle.sql.Datum[] |
removeThreeFirst(oracle.sql.Datum[] elem) |
static oracle.sql.STRUCT |
reprojectGeometry(java.sql.Connection conn,
oracle.sql.STRUCT fromStruct,
java.lang.String toSrid) |
static double[] |
reverseArray(double[] _z)
Utility method to reverse an array of doubles.
|
static com.vividsolutions.jts.geom.Coordinate[] |
reverseCoordinateArray(com.vividsolutions.jts.geom.Coordinate[] _z)
Utility method to reverse an array of coordinates
|
static org.gvsig.fmap.geom.Geometry |
roughIntersection(org.gvsig.fmap.geom.Geometry geom,
org.gvsig.fmap.geom.primitive.Envelope env) |
static void |
showMemory() |
static org.gvsig.fmap.geom.primitive.GeneralPathX |
structToGPX(oracle.sql.Datum[] aux)
utility method to convert a STRUCT into a GeneralPathX
|
static java.lang.String |
structToString(oracle.sql.STRUCT st) |
static oracle.sql.Datum[] |
updateIndexes(oracle.sql.Datum[] info) |
static int[] |
updateIndexes(int[] info) |
public static final java.awt.geom.Rectangle2D DEFAULT_BBOX
public static final java.awt.geom.Rectangle2D DEFAULT_BBOX_DEGREE
public static final java.awt.geom.Rectangle2D DEFAULT_BBOX_METER
public static final java.lang.String DIMENSIONS_ID
public static final java.lang.String ENVELOPE_ID
public static java.lang.String EXPONENTIAL_INDICES_CONDITION
public static oracle.sql.Datum[] appendDatArrays(oracle.sql.Datum[] head,
oracle.sql.Datum[] tail)
head - tail - public static oracle.sql.STRUCT appendGeometriesInStruct(org.gvsig.fmap.geom.Geometry[] geoms,
int _forced_type,
java.sql.Connection conn,
java.lang.String osrid,
boolean withSrid,
boolean agu_bien,
boolean _isGeoCS)
throws java.sql.SQLException
co - the geometry collection_forced_type - a type that has to be used as the struct's main type_conn - the connection_o_srid - the geometry's SRS (oracle code)withSrid - whether the SRS is non-NULLagu_bien - whether to check holes' validity_isGeoCS - whether the SRS is geodeticjava.sql.SQLExceptionpublic static int[] appendIntArrays(int[] head,
int[] tail)
head - tail - public static java.lang.String binaryUnionEnvs(org.gvsig.fmap.geom.primitive.Envelope[] enves,
java.lang.String ora_srid,
boolean is_geo,
java.lang.String tol,
java.sql.Connection conn,
int depth)
throws java.lang.Exception
envs - ora_srid - is_geo - geomDefaultTol - java.lang.Exceptionpublic static oracle.sql.STRUCT buildSTRUCT(org.gvsig.fmap.geom.Geometry geom,
int _forced_type,
java.sql.Connection conn,
java.lang.String osrid,
boolean withSrid,
boolean agu_bien,
boolean _isGeoCS)
geom - the geometry to convert_forced_type - forced type to use_conn - connection_o_srid - SRS (oracle code)withSrid - whether this STRUCT has a non-NULL SRSagu_bien - whether or not to check the correctness of the holes_isGeoCS - whether the SRS is geodetic or notjava.sql.SQLExceptionpublic static void copyFeatureTypeToOracleStoreParams(org.gvsig.fmap.dal.feature.EditableFeatureType efType,
OracleStoreParameters params)
public static org.gvsig.fmap.geom.Geometry createNullGeometry(int stype)
public static oracle.sql.STRUCT createStruct(oracle.sql.NUMBER type,
oracle.sql.NUMBER srid,
oracle.sql.Datum[] info,
oracle.sql.Datum[] ords,
java.sql.Connection conn)
type - struct typesrid - coordinate systeminfo - element info arrayords - coordinates arrayconn - connectionpublic static double determinant(double[][] a,
int n)
a - the matrixn - matrix sizepublic static int dimensionsFromSubtype(int subtype)
public static java.awt.geom.Rectangle2D doIntersect(java.awt.geom.Rectangle2D r1,
java.awt.geom.Rectangle2D r2)
r1 - r2 - public static org.gvsig.fmap.geom.Geometry envelopesToGeometry(java.util.ArrayList accum)
throws java.lang.Exception
accum - java.lang.Exceptionpublic static java.awt.geom.Rectangle2D envelopeToRectangle2D(org.gvsig.fmap.geom.primitive.Envelope envelope)
public static java.lang.String epsgToOracleSrid(java.lang.String epsg)
epsg - public static oracle.sql.STRUCT geometryToSTRUCT(org.gvsig.fmap.geom.Geometry geom,
java.sql.Connection conn,
int osrid,
boolean agu_b,
boolean hasSrid)
throws java.sql.SQLException
geom - the FShape objectc - the connectionsrid - the SRS (oracle code)agu_b - whether to check holes validityhasSrid - whether the SRS is non-NULLjava.sql.SQLExceptionpublic static java.lang.Object[] getCenterAndRadiousOfCirc(java.awt.geom.Point2D[] points)
points - three points of a circumferencepublic static java.lang.String getCodeNumber(org.cresques.cts.IProjection p)
p - public static java.lang.String getDerivedName(java.lang.String tname,
java.lang.String suffix)
tname - suffix - public static oracle.sql.ARRAY getDevelopedInfoArray(oracle.sql.ARRAY info)
public static oracle.sql.ARRAY getDevelopedOrdsArray(oracle.sql.ARRAY ords,
int dim)
public static java.lang.String getDimInfoAsString(oracle.sql.ARRAY dim_info)
dim_info - public static org.gvsig.fmap.geom.primitive.Envelope getEarthEnvelope()
public static org.gvsig.fmap.geom.Geometry getFMapGeometryCollection(oracle.sql.Datum[] the_data,
int dim,
boolean tableHasSrid,
java.lang.String table_srid,
java.sql.Connection _conn)
public static org.gvsig.fmap.geom.Geometry getFMapGeometryMultiLineString(oracle.sql.Datum[] the_data,
int dim)
throws org.gvsig.fmap.geom.exception.CreateGeometryException
the_data - dim - org.gvsig.fmap.geom.exception.CreateGeometryExceptionpublic static org.gvsig.fmap.geom.Geometry getFMapGeometryMultipolygon(oracle.sql.Datum[] the_data,
int dim)
throws org.gvsig.fmap.geom.exception.CreateGeometryException
the_data - dim - org.gvsig.fmap.geom.exception.CreateGeometryExceptionpublic static org.gvsig.fmap.geom.Geometry getFMapGeometryPoint(oracle.sql.Datum[] the_data,
int dim)
throws org.gvsig.fmap.geom.exception.CreateGeometryException
the_data - dim - org.gvsig.fmap.geom.exception.CreateGeometryExceptionpublic static org.gvsig.fmap.geom.Geometry getFMapGeometrySdoPoint(oracle.sql.Datum[] the_data,
int d)
throws org.gvsig.fmap.geom.exception.CreateGeometryException
the_data - d - org.gvsig.fmap.geom.exception.CreateGeometryExceptionpublic static java.lang.String getFormattedInteger(int n)
n - the integerpublic static org.gvsig.fmap.geom.Geometry getGeometry(oracle.sql.STRUCT st,
boolean complex,
boolean __tablehassrid,
java.lang.String __tablesrid,
java.sql.Connection _conn)
st - the struct to be convertedcomplex - comes from a complex sdo geometrypublic static int[] getGeoTypeSubTypeOfOracleCode(int code)
public static int[] getGeoTypeSubTypeOfStruct(oracle.sql.STRUCT sample)
throws java.sql.SQLException
sample - input STRUCTjava.sql.SQLExceptionpublic static int[] getGoodMergeCoupe(org.gvsig.fmap.geom.primitive.Envelope[] envs)
public static java.lang.Object[] getHolesForShells(java.util.List<LineString3D> all_ls)
all_ls - a set of linestrings to be checked.public static java.lang.Object getId(org.gvsig.fmap.dal.feature.spi.FeatureReferenceProviderServices ref,
org.gvsig.fmap.dal.feature.FeatureType ft)
public static java.lang.String getIntersectsEnvelopeSelect(java.lang.String geo_col_name,
org.gvsig.fmap.geom.primitive.Envelope enve,
java.lang.String ora_srid,
boolean is_geo)
public static java.lang.String getIntersectsMultiRectSelect(java.lang.String geo_col_name,
org.gvsig.fmap.geom.Geometry geome,
java.lang.String ora_srid,
boolean is_geo,
java.sql.Connection conn)
public static boolean getIsGCS(java.lang.String oracleSRID2,
boolean thas)
oracleSRID2 - the coordinate system's oracle codethas - whether the table has a coordinate system set. if not, the
method returns false.public static oracle.sql.Datum[] getNthGroupOfThree(oracle.sql.Datum[] list,
int n)
list - n - public static int[] getNthGroupOfThree(int[] list,
int n)
list - n - public static java.lang.Object[] getOrdOfGroups(oracle.sql.Datum[] all,
java.lang.Object[] groups)
throws java.sql.SQLException
all - groups - java.sql.SQLExceptionpublic static java.lang.Object[] getOrdOfGroups(double[] all,
java.lang.Object[] groups)
all - groups - public static double[] getOrds(oracle.sql.Datum[] the_data)
the_data - the struct's datum arraypublic static org.gvsig.fmap.geom.primitive.Primitive getPrimitive(oracle.sql.STRUCT st,
boolean complex)
st - the struct to be convertedcomplex - comes from a complex sdo geometrypublic static java.lang.String getSdoConstructor(org.gvsig.fmap.geom.primitive.Envelope _enve,
java.lang.String ora_srid,
boolean is_geo)
public static java.lang.String getSdoConstructor(org.gvsig.fmap.geom.Geometry geome,
java.lang.String ora_srid,
boolean is_geo,
java.sql.Connection conn)
public static int getShapeTypeFromArray(java.util.ArrayList arrlist)
public static int getStructDimensions(oracle.sql.STRUCT st)
st - the structpublic static int getStructSRID(oracle.sql.Datum[] the_data)
the_data - the struct's datum arraypublic static int getStructType(oracle.sql.Datum[] the_data)
the_data - the struct's datum arraypublic static oracle.sql.Datum[] getSubSet(oracle.sql.Datum[] all,
int first_inc,
int last_inc)
all - first_inc - last_inc - public static double[] getSubSet(double[] all,
int first_inc,
int last_inc)
all - first_inc - last_inc - public static java.lang.Object[] groupByElement(oracle.sql.Datum[] all_elem)
all_elem - public static java.lang.Object[] groupByElement(int[] all_elem)
all_elem - public static boolean hasSeveralGeometryTypes(java.util.List tt,
boolean are_dims)
tt - are_dims - public static org.gvsig.fmap.geom.primitive.Envelope intersectEnvs(org.gvsig.fmap.geom.primitive.Envelope a,
org.gvsig.fmap.geom.primitive.Envelope b)
throws java.lang.Exception
java.lang.Exceptionpublic static boolean isActuallyACollection(oracle.sql.Datum[] the_data)
the_data - public static boolean isCircle(oracle.sql.Datum[] the_data)
the_data - the struct's datum arraypublic static boolean isSimpleCollectionOfLines(oracle.sql.Datum[] all_elem)
all_elem - public static int maxSizeForFieldType(int _type)
_type - public static int oracleGTypeToFShapeType(int otype,
boolean complex)
otype - public static int oracleGTypeToGvsigGeometryType(int otype)
otype - public static java.lang.Integer oracleSridToEpsg(java.lang.String oraSRID)
oraSRID - public static boolean polStructIsRectStruct(oracle.sql.ARRAY info,
oracle.sql.ARRAY ords)
info - the struct's element info arrayords - the struct's coordinate arraypublic static java.lang.String printArray(oracle.sql.NUMBER[] array)
array - public static void printStruct(oracle.sql.STRUCT st)
st - public static java.lang.String projectionToOracleSrid(org.cresques.cts.IProjection proj)
proj - public static org.gvsig.fmap.geom.Geometry readGeometry3D(java.net.URL filepath,
boolean polygon)
throws org.gvsig.fmap.geom.exception.CreateGeometryException
filepath - vertices text file pathpolygon - whether it is a polygon or notorg.gvsig.fmap.geom.exception.CreateGeometryExceptionpublic static oracle.sql.STRUCT rectangleToStruct(java.awt.geom.Rectangle2D r,
boolean hasSrid,
boolean isView,
boolean _isGeogCS,
java.lang.String osrid,
java.sql.Connection __conn)
r - hasSrid - isView - _isGeogCS - _oracleSRID - __conn - public static oracle.sql.Datum[] removeThreeFirst(oracle.sql.Datum[] elem)
elem - public static oracle.sql.STRUCT reprojectGeometry(java.sql.Connection conn,
oracle.sql.STRUCT fromStruct,
java.lang.String toSrid)
conn - fromStruct - toSrid - public static double[] reverseArray(double[] _z)
_z - an array of doubles to be reversed.public static com.vividsolutions.jts.geom.Coordinate[] reverseCoordinateArray(com.vividsolutions.jts.geom.Coordinate[] _z)
_z - an array of coordinaes to be reversed.public static org.gvsig.fmap.geom.Geometry roughIntersection(org.gvsig.fmap.geom.Geometry geom,
org.gvsig.fmap.geom.primitive.Envelope env)
throws java.lang.Exception
java.lang.Exceptionpublic static void showMemory()
public static org.gvsig.fmap.geom.primitive.GeneralPathX structToGPX(oracle.sql.Datum[] aux)
aux - the struct's datum arraypublic static java.lang.String structToString(oracle.sql.STRUCT st)
throws java.lang.Exception
java.lang.Exceptionpublic static oracle.sql.Datum[] updateIndexes(oracle.sql.Datum[] info)
info - public static int[] updateIndexes(int[] info)
info - Copyright © 2013 gvSIG Association. All Rights Reserved.