public class J3D_Geometry extends JGeometry
JGeometry.Point
Modifier and Type | Field and Description |
---|---|
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 |
GTYPE_COLLECTION, GTYPE_CURVE, GTYPE_MULTICURVE, GTYPE_MULTIPOINT, GTYPE_MULTIPOLYGON, GTYPE_POINT, GTYPE_POLYGON
Constructor and Description |
---|
J3D_Geometry(int gtype, int srid, double x, double y, double z) |
J3D_Geometry(int gtype, int srid, double x, double y, double z, int[] elemInfo, double[] ordinates) |
J3D_Geometry(int gtype, int srid, int[] elemInfo, double[] ordinates) |
Modifier and Type | Method and Description |
---|---|
boolean |
anyInteract(J3D_Geometry A, double tolerance)
Returns whether two 3-D (Cartesian) geometries anyInteract or not.
|
boolean |
anyInteract(J3D_Geometry A, double tolerance, java.lang.String is_g3d)
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.
|
double |
area(double tolerance, java.lang.String is_g3d, double smax, double flat, double geog_crs_uom_factor)
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.
|
void |
clearBelongingGeometry() |
java.util.ArrayList |
closestPoints(J3D_Geometry A, double tolerance)
Returns the closest points of approach between two 3-D (Cartesian) geometries.
|
java.util.ArrayList |
closestPoints(J3D_Geometry A, double tolerance, java.lang.String is_g3d, double smax, double flat, double geog_crs_uom_factor)
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 (Cartesian) geometries.
|
double |
distance(J3D_Geometry A, double tolerance, java.lang.String is_g3d, double smax, double flat, double geog_crs_uom_factor)
Returns the minimum distance between two 3-D geometries.
|
double[] |
distCpa(J3D_Geometry A, double tolerance, java.lang.String is_g3d, double smax, double flat, double geog_crs_uom_factor)
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, java.lang.String is_g3d) |
static J3D_Geometry |
expandGeom(J3D_Geometry geometry)
Returns the expanded geometry.
|
static JGeometry |
extrusion(JGeometry polygon, double[] grdHeight, double[] height, java.sql.Connection conn, 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, 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, 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, double tolerance, int optional3dSrid)
Returns the extruded 3-D geometry from a 2-D polygon.
|
J3D_Geometry |
getBelongingGeometry() |
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) |
java.lang.String |
getLabelByElement(J3D_Geometry qryElement, double tolerance)
Computes the corresponding sub-geometry's label within the geometry.
|
boolean |
inside3d(J3D_Geometry solid2, double tolerance)
Returns whether the first Cartesian geometry is inside the solid (second Cartesian geometry) or not.
|
boolean |
inside3d(J3D_Geometry solid2, double tolerance, java.lang.String is_g3d)
Returns whether the first geometry is inside the solid (second geometry) or not.
|
double |
length(double tolerance)
Returns the perimeter of a 3-D geometry.
|
double |
length(double tolerance, java.lang.String is_g3d, double smax, double flat, double geog_crs_uom_factor)
Returns the perimeter of a 3-D geometry.
|
double |
length(int count_shared_edges, double tolerance)
Returns the perimeter of a 3-D geometry.
|
double |
length(int count_shared_edges, double tolerance, java.lang.String is_g3d, double smax, double flat, double geog_crs_uom_factor)
Returns the perimeter of a 3-D geometry.
|
boolean |
pointInPolygon(J3D_Geometry geom, double tolerance) |
static J3D_Geometry |
projectToGnomonicFromLongLat(J3D_Geometry P, double central_longitude, double central_latitude) |
void |
setBelongingGeometry(J3D_Geometry geom) |
java.lang.String |
validate(boolean CONDITIONAL, double tolerance)
Returns whether a 3-D (Cartesian) geometry is valid or not.
|
java.lang.String |
validate(boolean CONDITIONAL, double tolerance, java.lang.String is_g3d)
Returns whether a 3-D geometry is valid or not.
|
double |
volume(double tolerance)
Returns the volume of a 3-D (Cartesian) geometry.
|
double |
volume(double tolerance, java.lang.String is_g3d, double smax, double flat, double geog_crs_uom_factor)
Returns the volume of a 3-D geometry.
|
affineTransforms, anyInteract, anyInteract, buffer, buffer, buffer, byteArrayToHexString, centralLongLatforGNMProjection, circle_polygon, circle_polygon, clone, computeArc, concaveHullDig, convexHull, createArc2d, createCircle, createCircle, createDoubleShape, createDoubleShape, createLinearLineString, createLinearMultiLineString, createLinearPolygon, createLinearPolygon, createLRSLinearLineString, createLRSLinearMultiLineString, createLRSLinearPolygon, createLRSLinearPolygon, createLRSPoint, createMultiPoint, createNURBScurve, createPoint, createShape, createShape, createShape, densifyArcs, densifyArcs, densifyGeodesic, densifyGeodesic, distance, distance, equals, expandCircle, fitArc, geodetic3DLength, geodetic3DLength, getCoordSysInfo, getDimensions, getElementAt, getElements, getElemInfo, getFirstPoint, getGeomDescriptor, getJavaPoint, getJavaPoints, getLabelPoint, getLabelPointXYZ, getLastPoint, getLRMDimension, getMBR, getNumPoints, getNurbsApprox, getOracleDescriptors, getOracleDescriptorsStr, getOrdinatesArray, getOrdinatesOfElements, getOrientMultiPointOffset, getPoint, getSize, getSRID, getType, hasCircularArcs, isCircle, isGeodetic, isGeodeticMBR, isInside, isInside, isLRSGeometry, isMultiPoint, isOrientedMultiPoint, isOrientedPoint, isPoint, isRectangle, linearizeArc, linearizeArc, linearizeArc, linearizeArc, load, loadJS, make_2d, make_3d, make_3dgeom, make_3dgeom, monoMeasure, projectArrayToGNM, projectFromGNM_longLat, projectFromLTP, projectToGNM_longLat, projectToGNM_longLat, projectToLTP, projectToLTP, reFormulateArc, setLRMDimension, setSRID, setType, simplify, simplify, simplifyVW, simplifyVW, simplifyVW, simplifyVW, store, store, store, store, store, store, store, storeJS, storeJS, storeJS, storeJS, storeJS, tfm_8307_to_PopularMercator, tfm_8307_to_PopularMercator, tfm_PopularMercator_to_8307, tfm_PopularMercator_to_8307, toGeoJson, toString, toStringFull, toStringFull
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
public J3D_Geometry(int gtype, int srid, int[] elemInfo, double[] ordinates)
public J3D_Geometry(int gtype, int srid, double x, double y, double z)
public J3D_Geometry(int gtype, int srid, double x, double y, double z, int[] elemInfo, double[] ordinates)
public void setBelongingGeometry(J3D_Geometry geom)
public J3D_Geometry getBelongingGeometry()
public void clearBelongingGeometry()
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. This signature assumes data are not in Geographic3D space.
A
- Another J3D_Geometry geometrytolerance
-java.lang.Exception
public boolean anyInteract(J3D_Geometry A, double tolerance, java.lang.String is_g3d) throws java.lang.Exception
The elementExtractor's used here operate with allow_comp_sub_elements set to FALSE.
If data are Geographic3D (by setting is_g3d as TRUE), then Gnomonic transformation (projection) is carried out here. The tolerance value is set to 0.05 in Gnomonic transformation no matter what the user input tolerance is.
Geodetic/Geographic 3D geometries should not span long distances.
A
- Another J3D_Geometry geometrytolerance
-is_g3d
- Flag to denote whether input geometries are Geodetic/Geographic 3D or not (TRUE/FALSE)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 pointInPolygon(J3D_Geometry geom, double tolerance)
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 distance(J3D_Geometry A, double tolerance, java.lang.String is_g3d, double smax, double flat, double geog_crs_uom_factor) 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
-is_g3d
- Flag to denote whether input geometries are Geodetic/Geographic 3D or not (TRUE/FALSE)smax
- Semi Major Axis constant (Used when is_g3d is TRUE)flat
- Flattenning constant (Used when is_g3d is TRUE)geog_crs_uom_factor
- Height factor due to SRIDjava.lang.Exception
public double[] distCpa(J3D_Geometry A, double tolerance, java.lang.String is_g3d, double smax, double flat, double geog_crs_uom_factor) throws java.lang.Exception
Algorithm: Input: geom1 and geom2 If geometries anyInteract, then: Return cpa = null; 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
-is_g3d
- Flag to denote whether input geometries are Geodetic/Geographic 3D or not (TRUE/FALSE)smax
- Semi Major Axis constant (Used when is_g3d is TRUE)flat
- Flattenning constant (Used when is_g3d is TRUE)geog_crs_uom_factor
- Height factor due to SRIDjava.lang.Exception
public double[] distCpa2(J3D_Geometry A, boolean[] is_solid, boolean[] polygons, boolean[] holes, double tolerance, java.lang.String is_g3d) throws java.lang.Exception
java.lang.Exception
public static J3D_Geometry projectToGnomonicFromLongLat(J3D_Geometry P, double central_longitude, double central_latitude) 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: >li< > , 1006, N< >/li< >li< N tuples of the form >/li< >li< >, 1003, x< >, 2003, x<* >/li<
Composite solid should be of the form: >li< > , 1008, N< >/li< >li< N solids each of the form >/li< >li< >, 1007, < specified using 1 outer surface and N inner surfaces >/li< >li< >, 1006, M< and M tuples of the form >,1003, < m times >/li< followed by 0 or more inner solids specified as surfaces as: >/li< >li< >, 2006, p< and p tuples of the form >,2003, < >/li<
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.
This signature assumes data are not in Geographic3D space.
CONDITIONAL
- (explained above)tolerance
-java.lang.Exception
public java.lang.String validate(boolean CONDITIONAL, double tolerance, java.lang.String is_g3d) 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: >li< > , 1006, N< >/li< >li< N tuples of the form >/li< >li< >, 1003, x< >, 2003, x<* >/li<
Composite solid should be of the form: >li< > , 1008, N< >/li< >li< N solids each of the form >/li< >li< >, 1007, < specified using 1 outer surface and N inner surfaces >/li< >li< >, 1006, M< and M tuples of the form >,1003, < m times >/li< followed by 0 or more inner solids specified as surfaces as: >/li< >li< >, 2006, p< and p tuples of the form >,2003, < >/li<
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.
If data are Geographic3D (by setting is_g3d as TRUE), then Gnomonic transformation (projection) is carried out here. The tolerance value is set to 0.05 in Gnomonic transformation no matter what the user input tolerance is.
Geodetic/Geographic 3D geometries should not span long distances.
CONDITIONAL
- (explained above)tolerance
-is_g3d
- Flag to denote whether input geometries are Geodetic/Geographic 3D or not (TRUE/FALSE)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.
public double volume(double tolerance, java.lang.String is_g3d, double smax, double flat, double geog_crs_uom_factor) 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.
If data is Geographic 3D, we only convert it to Cartesian coordinates and return the volume in the Cartesian space. If the geometry is larger than US street block size, there could be inaccuracies.
tolerance
-is_g3d
- Flag to denote whether input geometries are Geodetic/Geographic 3D or not (TRUE/FALSE)smax
- Semi Major Axis constant (Used when is_g3d is TRUE)flat
- Flattenning constant (Used when is_g3d is TRUE)geog_crs_uom_factor
- Height factor due to SRIDjava.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 java.util.ArrayList closestPoints(J3D_Geometry A, double tolerance, java.lang.String is_g3d, double smax, double flat, double geog_crs_uom_factor) throws java.lang.Exception
The elementExtractor's used here operate with allow_comp_sub_elements set to FALSE.
A
- Another 3-D geometrytolerance
-is_g3d
- Flag to denote whether input geometries are Geodetic/Geographic 3D or not (TRUE/FALSE)smax
- Semi Major Axis constant (Used when is_g3d is TRUE)flat
- Flattenning constant (Used when is_g3d is TRUE)geog_crs_uom_factor
- Height factor due to SRIDjava.lang.Exception
public double area(double tolerance) throws java.lang.Exception
Please note that the area of shared surfaces in composite solids will be double-counted.
If data is Geographic 3D, the computation is currently done on a linear tangent plane, which introduces inaccuracies on objects of city size or larger. This may change in later releases.
public double area(double tolerance, java.lang.String is_g3d, double smax, double flat, double geog_crs_uom_factor) throws java.lang.Exception
Please note that the area of shared surfaces in composite solids will be double-counted.
If data is Geographic 3D, the computation is currently done on a linear tangent plane, which introduces inaccuracies on objects of city size or larger. This may change in later releases.
tolerance
- tolerance valueis_g3d
- Flag to denote whether input geometries are Geodetic/Geographic 3D or not (TRUE/FALSE)smax
- Semi Major Axis constant (Used when is_g3d is TRUE)flat
- Flattenning constant (Used when is_g3d is TRUE)geog_crs_uom_factor
- Height factor due to SRIDjava.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.
public double length(double tolerance, java.lang.String is_g3d, double smax, double flat, double geog_crs_uom_factor) 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.is_g3d
- Flag to denote whether input geometries are Geodetic/Geographic 3D or not (TRUE/FALSE)smax
- Semi Major Axis constant (Used when is_g3d is TRUE)flat
- Flattenning constant (Used when is_g3d is TRUE)geog_crs_uom_factor
- Height factor due to SRIDjava.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 double length(int count_shared_edges, double tolerance, java.lang.String is_g3d, double smax, double flat, double geog_crs_uom_factor) 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.is_g3d
- Flag to denote whether input geometries are Geodetic/Geographic 3D or not (TRUE/FALSE)smax
- Semi Major Axis constant (Used when is_g3d is TRUE)flat
- Flattenning constant (Used when is_g3d is TRUE)geog_crs_uom_factor
- Height factor due to SRIDjava.lang.Exception
public static JGeometry extrusion(JGeometry polygon, double grdHeight, double height, java.sql.Connection conn, double tolerance) throws java.lang.Exception, java.sql.SQLException
We expect: >li< A 2-D polygon w/ hole(s) or (outer) ring geometry in JGeometry (which will be the base of the solid that we will output): --< In case of ring: This 2-D polygon (ring) input must be oriented in CCW (on x-y plane) and could be optimized rectangle. When we convert this 2-D polygon (ring) input to the 3-D polygon by adding z=0 coordinates to each vertex, we also check/validate that the orientation of the input polygon (ring) must be CCW on x-y plane and thus it must result +ive value from the dot-product of the normal of this polygon with the unit vector in the direction of +z axis; --< In case of polygon w/ hole(s): The outer ring must be CCW oriented and inner rings must be CW oriented. We partition this polygon w/ hole(s) into outer rings such that it becomes composite surface without hole(s). In other words, we get rid of hole(s) in the input polygon w/ hole(s). Then, we apply extrusion for (an outer) ring procedure for each ring in this composite surface (comes as collection) and then output the resulting solid as composite solid. It must be noted that in this case user can either input a single grdHeight value and a single height value or grdHeight values and height values ONLY for the outer ring (we interpret those for inner ring(s)) since from satellite images if there are hole(s) in the image, the hole goes *all* the way down and since we donot allow patches on solids, we do the conversion from polygon w/ hole(s) to composite surface; and >/li< >li< A two double numbers of z-values where the first number is for ground height (i.e., the z-value for a vertex of the bottom face of the solid that we will output) and the second number is for height (i.e., the z-value for a vertex of the top face of the same solid that we will output). The height entry for a vertex is always greater or equal to the ground height entry for a vertex. If this is not so, we will issue an error. The extrusion is always either along +z or -z axis. First the newly extruded output solid's bottom face coordinate array, then top face coordinate array, and then side faces' coordinate are formed. >/li< >li< The parameter tolerance is for validating the input 2D polygon. The parameter cond is deprecated, always use "FALSE" value for cond parameter. >/li< >li< The connection parameter conn is to run the PL/SQL functions such as convert_2D_srid_to_3D to get the 3-D srid of output geometry wrt 2-D srid of input polygon. For Geodetic, we assume the unit is meter for z values and for projected we assume that it is the same unit as the projected SRID unit. >/li< 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 solid //@param cond Deprecated, always use "FALSE" value.tolerance
-java.lang.Exception
java.sql.SQLException
public static JGeometry extrusion(JGeometry polygon, double grdHeight, double height, java.sql.Connection conn, double tolerance, int optional3dSrid) throws java.lang.Exception, java.sql.SQLException
We expect: >li< A 2-D polygon w/ hole(s) or (outer) ring geometry in JGeometry (which will be the base of the solid that we will output): --< In case of ring: This 2-D polygon (ring) input must be oriented in CCW (on x-y plane) and could be optimized rectangle. When we convert this 2-D polygon (ring) input to the 3-D polygon by adding z=0 coordinates to each vertex, we also check/validate that the orientation of the input polygon (ring) must be CCW on x-y plane and thus it must result +ive value from the dot-product of the normal of this polygon with the unit vector in the direction of +z axis; --< In case of polygon w/ hole(s): The outer ring must be CCW oriented and inner rings must be CW oriented. We partition this polygon w/ hole(s) into outer rings such that it becomes composite surface without hole(s). In other words, we get rid of hole(s) in the input polygon w/ hole(s). Then, we apply extrusion for (an outer) ring procedure for each ring in this composite surface (comes as collection) and then output the resulting solid as composite solid. It must be noted that in this case user can either input a single grdHeight value and a single height value or grdHeight values and height values ONLY for the outer ring (we interpret those for inner ring(s)) since from satellite images if there are hole(s) in the image, the hole goes *all* the way down and since we donot allow patches on solids, we do the conversion from polygon w/ hole(s) to composite surface; and >/li< >li< A two double numbers of z-values where the first number is for ground height (i.e., the z-value for a vertex of the bottom face of the solid that we will output) and the second number is for height (i.e., the z-value for a vertex of the top face of the same solid that we will output). The height entry for a vertex is always greater or equal to the ground height entry for a vertex. If this is not so, we will issue an error. The extrusion is always either along +z or -z axis. First the newly extruded output solid's bottom face coordinate array, then top face coordinate array, and then side faces' coordinate are formed. >/li< >li< The parameter tolerance is for validating the input 2D polygon. The parameter cond is deprecated, always use "FALSE" value for cond parameter. >/li< >li< The connection parameter conn is to run the PL/SQL functions such as convert_2D_srid_to_3D to get the 3-D srid of output geometry wrt 2-D srid of input polygon. For Geodetic, we assume the unit is meter for z values and for projected we assume that it is the same unit as the projected SRID unit. >/li< >li< If the user knows the resultant solid geometry's 3D srid (null in pl/sql not accepted), this function lets that srid to be input as optional3dSrid. Otherwise, simply ignore optional3dSrid parameter and then this function will calculate the 3d srid for the resultant solid geometry. >/li<
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 solid //@param cond Deprecated, always use "FALSE" value.tolerance
-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, double tolerance) throws java.lang.Exception, java.sql.SQLException
We expect: >li< A 2-D polygon w/ hole(s) or (outer) ring geometry in JGeometry (which will be the base of the solid that we will output): --< In case of ring: This 2-D polygon (ring) input must be oriented in CCW (on x-y plane) and could be optimized rectangle. When we convert this 2-D polygon (ring) input to the 3-D polygon by adding z=0 coordinates to each vertex, we also check/validate that the orientation of the input polygon (ring) must be CCW on x-y plane and thus it must result +ive value from the dot-product of the normal of this polygon with the unit vector in the direction of +z axis; --< In case of polygon w/ hole(s): The outer ring must be CCW oriented and inner rings must be CW oriented. We partition this polygon w/ hole(s) into outer rings such that it becomes composite surface without hole(s). In other words, we get rid of hole(s) in the input polygon w/ hole(s). Then, we apply extrusion for (an outer) ring procedure for each ring in this composite surface (comes as collection) and then output the resulting solid as composite solid. It must be noted that in this case user can either input a single grdHeight value and a single height value or grdHeight values and height values ONLY for the outer ring (we interpret those for inner ring(s)) since from satellite images if there are hole(s) in the image, the hole goes *all* the way down and since we donot allow patches on solids, we do the conversion from polygon w/ hole(s) to composite surface; and >/li< >li< A two double arrays of z-values where the first array is for ground height (i.e., the z-value for a vertex of the bottom face of the solid that we will output) and the second array is for height (i.e., the z-value for a vertex of the top face of the same solid that we will output). The height entry for a vertex is always greater or equal to the ground height entry for a vertex. If this is not so, we will issue an error. The extrusion is always either along +z or -z axis. First the newly extruded output solid's bottom face coordinate array, then top face coordinate array, and then side faces' coordinate are formed. >/li< >li< The parameter tolerance is for validating the input 2D polygon. The parameter cond is deprecated, always use "FALSE" value for cond parameter. >/li< >li< The connection parameter conn is to run the PL/SQL functions such as convert_2D_srid_to_3D to get the 3-D srid of output geometry wrt 2-D srid of input polygon. For Geodetic, we assume the unit is meter for z values and for projected we assume that it is the same unit as the projected SRID unit. >/li< 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 solid //@param cond Deprecated, always use "FALSE" value.tolerance
-java.lang.Exception
java.sql.SQLException
public static JGeometry extrusion(JGeometry polygon, double[] grdHeight, double[] height, java.sql.Connection conn, double tolerance, int optional3dSrid) throws java.lang.Exception, java.sql.SQLException
We expect: >li< A 2-D polygon w/ hole(s) or (outer) ring geometry in JGeometry (which will be the base of the solid that we will output): --< In case of ring: This 2-D polygon (ring) input must be oriented in CCW (on x-y plane) and could be optimized rectangle. When we convert this 2-D polygon (ring) input to the 3-D polygon by adding z=0 coordinates to each vertex, we also check/validate that the orientation of the input polygon (ring) must be CCW on x-y plane and thus it must result +ive value from the dot-product of the normal of this polygon with the unit vector in the direction of +z axis; --< In case of polygon w/ hole(s): The outer ring must be CCW oriented and inner rings must be CW oriented. We partition this polygon w/ hole(s) into outer rings such that it becomes composite surface without hole(s). In other words, we get rid of hole(s) in the input polygon w/ hole(s). Then, we apply extrusion for (an outer) ring procedure for each ring in this composite surface (comes as collection) and then output the resulting solid as composite solid. It must be noted that in this case user can either input a single grdHeight value and a single height value or grdHeight values and height values ONLY for the outer ring (we interpret those for inner ring(s)) since from satellite images if there are hole(s) in the image, the hole goes *all* the way down and since we donot allow patches on solids, we do the conversion from polygon w/ hole(s) to composite surface; and >/li< >li< A two double arrays of z-values where the first array is for ground height (i.e., the z-value for a vertex of the bottom face of the solid that we will output) and the second array is for height (i.e., the z-value for a vertex of the top face of the same solid that we will output). The height entry for a vertex is always greater or equal to the ground height entry for a vertex. If this is not so, we will issue an error. The extrusion is always either along +z or -z axis. First the newly extruded output solid's bottom face coordinate array, then top face coordinate array, and then side faces' coordinate are formed. >/li< >li< The parameter tolerance is for validating the input 2D polygon. The parameter cond is deprecated, always use "FALSE" value for cond parameter. >/li< >li< The connection parameter conn is to run the PL/SQL functions such as convert_2D_srid_to_3D to get the 3-D srid of output geometry wrt 2-D srid of input polygon. For Geodetic, we assume the unit is meter for z values and for projected we assume that it is the same unit as the projected SRID unit. >/li< >li< If the user knows the resultant solid geometry's 3D srid (null in pl/sql not accepted), this function lets that srid to be input as optional3dSrid. Otherwise, simply ignore optional3dSrid parameter and then this function will calculate the 3d srid for the resultant solid geometry. >/li<
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 solid //@param cond Deprecated, always use "FALSE" value.tolerance
-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: >li< collGeom of gtype collection can get any geometry. >/li< >li< collGeom of gtype Multi X can only get simple and comp-X's. >/li< >li< inGeom cannot be multi-x geometry (i.e., no multi-level nesting). >/li<
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 geometries of first geometry are ignored. Composite solids are treated like multi-solids such that if the point is on a shared face of second geometry which is composite-solid, then the point is considered to be outside second geometry, which is solid.
//@param this Any 3-D Cartesian geometry
solid2
- 3-D Cartesian geometrytolerance
- User tolerancejava.lang.Exception
public boolean inside3d(J3D_Geometry solid2, double tolerance, java.lang.String is_g3d) throws java.lang.Exception
Inner geometries of first geometry are ignored. Composite solids are treated like multi-solids such that if the point is on a shared face of second geometry which is composite-solid, then the point is considered to be outside second geometry, which is solid.
If data are Geographic3D (by setting is_g3d as TRUE), then Gnomonic transformation (projection) is carried out here. The tolerance value is set to 0.05 in Gnomonic transformation no matter what the user input tolerance is.
Geodetic/Geographic 3D geometries should not span long distances.
//@param this Any 3-D geometry
solid2
- 3-D geometrytolerance
- User toleranceis_g3d
- Flag to denote whether input geometries are Geodetic/Geographic 3D or not (TRUE/FALSE)java.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
public java.lang.String getLabelByElement(J3D_Geometry qryElement, double tolerance) throws java.lang.Exception
This function is commutable with the extract with label function. That is, if we start with a geometry and do extract with a label via getElementByLabel function and pass the result to this function, the resulting label should be the same as the one given as input to the extract (i.e., getElementByLabel) function.
Inner solid boundary will be entered as GTYPE_POLYGON (3003) and ETYPE_COMPOSITESURFACE (1006) for qryElement input. Thus, this function matches the reverse orientation via reverseOrientation function.
The outer geometries of qryElement is matched to the outer geometries of this (source) first, and then the inner geometries of qryElement are matched to the inner geometries of this (source).
The threshold value is set to 10, which means if there are fewer than 10 sub-elements in the geometry, brute-force is used, else R-Tree is used.
qryElement
- The geometry we are looking fortolerance
- User defined tolerancejava.lang.Exception
public static J3D_Geometry expandGeom(J3D_Geometry geometry) throws java.lang.Exception
geometry
- The J3D_Geometry to be expandedjava.lang.Exception