class Placemaker::Location
Parses and contains data for place
, +administrative scope+ and +geographic scope+ elements.
Public Instance Methods
centroid()
click to toggle source
centroid for the place
# File lib/placemaker/location.rb 25 def centroid 26 Placemaker::Coordinates.new(@nodeset.search('.//xmlns:centroid')) 27 end
location_type()
click to toggle source
place type name for the place
# File lib/placemaker/location.rb 20 def location_type 21 nested_node('type') 22 end
name()
click to toggle source
fully qualified name for the place
# File lib/placemaker/location.rb 15 def name 16 nested_node('name') 17 end
woe_id()
click to toggle source
permanent identifier for the place
# File lib/placemaker/location.rb 10 def woe_id 11 nested_node('woeId').to_i 12 end
Private Instance Methods
nested_node(name)
click to toggle source
# File lib/placemaker/location.rb 31 def nested_node(name) 32 @nodeset.search(".//xmlns:#{name}").inner_text 33 end