|
Oracle® Spatial Java API Reference 11g Release 1 (11.1) B28401-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.spatial.geometry.JGeometry
oracle.spatial.geometry.J3D_Geometry
public class J3D_Geometry
Nested Class Summary |
---|
Nested classes/interfaces inherited from class oracle.spatial.geometry.JGeometry |
---|
JGeometry.Point |
Field Summary | |
---|---|
static int |
ETYPE_COMPOSITEPOLYGON |
static int |
ETYPE_COMPOSITESOLID |
static int |
ETYPE_COMPOSITESURFACE |
static int |
ETYPE_POLYGON |
static int |
ETYPE_SOLID |
static int |
ETYPE_SURFACE |
static int |
GTYPE_MULTISOLID |
static int |
GTYPE_MULTISURFACE |
static int |
GTYPE_SOLID |
static int |
GTYPE_SURFACE |
Fields inherited from class oracle.spatial.geometry.JGeometry |
---|
GTYPE_COLLECTION, GTYPE_CURVE, GTYPE_MULTICURVE, GTYPE_MULTIPOINT, GTYPE_MULTIPOLYGON, GTYPE_POINT, GTYPE_POLYGON |
Constructor Summary | |
---|---|
J3D_Geometry(int gtype, int srid, double x, double y, double z) |
|
J3D_Geometry(int gtype, int srid, int[] elemInfo, double[] ordinates) |
Method Summary | |
---|---|
boolean |
anyInteract(J3D_Geometry A, double tolerance) User Interface for anyInteract between two 3-D geometries. |
boolean |
anyInteract2(J3D_Geometry A, boolean[] is_solid, boolean[] polygons, boolean[] holes, double tolerance) |
static JGeometry |
appendToCollection(JGeometry collGeom, JGeometry scGeom) Returns a collection or multi-x geometry by appending simple (x) geometries in 3-D. |
double |
area(double tolerance) User interface for the area function. |
java.util.ArrayList |
closestPoints(J3D_Geometry A, double tolerance) User interface for computing the closest points of approach between two 3-D geometries. |
double |
distance(J3D_Geometry A, double tolerance) User Interface for minimum distance between two 3-D geometries. |
double[] |
distCpa(J3D_Geometry A, double tolerance) Returns the closest points of approach (and hence the minimum distance) between two J3D_Geometry geometries. |
double[] |
distCpa2(J3D_Geometry A, boolean[] is_solid, boolean[] polygons, boolean[] holes, double tolerance) |
static JGeometry |
extrusion(JGeometry polygon, double[] grdHeight, double[] height, java.sql.Connection conn, boolean cond, double tolerance) |
static JGeometry |
extrusion(JGeometry polygon, double grdHeight, double height, java.sql.Connection conn, boolean cond, double tolerance) Returns the extruded 3-D geometry from a 2-D polygon. |
static JGeometry |
extrusion2(JGeometry polygon, double[] grdHeight, double[] height, java.sql.Connection conn, boolean cond, double tolerance) |
static JGeometry |
extrusion2(JGeometry polygon, double grdHeight, double height, java.sql.Connection conn, boolean cond, double tolerance) |
double |
getAreaPolygon() |
void |
getFlags(J3D_Geometry simplegeom, boolean[] is_solid, boolean[] polygons, boolean[] holes) |
static double[][] |
getMBH(J3D_Geometry geom1) Returns the 3-D MBH of a 3-D geometry in a two-dimensional array. |
double |
length(int count_shared_edges, double tolerance) User interface for the length function. |
static void |
main(java.lang.String[] args) END OF APPEND |
java.lang.String |
validate(boolean CONDITIONAL, double tolerance) Returns whether a 3-D geometry is valid or not. |
double |
volume(double tolerance) User interface for the volume function. |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int GTYPE_SURFACE
public static final int GTYPE_SOLID
public static final int GTYPE_MULTISOLID
public static final int GTYPE_MULTISURFACE
public static final int ETYPE_POLYGON
public static final int ETYPE_SURFACE
public static final int ETYPE_COMPOSITEPOLYGON
public static final int ETYPE_COMPOSITESURFACE
public static final int ETYPE_SOLID
public static final int ETYPE_COMPOSITESOLID
Constructor Detail |
---|
public J3D_Geometry(int gtype, int srid, int[] elemInfo, double[] ordinates)
public J3D_Geometry(int gtype, int srid, double x, double y, double z)
Method Detail |
---|
public boolean anyInteract(J3D_Geometry A, double tolerance) throws java.lang.Exception
Basic Idea: Decompose each geometry into simple components and then call anyInteract2. The elementExtractor's used here operate with allow_comp_sub_elements set to FALSE.
A
- Another J3D_Geometry geometrytolerance
-java.lang.Exception
public void getFlags(J3D_Geometry simplegeom, boolean[] is_solid, boolean[] polygons, boolean[] holes) throws java.lang.Exception
java.lang.Exception
public static double[][] getMBH(J3D_Geometry geom1)
Our MBH's are axis parallel. If needed, we should extend this to arbitrary orientation. The main reason why we chose axis parallel MBHs is that axis parallel version has cheaper operations. Similarly, we can use convex hulls instead of MBHs to represent a better approximation of geometries.
geom1
- The 3-D geometrypublic boolean anyInteract2(J3D_Geometry A, boolean[] is_solid, boolean[] polygons, boolean[] holes, double tolerance) throws java.lang.Exception
java.lang.Exception
public double distance(J3D_Geometry A, double tolerance) throws java.lang.Exception
Calls distCpa to compute the closest points of approach and then minimum distance. The elementExtractor's used here operate with allow_comp_sub_elements set to FALSE.
A
- Another 3-D geometrytolerance
-java.lang.Exception
public double[] distCpa(J3D_Geometry A, double tolerance) throws java.lang.Exception
Algorithm: Input: geom1 and geom2 If geometries anyInteract, then: Return cpa = 0; Else: Compute the closest points of approach P1 and P2 between the two geometries geom1 and geom2 WITH considering polygon holes in polygons and solid holes in solids. The elementExtractor's used here operate with allow_comp_sub_elements set to FALSE.
A
- Another 3-D geometrytolerance
-java.lang.Exception
public double[] distCpa2(J3D_Geometry A, boolean[] is_solid, boolean[] polygons, boolean[] holes, double tolerance) throws java.lang.Exception
java.lang.Exception
public java.lang.String validate(boolean CONDITIONAL, double tolerance) throws java.lang.Exception
The children of a geometry are done first here (aka self-validation). Then, the cross-validation is done. The label is stored backwards such that arrayList has pointID, edgeID, ringID, polygonID, csurfID, solidID, multiID. The elementExtractor's used here operate with allow_comp_sub_elements set to TRUE (default) because we would like to return comp-x in multi-x. ElementExtractor errors are caught ONLY here but not in crossElementValidation because each geometry has to go through elementExtractor before calling crossElementValidation function.
Composite surface is expected to be:
Composite solid should be of the form:
The input parameter CONDITIONAL refers to rule for composite surface such that if two outerrings are on the same plane and share an edge, we return error if CONDITIONAL is set to TRUE. Note that the PL/SQL interface of validate function i.e., validate_geometry_with_context and validate_layer_with_context set this conditional input to TRUE by default. The elementExtractor's used here operate with allow_comp_sub_elements set to TRUE (default).
When modeling a simple solid, each face of the solid must have full-edge intersection with its neighbor faces. Othwerwise, reachability test will catch this situation and report it as an error.
CONDITIONAL
- (explained above)tolerance
-java.lang.Exception
public double volume(double tolerance) throws java.lang.Exception
First outer solid volume is computed, and then the inner solid volumes are subtracted from the outer solid volume. If there are no solids in the geometry, then it returns 0.
The elementExtractor's used here operate with allow_comp_sub_elements set to FALSE.
tolerance
-java.lang.Exception
public java.util.ArrayList closestPoints(J3D_Geometry A, double tolerance) throws java.lang.Exception
The elementExtractor's used here operate with allow_comp_sub_elements set to FALSE.
A
- Another 3-D geometrytolerance
-java.lang.Exception
public double area(double tolerance) throws java.lang.Exception
Similar approach in validate for getting all surfaces. Returns 0 if there are only points and/or lines in the geometry. Later, if there are (partially or fully) shared faces, depending on the value of input parameter count_shared_areas, count these shared faces either: twice, which means you dont need to update area value baceuse we already counted them 2ice, or (LATER) once, which means you need to subtract the shared area from the area value, or (LATER) zero times, which means you need to subtract twice the shared area from the area value.
Please note that the subtraction of areas is the problem only for composite solids because they are the only geometry that can have shared areas and this problem is not trivial.
The elementExtractor's used here operate with allow_comp_sub_elements set to FALSE in case of non-collection geometry and set to TRUE in case of collection geometry.
tolerance
- Tolerance value.java.lang.Exception
public double getAreaPolygon() throws java.lang.Exception
java.lang.Exception
public double length(int count_shared_edges, double tolerance) throws java.lang.Exception
Similar approach in validate for getting all surfaces. Returns 0 if there are only points in the geometry. Then, find the coinciding (shared) edges (by the help of RTree as in the orientation check of validate function). If there are such (partially or fully) shared edges, depending on the value of input parameter count_shared_edges, count these shared edges either: twice, which means you dont need to update length value baceuse we already counted them 2ice, or once, which means you need to subtract the shared length from the length value, or (LATER) zero times, which means you need to subtract twice the shared length from the length value.
The elementExtractor's used here operate with allow_comp_sub_elements set to FALSE in case of non-collection geometry and set to TRUE in case of collection geometry.
If collection has line segment geometry(s) which are also shared by solid geometry(s), then the length of the line segment geometry(s) are not subtracted when count_shared_edges parameter is 1.
count_shared_edges
- (explained above)tolerance
- Tolerance value.java.lang.Exception
public static JGeometry extrusion(JGeometry polygon, double grdHeight, double height, java.sql.Connection conn, boolean cond, double tolerance) throws java.lang.Exception, java.sql.SQLException
We expect:
Please note that if there is a single grdHeight value and a single height value for all of the polygon vertices, we replicate grdHeight and height values for each polygon vertex and call original extrusion method.
For optimized rectangle 2-D polygon (ring) input: the user should give either one height value and one ground height value or 5 element double array for height and 5 element double array for ground height. Otherwise, an error will received. We expand optimized rectangle in CCW orientation. The 5 element arrays must be given in corresponding order with expanded polygon.
polygon
- The polygon w/ hole(s) or outer ring of a 2-D polygon.grdHeight
- A single value or an array of ground height valuesheight
- A single value or an array of ground height valuesconn
- The database connection for calling pl/sql function mdsys.sdo_cs.convert_2d_srid_to_3d to determine the 3-D srid of the new extruded solidcond
- CONDITIONAL flag to validate the ring of the 2-D polygontolerance
-java.lang.Exception
java.sql.SQLException
public static JGeometry extrusion(JGeometry polygon, double[] grdHeight, double[] height, java.sql.Connection conn, boolean cond, double tolerance) throws java.lang.Exception, java.sql.SQLException
java.lang.Exception
java.sql.SQLException
public static JGeometry extrusion2(JGeometry polygon, double grdHeight, double height, java.sql.Connection conn, boolean cond, double tolerance) throws java.lang.Exception, java.sql.SQLException
java.lang.Exception
java.sql.SQLException
public static JGeometry extrusion2(JGeometry polygon, double[] grdHeight, double[] height, java.sql.Connection conn, boolean cond, double tolerance) throws java.lang.Exception, java.sql.SQLException
java.lang.Exception
java.sql.SQLException
public static JGeometry appendToCollection(JGeometry collGeom, JGeometry scGeom) throws java.lang.Exception
The outGeom could be collection or multi geometry. The scGeom is either "s"imple or "c"omposite geometry. We append scGeom to collGeom in outGeom, which is the output, as long as the following rules are satisfied:
Use append PL/SQL interface instead of this function.
collGeom
- A collection or multi geometryscGeom
- A simple or composite geometryjava.lang.Exception
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
Oracle® Spatial Java API Reference 11g Release 1 (11.1) B28401-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |