Class GeoLocation

java.lang.Object
io.goobi.viewer.model.misc.GeoLocation

public class GeoLocation extends Object
Represents a single geographic location with coordinates and an optional display label.
Author:
Florian Alpers
  • Constructor Details

    • GeoLocation

      public GeoLocation()
      Creates a new GeoLocation instance.
    • GeoLocation

      public GeoLocation(Double latitude, Double longitude)
      Creates a new GeoLocation instance.
      Parameters:
      latitude - geographic latitude in decimal degrees.
      longitude - geographic longitude in decimal degrees.
    • GeoLocation

      public GeoLocation(org.json.JSONObject json) throws org.json.JSONException
      Creates a new GeoLocation instance.
      Parameters:
      json - JSON object containing latitude, longitude, info and link fields.
      Throws:
      org.json.JSONException - if any.
  • Method Details

    • getLatitude

      public Double getLatitude()
      Getter for the field latitude.
      Returns:
      the geographic latitude in decimal degrees, or null if not set
    • setLatitude

      public void setLatitude(Double latitude)
      Setter for the field latitude.
      Parameters:
      latitude - geographic latitude in decimal degrees.
    • getLongitude

      public Double getLongitude()
      Getter for the field longitude.
      Returns:
      the geographic longitude in decimal degrees (WGS84), or null if not set
    • setLongitude

      public void setLongitude(Double longitude)
      Setter for the field longitude.
      Parameters:
      longitude - the geographic longitude in decimal degrees (WGS84)
    • getAsJson

      public org.json.JSONObject getAsJson()
      getAsJson.
      Returns:
      the geographic coordinates and optional info and link as a JSON object
    • isEmpty

      public boolean isEmpty()
      isEmpty.
      Returns:
      true if either latitude or longitude is not set or set to NULL
    • getInfo

      public String getInfo()
      Getter for the field info.
      Returns:
      the descriptive text or HTML content shown in the map popup for this location
    • setInfo

      public void setInfo(String info)
      Setter for the field info.
      Parameters:
      info - the descriptive text or HTML content shown in the map popup for this location
    • getLink

      public String getLink()
      Getter for the field link.
      Returns:
      the URL linked from the map popup for this location
    • setLink

      public void setLink(String link)
      Setter for the field link.
      Parameters:
      link - the URL linked from the map popup for this location