public class SpatialTests extends BaseFixture
NS_MAP, testSubject| Constructor and Description |
|---|
SpatialTests() |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
checkAltitudeModeNotClampToGround(Element geometry,
org.opengis.cite.validation.ValidationErrorHandler errHandler)
An error is reported if the geometry element has a kml:altitudeMode of
"clampToGround" (default value) and the kml:extrude value is "true".
|
(package private) void |
checkAltMode(Element latLonAltBox,
org.opengis.cite.validation.ValidationErrorHandler errHandler)
An error is reported if any kml:LatLonAltBox element's altitude children
are present but the kml:altitudeMode == clampToGround (also the default
value).
|
(package private) void |
checkAltValues(Element latLonAltBox,
org.opengis.cite.validation.ValidationErrorHandler errHandler)
An error is reported if any kml:LatLonAltBox elements altitude children
are invalid; kml:maxAltitude must be greater than or equal to
kml:minAltitude.
|
(package private) void |
checkInnerBoundaries(Element polygonElem,
org.opengis.cite.validation.ValidationErrorHandler errHandler)
An error is reported if any inner boundary of a polygon is not within the
outer boundary.
|
(package private) void |
checkLatValues(Element box,
org.opengis.cite.validation.ValidationErrorHandler errHandler)
An error is reported if any box elements having latitude children are
invalid; kml:north must be greater than kml:south.
|
(package private) void |
checkLonValues(Element box,
org.opengis.cite.validation.ValidationErrorHandler errHandler)
An error is reported if any box elements having longitude children are
invalid; kml:east must be greater than kml:west.
|
(package private) void |
checkModelResourceMap(Element resourceMap,
org.opengis.cite.validation.ValidationErrorHandler errHandler)
Checks the content of a model resource for the occurrence of the expected
source file names given by aliases contained in a kml:ResourceMap.
|
void |
verifyGeometryCoordinates()
[
Test] Verify that a kml:coordinates element contains a list of
2D or 3D tuples (separated by white space) that contain comma-separated
decimal values (lon,lat[,hgt]). |
void |
verifyGeometryExtrude()
[
Test] Verifies that if the kml:extrude element has the value
"true", then the value of kml:altitudeMode is not
"clampToGround". |
void |
verifyGeometryTesselate()
[
Test] Verifies that if the kml:tessellate element has the value
"true", then the value of kml:altitudeMode is "clampToGround" (default
value). |
void |
verifyLatLonAltBox()
[
Test] Verifies that the content of a kml:LatLonAltBox element
satisfies all of the following constraints:
kml:north > kml:south;
kml:east > kml:west;
kml:minAltitude <= kml:maxAltitude;
if kml:minAltitude and kml:maxAltitude are both present, then
kml:altitudeMode does not have the value "clampToGround".
The default envelope for a region of interest is the entire surface of
the EGM96 geoid. |
void |
verifyLatLonBox()
[
Test] Verifies that the content of a kml:LatLonBox element
satisfies all of the following constraints:
it contains the kml:north, kml:south, kml:east, and kml:west
elements;
kml:north > kml:south;
kml:east > kml:west.
The default envelope for a kml:GroundOverlay is the entire surface of the
WGS 84 ellipsoid. |
void |
verifyLinearRingIsClosed()
[
Test] Verifies that the kml:coordinates element in a
kml:LinearRing geometry contains at least 4 coordinate tuples and that
the first and last are identical (i.e. |
void |
verifyLineStringCoordinates()
[
Test] Verifies that the kml:coordinates element in a
kml:LineString geometry contains at least two coordinate tuples. |
void |
verifyModelContent()
Test] Verifies that the content of a kml:Model element satisfies
all of the following constraints:
it contains the kml:Link and kml:Location elements;
if it is not a descendant of kml:Update and the target resource
refers to any texture files, then there must be a
kml:ResourceMap/kml:Alias for each related texture file.
|
void |
verifyModelOrientationNotEmpty()
[
Test] Verifies that if a kml:Orientation element is not a
descendant of kml:Update, then it contains at least one of the following
KML elements: kml:heading, kml:tilt, or kml:roll. |
void |
verifyPointCoordinates()
[
Test] Verifies that the kml:coordinates element in a kml:Point
geometry contains exactly one coordinate tuple. |
void |
verifyPolygonBoundary()
[
Test] Verifies that the boundary of a kml:Polygon element
satisfies all of the following constraints. |
void |
verifyTextureFileAliasInModel()
[
Test] Verifies that a kml:Alias element (that renames texture
file paths found within a source COLLADA file) referenced in a kml:Model)
satisfies the following constraints:
the value of the child kml:targetHref element is a URI that refers to
an image (texture) resource;
the value of the child kml:sourceHref element corresponds to a file
reference appearing within the 3D object resource referenced in the
preceding sibling kml:Link element.
|
obtainTestSubject, setTestSubject, verifyElementNotEmptypublic void verifyGeometryCoordinates()
Test] Verify that a kml:coordinates element contains a list of
2D or 3D tuples (separated by white space) that contain comma-separated
decimal values (lon,lat[,hgt]).
Pass if all kml:coordinates elements contain 2D/3D tuples containing
decimal values conforming to the xsd:decimal type; fail otherwise. White
space consists of one or more of the following characters: space
(U+0020), carriage return (U+000D), line feed (U+000A), or tab (U+0009).
The relevant 3D coordinate reference system (CRS) is defined in Annex B
of the OGC KML 2.2 specification (its identifier is
urn:ogc:def:crs:OGC:LonLat84_5773).
public void verifyLatLonAltBox()
Test] Verifies that the content of a kml:LatLonAltBox element
satisfies all of the following constraints:
public void verifyLatLonBox()
Test] Verifies that the content of a kml:LatLonBox element
satisfies all of the following constraints:
public void verifyGeometryExtrude()
Test] Verifies that if the kml:extrude element has the value
"true", then the value of kml:altitudeMode is not
"clampToGround". This constraint applies to the following elements:
kml:Point, kml:LineString, kml:LinearRing (but NOT if it occurs within a
Polygon), and kml:Polygon.public void verifyGeometryTesselate()
Test] Verifies that if the kml:tessellate element has the value
"true", then the value of kml:altitudeMode is "clampToGround" (default
value). This applies to the following elements: kml:LineString,
kml:LinearRing (but NOT if it occurs within a Polygon), and kml:Polygon.
Any KML feature with no altitude mode specified will default to
'clampToGround'.public void verifyPointCoordinates()
Test] Verifies that the kml:coordinates element in a kml:Point
geometry contains exactly one coordinate tuple.public void verifyLineStringCoordinates()
Test] Verifies that the kml:coordinates element in a
kml:LineString geometry contains at least two coordinate tuples.public void verifyLinearRingIsClosed()
Test] Verifies that the kml:coordinates element in a
kml:LinearRing geometry contains at least 4 coordinate tuples and that
the first and last are identical (i.e. they constitute a closed figure).public void verifyPolygonBoundary()
Test] Verifies that the boundary of a kml:Polygon element
satisfies all of the following constraints.
//kml:Polygon[not(ancestor::kml:Update)].public void verifyTextureFileAliasInModel()
Test] Verifies that a kml:Alias element (that renames texture
file paths found within a source COLLADA file) referenced in a kml:Model)
satisfies the following constraints:
public void verifyModelOrientationNotEmpty()
Test] Verifies that if a kml:Orientation element is not a
descendant of kml:Update, then it contains at least one of the following
KML elements: kml:heading, kml:tilt, or kml:roll.public void verifyModelContent()
Test] Verifies that the content of a kml:Model element satisfies
all of the following constraints:
Note: This test doesn't first examine the model resource to find all texture file references, since the content type is not known for certain (although a COLLADA file is probably the most common one in use, "model/vnd.collada+xml", *.dae).
void checkModelResourceMap(Element resourceMap, org.opengis.cite.validation.ValidationErrorHandler errHandler)
<Model id="model-id">
<Link>
<href>...</href>
</Link>
<ResourceMap>
<Alias>
<targetHref>...</targetHref>
<sourceHref>...</sourceHref>
</Alias>
</ResourceMap>
</Model>
resourceMap - A kml:ResourceMap element.errHandler - The error handler that receives reports of any constraint
violations.void checkInnerBoundaries(Element polygonElem, org.opengis.cite.validation.ValidationErrorHandler errHandler)
polygonElem - A DOM Element representing a kml:Polygon element.errHandler - The error handler that receives any errors that were detected.void checkAltitudeModeNotClampToGround(Element geometry, org.opengis.cite.validation.ValidationErrorHandler errHandler)
geometry - A geometry element where kml:extrude is "true".errHandler - The error handler that receives any errors that were detected.void checkLonValues(Element box, org.opengis.cite.validation.ValidationErrorHandler errHandler)
box - A box element (kml:LatLonAltBox, kml:LatLonBox)errHandler - The error handler that receives any errors that were detected.void checkLatValues(Element box, org.opengis.cite.validation.ValidationErrorHandler errHandler)
box - A box element (kml:LatLonAltBox, kml:LatLonBox)errHandler - The error handler that receives any errors that were detected.void checkAltValues(Element latLonAltBox, org.opengis.cite.validation.ValidationErrorHandler errHandler)
latLonAltBox - A kml:LatLonAltBox element.errHandler - The error handler that receives any errors that were detected.void checkAltMode(Element latLonAltBox, org.opengis.cite.validation.ValidationErrorHandler errHandler)
latLonAltBox - A kml:LatLonAltBox element.errHandler - The error handler that receives any errors that were detected.Copyright © 2014 Open Geospatial Consortium. All rights reserved.