Class: Datacite::Mapping::GeoLocation
- Inherits:
-
Object
- Object
- Datacite::Mapping::GeoLocation
- Includes:
- XML::Mapping
- Defined in:
- lib/datacite/mapping/geo_location.rb
Overview
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.
Instance Attribute Summary collapse
-
#box ⇒ GeoLocationBox?
The latitude-longitude quadrangle containing the area where the data was gathered or about which the data is focused.
-
#place ⇒ String?
The spatial region or named place where the data was gathered or about which the data is focused.
-
#point ⇒ GeoLocationPoint?
The latitude and longitude at which the data was gathered or about which the data is focused.
Instance Method Summary collapse
-
#initialize(point: nil, box: nil, place: nil, polygon: nil) ⇒ GeoLocation
constructor
Initializes a new GeoLocation.
- #location? ⇒ Boolean
Constructor Details
#initialize(point: nil, box: nil, place: nil, polygon: nil) ⇒ GeoLocation
Initializes a new Datacite::Mapping::GeoLocation
24 25 26 27 28 29 |
# File 'lib/datacite/mapping/geo_location.rb', line 24 def initialize(point: nil, box: nil, place: nil, polygon: nil) self.point = point self.box = box self.place = place self.polygon = polygon end |
Instance Attribute Details
#box ⇒ GeoLocationBox?
Returns the latitude-longitude quadrangle containing the area where the data was gathered or about which the data is focused.
47 |
# File 'lib/datacite/mapping/geo_location.rb', line 47 geo_location_box_node :box, 'geoLocationBox', default_value: nil |
#place ⇒ String?
Returns the spatial region or named place where the data was gathered or about which the data is focused.
55 |
# File 'lib/datacite/mapping/geo_location.rb', line 55 text_node :place, 'geoLocationPlace', default_value: nil |
#point ⇒ GeoLocationPoint?
Returns the latitude and longitude at which the data was gathered or about which the data is focused.
43 |
# File 'lib/datacite/mapping/geo_location.rb', line 43 geo_location_point_node :point, 'geoLocationPoint', default_value: nil |
Instance Method Details
#location? ⇒ Boolean
35 36 37 |
# File 'lib/datacite/mapping/geo_location.rb', line 35 def location? point || box || place || polygon end |