@Classifier(UNION) @UML(identifier="GM_Position", specification=ISO_19107) public interface PositionA type consisting of either a direct position or of a point from which a direct position shall be obtained. The use of this data type allows the identification of a position either directly as a coordinate (variant direct) or indirectly as a point (variant indirect).
Departure from OGC/ISO specification:
ISO 19107 defines
Pointbut unions are not allowed in Java. GeoAPI defines
Positionas the base interface of both types so the two conditional accessor methods,
getDirectPosition(), can be replaced by an
instanceofcheck. However, the
getDirectPosition()has been retained with different semantics, conceptually returning a
DirectPositionat the same location. The conditionality has also been changed to mandatory since all three types conceptually have a well defined location.
@UML(identifier="direct", obligation=CONDITIONAL, specification=ISO_19107) DirectPosition getDirectPosition()Returns the direct position. This method shall never returns
null, but may returns
thisif invoked on an object which is already a
- the direct position (may be