Class Recommendations

java.lang.Object
org.opengis.cite.kml22.BaseFixture
org.opengis.cite.kml22.level2.Recommendations

public class Recommendations extends BaseFixture
Contains test methods for various recommended constraints that should be satisfied by a KML instance.

Sources

  • OGC 07-134r2: OGC KML 2.2 - Abstract Test Suite
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final String
    ALT_MODE_CLAMP
    (package private) static final Set<String>
    List of supported httpQuery parameters.

    Fields inherited from class org.opengis.cite.kml22.BaseFixture

    NS_MAP, testSubject
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    [Test] Verifies that a kml:coordinates or kml:Model/kml:Location element includes an altitude value if its sibling kml:altitudeMode element does NOT have the value "clampToGround".
    void
    [Test] Verifies that a kml:Camera element satisfies all of the following constraints: if it is not a descendant of kml:Update, then the following child elements are present: kml:latitude, kml:longitude, and kml:altitude; the value of kml:altitudeMode is not "clampToGround".
    void
    [Test] Verifies that a kml:ExtendedData element is not empty.
    void
    [Test] Verifies that if a kml:Folder element is not a descendant of kml:Update, it is not empty.
    void
    [Test] Verifies that if a kml:GroundOverlay element is not a descendant of kml:Update, it contains a kml:LatLonBox element (with kml:north, kml:south, kml:east, kml:west).
    void
    [Test] Verifies that a kml:httpQuery element (appearing within a parent link element) contains at least one supported parameter (these are listed below).
    void
    [Test] Verifies that if a kml:ImagePyramid element is not a descendant of kml:Update, it satisfies all of the following constraints: it has the kml:maxWidth and kml:maxHeight child elements; the kml:tileSize value is a power of 2.
    void
    [Test] Verifies that if a kml:PhotoOverlay element includes a kml:Icon/kml:href element containing [x], [y], and [level] parameters (to accommodate large images), then it also includes a child kml:ImagePyramid element.
    void
    [Test] Verifies that the document element (kml:kml) contains at least one child element: kml:NetworkLinkControl or any element that substitutes for kml:AbstractFeatureType.
    void
    [Test] Verifies that a kml:LinearRing element (composing the boundary of a polygon) does not contain any of the following elements: kml:extrude, kml:tessellate, or kml:altitudeMode.
    void
    [Test] Verifies that a kml:Link or a kml:Icon element (both of type kml:LinkType) satisfies all of the following constraints: if the kml:refreshInterval element is present, the kml:refreshMode value must be "onInterval"; if the kml:viewRefreshTime element is present, the kml:viewRefreshMode value must be "onStop".
    void
    [Test] Verifies that a kml:Location element satisfies all of the following constraints: it contains the kml:longitude and kml:latitude elements; if the parent kml:Model element has a kml:altitudeMode value that is not "clampToGround", then the kml:altitude element is also present.
    void
    [Test] Verifies that if a kml:MultiGeometry element is not a descendant of kml:Update, it contains two or more geometry elements.
    void
    [Test] Verifies that if any element that substitutes for kml:AbstractOverlayType (kml:PhotoOverlay, kml:GroundOverlay, kml:ScreenOverlay) is not a descendant of kml:Update, then it contains a kml:Icon child element.
    void
    [Test] Verifies that if a kml:Placemark element is not a descendant of kml:Update, it includes a geometry element (any element that substitutes for kml:AbstractGeometryGroup).
    void
    [Test] Verifies that a kml:ResourceMap element contains at least one kml:Alias child element, and that each Alias element has a unique kml:sourceHref value.
    void
    [Test] Verifies that if a kml:Scale element is not a descendant of kml:Update, it contains at least one of the following elements: kml:x, kml:y, or kml:z.
    void
    [Test] Verifies that if a kml:ScreenOverlay element is not a descendant of kml:Update, then it has a kml:screenXY child element.
    void
    [Test] Verifies that a kml:Data element has both a 'name' attribute and a kml:value child element.
    void
    [Test] Verifies that a kml:viewFormat element (appearing within a parent link element) contains at least one parameter.

    Methods inherited from class org.opengis.cite.kml22.BaseFixture

    obtainTestSubject, setTestSubject, verifyElementNotEmpty

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ALT_MODE_CLAMP

      static final String ALT_MODE_CLAMP
      ALT_MODE_CLAMP
      See Also:
    • HTTP_QUERY_PARAMS

      static final Set<String> HTTP_QUERY_PARAMS
      List of supported httpQuery parameters.
  • Constructor Details

    • Recommendations

      public Recommendations()
  • Method Details

    • verifyAltitudeIfNotClampToGround

      public void verifyAltitudeIfNotClampToGround()
      [Test] Verifies that a kml:coordinates or kml:Model/kml:Location element includes an altitude value if its sibling kml:altitudeMode element does NOT have the value "clampToGround".
      See Also:
      • "OGC 07-134r2, ATC 43: Coordinates - altitudeMode"
    • verifyScale

      public void verifyScale()
      [Test] Verifies that if a kml:Scale element is not a descendant of kml:Update, it contains at least one of the following elements: kml:x, kml:y, or kml:z.
      See Also:
      • "OGC 07-134r2, ATC 44: Scale - minimal content"
    • verifyKmlDocumentIsNotEmpty

      public void verifyKmlDocumentIsNotEmpty()
      [Test] Verifies that the document element (kml:kml) contains at least one child element: kml:NetworkLinkControl or any element that substitutes for kml:AbstractFeatureType. This test checks for the occurrence of child elements in the standard namespace. It is possible that extension elements in some foreign namespace may be present (e.g. gx:Tour), but these are currently ignored.
      See Also:
      • "OGC 07-134r2, ATC 45: KML - minimal content"
    • verifyViewFormat

      public void verifyViewFormat()
      [Test] Verifies that a kml:viewFormat element (appearing within a parent link element) contains at least one parameter.
      See Also:
      • "OGC 07-134r2, ATC 46: ViewFormat"
    • verifyHttpQuery

      public void verifyHttpQuery()
      [Test] Verifies that a kml:httpQuery element (appearing within a parent link element) contains at least one supported parameter (these are listed below).
      • [clientVersion]
      • [kmlVersion]
      • [clientName]
      • [language]
      See Also:
      • "OGC 07-134r2, ATC 47: httpQuery"
    • verifyLinearRing

      public void verifyLinearRing()
      [Test] Verifies that a kml:LinearRing element (composing the boundary of a polygon) does not contain any of the following elements: kml:extrude, kml:tessellate, or kml:altitudeMode.
      See Also:
      • "OGC 07-134r2, ATC 48: LinearRing in Polygon"
    • verifyUntypedData

      public void verifyUntypedData()
      [Test] Verifies that a kml:Data element has both a 'name' attribute and a kml:value child element.
      See Also:
      • "OGC 07-134r2, ATC 49: Data"
    • verifyResourceAliasIsUnique

      public void verifyResourceAliasIsUnique()
      [Test] Verifies that a kml:ResourceMap element contains at least one kml:Alias child element, and that each Alias element has a unique kml:sourceHref value.
      See Also:
      • "OGC 07-134r2, ATC 50: ResourceMap - Alias"
    • verifyLinkRefresh

      public void verifyLinkRefresh()
      [Test] Verifies that a kml:Link or a kml:Icon element (both of type kml:LinkType) satisfies all of the following constraints:
      1. if the kml:refreshInterval element is present, the kml:refreshMode value must be "onInterval";
      2. if the kml:viewRefreshTime element is present, the kml:viewRefreshMode value must be "onStop".
      See Also:
      • "OGC 07-134r2, ATC 51: Link refresh values"
    • verifyImagePyramidInPhotoOverlay

      public void verifyImagePyramidInPhotoOverlay()
      [Test] Verifies that if a kml:PhotoOverlay element includes a kml:Icon/kml:href element containing [x], [y], and [level] parameters (to accommodate large images), then it also includes a child kml:ImagePyramid element. The converse must also be true. The parameters are embedded within the URL. For example:
       http://example.org/bigphoto/$[level]/row_$[x]_column_$[y].jpg.
       

      Check for the kml:ImagePyramid when the x, y, level parameters are present, or if the kml:ImagePyramid is present check for the x, y, level parameters.

      See Also:
      • "OGC 07-134r2, ATC 52: PhotoOverlay"
    • verifyGroundOverlayHasLatLonBox

      public void verifyGroundOverlayHasLatLonBox()
      [Test] Verifies that if a kml:GroundOverlay element is not a descendant of kml:Update, it contains a kml:LatLonBox element (with kml:north, kml:south, kml:east, kml:west).
      See Also:
      • "OGC 07-134r2, ATC 53: GroundOverlay - minimal content"
    • verifyCamera

      public void verifyCamera()
      [Test] Verifies that a kml:Camera element satisfies all of the following constraints:
      1. if it is not a descendant of kml:Update, then the following child elements are present: kml:latitude, kml:longitude, and kml:altitude;
      2. the value of kml:altitudeMode is not "clampToGround".
      See Also:
      • "OGC 07-134r2, ATC 54: Camera"
    • verifyModelLocation

      public void verifyModelLocation()
      [Test] Verifies that a kml:Location element satisfies all of the following constraints:
      1. it contains the kml:longitude and kml:latitude elements;
      2. if the parent kml:Model element has a kml:altitudeMode value that is not "clampToGround", then the kml:altitude element is also present.
      See Also:
      • "OGC 07-134r2, ATC 55: Location"
    • verifyOverlayHasIcon

      public void verifyOverlayHasIcon()
      [Test] Verifies that if any element that substitutes for kml:AbstractOverlayType (kml:PhotoOverlay, kml:GroundOverlay, kml:ScreenOverlay) is not a descendant of kml:Update, then it contains a kml:Icon child element.
      See Also:
      • "OGC 07-134r2, ATC 56: Overlay"
    • verifyScreenOverlay

      public void verifyScreenOverlay()
      [Test] Verifies that if a kml:ScreenOverlay element is not a descendant of kml:Update, then it has a kml:screenXY child element.
      See Also:
      • "OGC 07-134r2, ATC 57: ScreenOverlay"
    • verifyExtendedDataNotEmpty

      public void verifyExtendedDataNotEmpty()
      [Test] Verifies that a kml:ExtendedData element is not empty.
      See Also:
      • "OGC 07-134r2, ATC 59: ExtendedData"
    • verifyFolderNotEmpty

      public void verifyFolderNotEmpty()
      [Test] Verifies that if a kml:Folder element is not a descendant of kml:Update, it is not empty.
      See Also:
      • "OGC 07-134r2, ATC 60: Folder"
    • verifyImagePyramid

      public void verifyImagePyramid()
      [Test] Verifies that if a kml:ImagePyramid element is not a descendant of kml:Update, it satisfies all of the following constraints:
      1. it has the kml:maxWidth and kml:maxHeight child elements;
      2. the kml:tileSize value is a power of 2.
      See Also:
      • "OGC 07-134r2, ATC 62: ImagePyramid"
    • verifyMultiGeometry

      public void verifyMultiGeometry()
      [Test] Verifies that if a kml:MultiGeometry element is not a descendant of kml:Update, it contains two or more geometry elements. In effect this just means there are two or more child KML elements.
      See Also:
      • "OGC 07-134r2, ATC 66: MultiGeometry"
    • verifyPlacemarkHasGeometry

      public void verifyPlacemarkHasGeometry()
      [Test] Verifies that if a kml:Placemark element is not a descendant of kml:Update, it includes a geometry element (any element that substitutes for kml:AbstractGeometryGroup). Known KML geometry elements include Point, LineString, LinearRing, Polygon, Model, and MultiGeometry.
      See Also:
      • "OGC 07-134r2, ATC 67: Placemark"