class Datacite::Mapping::GeoLocation
A location at which the data was gathered or about which the data is focused, in the form of a latitude-longitude point, a latitude-longitude quadrangle, and/or a place name.
Note: Due to a quirk of the DataCite spec, it is possible for a {GeoLocation} to be empty, with none of these present.
Public Class Methods
Initializes a new {GeoLocation} @param point [GeoLocationPoint, nil] the latitude and longitude at which the data was gathered or about which the data is focused. @param box [GeoLocationBox, nil] the latitude-longitude quadrangle containing the area where the data was gathered or about which the data is focused. @param place [String, nil] the spatial region or named place where the data was gathered or about which the data is focused. @param polygon [GeoLocationPolygon, nil] a drawn polygon area containing the area where the data was gathered or about which the data is focused.
# File lib/datacite/mapping/geo_location.rb, line 24 def initialize(point: nil, box: nil, place: nil, polygon: nil, polygons: []) self.point = point self.box = box self.place = place self.polygon = polygon self.polygons = polygons end
Public Instance Methods
# File lib/datacite/mapping/geo_location.rb, line 36 def location? point || box || place || polygon end
# File lib/datacite/mapping/geo_location.rb, line 32 def place=(value) @place = value.respond_to?(:strip) ? value.strip : value end