de.micromata.opengis.kml.v_2_2_0.gx.LatLonQuad Maven / Gradle / Ivy
Show all versions of JavaAPIforKml Show documentation
package de.micromata.opengis.kml.v_2_2_0.gx;
import de.micromata.opengis.kml.v_2_2_0.AbstractObject;
import de.micromata.opengis.kml.v_2_2_0.Coordinate;
import de.micromata.opengis.kml.v_2_2_0.CoordinatesConverter;
import de.micromata.opengis.kml.v_2_2_0.annotations.Obvious;
import jakarta.xml.bind.annotation.*;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.ArrayList;
import java.util.List;
/**
* gx:LatLonQuad
*
* Allows non-rectangular quadrilateral ground overlays.
*
*
* If a third value is inserted into any tuple (representing altitude) it will be ignored.
* Altitude is set using altitude and altitudeMode (or gx:altitudeMode) extending
* GroundOverlay. Allowed altitude modes are absolute, clampToGround, and clampToSeaFloor.
*
*
* Specifies the coordinates of the four corner points of a quadrilateral defining
* the overlay area. Exactly four coordinate tuples have to be provided, each consisting
* of floating point values for longitude and latitude. Insert a space between tuples.
* Do not include spaces within a tuple. The coordinates must be specified in counter-clockwise
* order with the first coordinate corresponding to the lower-left corner of the overlayed
* image. The shape described by these corners must be convex.
*
*
* Syntax:
* <GroundOverlay id="ID">
* ...
* <Icon>...</Icon>
* <altitude>0</altitude>
* <altitudeMode>clampToGround</altitudeMode> <!-- or absolute -->
* <!-- can substitute <gx:altitudeMode>clampToSeaFloor</gx:altitudeMode> -->
*
* <gx:LatLonQuad>
* <coordinates>...</coordinates> <!-- four lon,lat tuples -->
* </gx:LatLonQuad>
* </GroundOverlay>
*
* Extends:
*
*
* Contained By:
*
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "LatLonQuadType", propOrder = {
"coordinates"
})
@XmlRootElement(name = "LatLonQuad", namespace = "http://www.google.com/kml/ext/2.2")
public class LatLonQuad
extends AbstractObject
implements Cloneable
{
/**
* coordinates (required)
*
* A single tuple consisting of floating point values for longitude, latitude, and
* altitude (in that order). Longitude and latitude values are in degrees, where longitude
* gteq −180 and lteq 180 latitude gteq −90 and lteq 90 altitude values (optional) are in meters
* above sea level
*
*
* Do not include spaces between the three values that describe a coordinate.
*
*
* Two or more coordinate tuples, each consisting of floating point values for longitude,
* latitude, and altitude. The altitude component is optional. Insert a space between
* tuples. Do not include spaces within a tuple.
*
*
*
*
*/
@XmlElement(namespace = "http://www.opengis.net/kml/2.2", type = String.class)
@XmlJavaTypeAdapter(CoordinatesConverter.class)
protected List coordinates;
public LatLonQuad() {
super();
}
/**
*
*
*/
public List getCoordinates() {
if (coordinates == null) {
coordinates = new ArrayList();
}
return coordinates;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = ((prime*result)+((coordinates == null)? 0 :coordinates.hashCode()));
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (super.equals(obj) == false) {
return false;
}
if ((obj instanceof LatLonQuad) == false) {
return false;
}
LatLonQuad other = ((LatLonQuad) obj);
if (coordinates == null) {
if (other.coordinates!= null) {
return false;
}
} else {
if (coordinates.equals(other.coordinates) == false) {
return false;
}
}
return true;
}
/**
*
*
*/
public void setCoordinates(final List coordinates) {
this.coordinates = coordinates;
}
/**
* add a value to the coordinates property collection
*
* @param longitude
* required parameter
* @param latitude
* required parameter
* @return
* true (as general contract of Collection.add).
*/
public LatLonQuad addToCoordinates(final double longitude, final double latitude) {
this.getCoordinates().add(new Coordinate(longitude, latitude));
return this;
}
/**
* add a value to the coordinates property collection
*
* @param longitude
* required parameter
* @param latitude
* required parameter
* @param altitude
* required parameter
* @return
* true (as general contract of Collection.add).
*/
public LatLonQuad addToCoordinates(final double longitude, final double latitude, final double altitude) {
this.getCoordinates().add(new Coordinate(longitude, latitude, altitude));
return this;
}
/**
* add a value to the coordinates property collection
*
* @param coordinates
* required parameter
* @return
* true (as general contract of Collection.add).
*/
public LatLonQuad addToCoordinates(final String coordinates) {
this.getCoordinates().add(new Coordinate(coordinates));
return this;
}
/**
*
*
*/
@Obvious
@Override
public void setObjectSimpleExtension(final List