All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.micromata.opengis.kml.v_2_2_0.Location Maven / Gradle / Ivy

Go to download

This is JavaAPIforKMml, Micromata's library for use with applications that want to parse, generate and operate on KML. It is an implementation of the OGC KML 2.2 standard. It is written entirely in Java and makes heavy use of JAXB.

There is a newer version: 3.0.4
Show newest version

package de.micromata.opengis.kml.v_2_2_0;

import de.micromata.opengis.kml.v_2_2_0.annotations.Obvious;
import jakarta.xml.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;


/**
 * {@code }
 * 

* Specifies the exact coordinates of the Model's origin in latitude, longitude, and * altitude. Latitude and longitude measurements are standard lat-lon projection with * WGS84 datum. Altitude is distance above the earth's surface, in meters, and is interpreted * according to altitudeMode or gx:altitudeMode. {@code 39.55375305703105 * -118.9813220168456 altitude1223 } *

* * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "LocationType", propOrder = { "longitude", "latitude", "altitude", "locationSimpleExtension", "locationObjectExtension" }) @XmlRootElement(name = "Location", namespace = "http://www.opengis.net/kml/2.2") public class Location extends AbstractObject implements Cloneable { /** * {@code } *

* Longitude of the point the camera is looking at. Angular distance in degrees, relative * to the Prime Meridian. Values west of the Meridian range from −180 to 0 degrees. * Values east of the Meridian range from 0 to 180 degrees. *

*

* Longitude of the virtual camera (eye point). Angular distance in degrees, relative * to the Prime Meridian. Values west of the Meridian range from −180 to 0 degrees. * Values east of the Meridian range from 0 to 180 degrees. *

* * * */ @XmlElement(defaultValue = "0.0") protected double longitude; /** * {@code } *

* Latitude of the point the camera is looking at. Degrees north or south of the Equator * (0 degrees). Values range from −90 degrees to 90 degrees. *

*

* Latitude of the virtual camera. Degrees north or south of the Equator (0 degrees). * Values range from −90 degrees to 90 degrees. *

* * * */ @XmlElement(defaultValue = "0.0") protected double latitude; /** * altitude *

* Distance from the earth's surface, in meters. Interpreted according to the LookAt's * altitude mode. *

*

* Distance of the camera from the earth's surface, in meters. Interpreted according * to the Camera's altitudeMode or gx:altitudeMode. *

*

* Specifies the distance above the earth's surface, in meters, and is interpreted * according to the altitude mode. *

* * * */ @XmlElement(defaultValue = "0.0") protected double altitude; @XmlElement(name = "LocationSimpleExtensionGroup") @XmlSchemaType(name = "anySimpleType") protected List locationSimpleExtension; /** * {@code } *

* This is an abstract base class and cannot be used directly in a KML file. It provides * the id attribute, which allows unique identification of a KML element, and the targetId * attribute, which is used to reference objects that have already been loaded into * Google Earth. The id attribute must be assigned if the Update mechanism is to * be used. *

* * Syntax: *
<!-- abstract element; do not create -->
     * <!-- Object id="ID" targetId="NCName" -->
     * <!-- /Object> -->
* * * */ @XmlElement(name = "LocationObjectExtensionGroup") protected List locationObjectExtension; public Location() { super(); } /** * * * @return * possible object is * {@link Double} * */ public double getLongitude() { return longitude; } /** * * * @param value * allowed object is * {@link Double} * */ public void setLongitude(double value) { this.longitude = value; } /** * * * @return * possible object is * {@link Double} * */ public double getLatitude() { return latitude; } /** * * * @param value * allowed object is * {@link Double} * */ public void setLatitude(double value) { this.latitude = value; } /** * * * @return * possible object is * {@link Double} * */ public double getAltitude() { return altitude; } /** * * * @param value * allowed object is * {@link Double} * */ public void setAltitude(double value) { this.altitude = value; } /** * * */ public List getLocationSimpleExtension() { if (locationSimpleExtension == null) { locationSimpleExtension = new ArrayList(); } return this.locationSimpleExtension; } /** * * */ public List getLocationObjectExtension() { if (locationObjectExtension == null) { locationObjectExtension = new ArrayList(); } return this.locationObjectExtension; } @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); long temp; temp = Double.doubleToLongBits(longitude); result = ((prime*result)+((int)(temp^(temp >>>(32))))); temp = Double.doubleToLongBits(latitude); result = ((prime*result)+((int)(temp^(temp >>>(32))))); temp = Double.doubleToLongBits(altitude); result = ((prime*result)+((int)(temp^(temp >>>(32))))); result = ((prime*result)+((locationSimpleExtension == null)? 0 :locationSimpleExtension.hashCode())); result = ((prime*result)+((locationObjectExtension == null)? 0 :locationObjectExtension.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 Location) == false) { return false; } Location other = ((Location) obj); if (longitude!= other.longitude) { return false; } if (latitude!= other.latitude) { return false; } if (altitude!= other.altitude) { return false; } if (locationSimpleExtension == null) { if (other.locationSimpleExtension!= null) { return false; } } else { if (locationSimpleExtension.equals(other.locationSimpleExtension) == false) { return false; } } if (locationObjectExtension == null) { if (other.locationObjectExtension!= null) { return false; } } else { if (locationObjectExtension.equals(other.locationObjectExtension) == false) { return false; } } return true; } /** * * * @param locationSimpleExtension * Objects of the following type are allowed in the list: {@link Object} */ public void setLocationSimpleExtension(final List locationSimpleExtension) { this.locationSimpleExtension = locationSimpleExtension; } /** * add a value to the locationSimpleExtension property collection * * @param locationSimpleExtension * Objects of the following type are allowed in the list: {@link Object} * @return * true (as general contract of Collection.add). */ public Location addToLocationSimpleExtension(final Object locationSimpleExtension) { this.getLocationSimpleExtension().add(locationSimpleExtension); return this; } /** * * * @param locationObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} */ public void setLocationObjectExtension(final List locationObjectExtension) { this.locationObjectExtension = locationObjectExtension; } /** * add a value to the locationObjectExtension property collection * * @param locationObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} * @return * true (as general contract of Collection.add). */ public Location addToLocationObjectExtension(final AbstractObject locationObjectExtension) { this.getLocationObjectExtension().add(locationObjectExtension); return this; } /** * * */ @Obvious @Override public void setObjectSimpleExtension(final List objectSimpleExtension) { super.setObjectSimpleExtension(objectSimpleExtension); } @Obvious @Override public Location addToObjectSimpleExtension(final Object objectSimpleExtension) { super.getObjectSimpleExtension().add(objectSimpleExtension); return this; } /** * fluent setter * * * @param longitude * required parameter */ public Location withLongitude(final double longitude) { this.setLongitude(longitude); return this; } /** * fluent setter * * * @param latitude * required parameter */ public Location withLatitude(final double latitude) { this.setLatitude(latitude); return this; } /** * fluent setter * * * @param altitude * required parameter */ public Location withAltitude(final double altitude) { this.setAltitude(altitude); return this; } /** * fluent setter * * * @param locationSimpleExtension * required parameter */ public Location withLocationSimpleExtension(final List locationSimpleExtension) { this.setLocationSimpleExtension(locationSimpleExtension); return this; } /** * fluent setter * * * @param locationObjectExtension * required parameter */ public Location withLocationObjectExtension(final List locationObjectExtension) { this.setLocationObjectExtension(locationObjectExtension); return this; } @Obvious @Override public Location withObjectSimpleExtension(final List objectSimpleExtension) { super.withObjectSimpleExtension(objectSimpleExtension); return this; } @Obvious @Override public Location withId(final String id) { super.withId(id); return this; } @Obvious @Override public Location withTargetId(final String targetId) { super.withTargetId(targetId); return this; } @Override public Location clone() { Location copy; copy = ((Location) super.clone()); copy.locationSimpleExtension = new ArrayList((getLocationSimpleExtension().size())); for (Object iter: locationSimpleExtension) { copy.locationSimpleExtension.add(iter); } copy.locationObjectExtension = new ArrayList((getLocationObjectExtension().size())); for (AbstractObject iter: locationObjectExtension) { copy.locationObjectExtension.add(iter.clone()); } return copy; } }