|
Oracle® Spatial Java API Reference 11g Release 1 (11.1) B28401-02 |
||||||||
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) Returns whether two 3-D geometries anyInteract or not. |
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) Returns the total planar surface area of a 3-D geometry. |
J3D_Geometry |
centroid3d(double tolerance) Returns the centroid aka center of mass, center of gravity of solid 3-D geometry of uniform material density. |
java.util.ArrayList |
closestPoints(J3D_Geometry A, double tolerance) Returns the closest points of approach between two 3-D geometries. |
double |
distance(J3D_Geometry A, double tolerance) Returns the 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) Returns the extruded 3-D geometry from a 2-D polygon. |
static JGeometry |
extrusion(JGeometry polygon, double[] grdHeight, double[] height, java.sql.Connection conn, boolean cond, double tolerance, int optional3dSrid) Returns the extruded 3-D geometry from a 2-D polygon. |
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 |
extrusion(JGeometry polygon, double grdHeight, double height, java.sql.Connection conn, boolean cond, double tolerance, int optional3dSrid) Returns the extruded 3-D geometry from a 2-D polygon. |
J3D_Geometry |
getElementByLabel(java.lang.String label) Returns the sub-geometry indicated by the label string. |
void |
getFlags(J3D_Geometry simplegeom, boolean[] is_solid, boolean[] polygons, boolean[] holes) |
boolean |
inside3d(J3D_Geometry solid2, double tolerance) Returns whether the first solid is inside the second solid or not. |
double |
length(double tolerance) Returns the perimeter of a 3-D geometry. |
double |
length(int count_shared_edges, double tolerance) Returns the perimeter of a 3-D geometry. |
java.lang.String |
validate(boolean CONDITIONAL, double tolerance) Returns whether a 3-D geometry is valid or not. |
double |
volume(double tolerance) Returns the volume of a 3-D geometry. |
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
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 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 length(double tolerance) throws java.lang.Exception
Similar approach in validate for getting all surfaces. Returns 0 if there are only points in the geometry.
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.
tolerance
- Tolerance value.java.lang.Exception
public double length(int count_shared_edges, double tolerance) throws java.lang.Exception
Returns 0 if there are only points in the geometry. Then, find the coinciding (shared) edges. 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:
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, int optional3dSrid) 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 valueheight
- A single valueconn
- 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
-optional3dSrid
- If resultant 3D srid is known, that 3D srid can be input. It is the responsibility of user to verify this srid.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
We expect:
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
- An array of ground height valuesheight
- 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, int optional3dSrid) 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
- An array of ground height valuesheight
- 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
-optional3dSrid
- If resultant 3D srid is known, that 3D srid can be input. It is the responsibility of user to verify this srid.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 J3D_Geometry centroid3d(double tolerance) throws java.lang.Exception
If input geometry is a collection or any curve, we return the zero point.
The inner solid boundaries are treated like negative volumes (i.e.,masses with unit density). First, the centroids of outer solid boundaries are found. Then, we combine the centroids of outer solid boundaries into the global (net) centroid. Similarly, we do the same for inner solid boundaries. Then, the net (global) centroid will be combination of these two centroids by treating the one belonging to the inner solid boundaries as -ive mass. The centroid of any two objects lie on the line segment connecting them.
The above approach is valid for polygons.
For polygons/surfaces/solids, we shift all the coordinates WRT to the center of the MBR(geometry). This shift is done to avoid the round off errors in the area computation. The center of overall geometry (this) is added to the gloabl (net) centroid at the end. We donot need to restore the original geometry back to the input state since we donot modify input geometry.
tolerance
- User tolerancejava.lang.Exception
public boolean inside3d(J3D_Geometry solid2, double tolerance) throws java.lang.Exception
Inner solids of first solid are ignored. Composite solids are treated like multi-solids such that if the point is on a shared face of second solid which is composite-solid, then the point is considered to be outside second solid.
solid2
- Another 3-D solid geometry (i.e., second solid)tolerance
- User tolerancejava.lang.Exception
public J3D_Geometry getElementByLabel(java.lang.String label) throws java.lang.Exception
label
- The label indicating the sub-geometry that the user wants to extract. A generic label could be: pointID,edgeID,ringID,polygonID,csurfID,solidID,multiIDjava.lang.Exception
|
Oracle® Spatial Java API Reference 11g Release 1 (11.1) B28401-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |