Class: MetaCartaGeoParser::Location

Inherits:
Struct
  • Object
show all
Defined in:
lib/metacarta_geoparser.rb,
lib/metacarta_geoparser.rb

Overview

A Location contains the following fields:

name

The name of this location

type

The type of this location (no clue what it means)

population

The number of people who live here or nil

hierarchy

The places above this place

latitude

Latitude of the location

longitude

Longitude of the location

confidence

Accuracy confidence (if any)

viewbox

Pair of coordinates forming a box around this place

viewbox runs from lower left to upper right.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#confidenceObject

Returns the value of attribute confidence

Returns:

  • (Object)

    the current value of confidence



19
20
21
# File 'lib/metacarta_geoparser.rb', line 19

def confidence
  @confidence
end

#hierarchyObject

Returns the value of attribute hierarchy

Returns:

  • (Object)

    the current value of hierarchy



19
20
21
# File 'lib/metacarta_geoparser.rb', line 19

def hierarchy
  @hierarchy
end

#latitudeObject

Returns the value of attribute latitude

Returns:

  • (Object)

    the current value of latitude



19
20
21
# File 'lib/metacarta_geoparser.rb', line 19

def latitude
  @latitude
end

#longitudeObject

Returns the value of attribute longitude

Returns:

  • (Object)

    the current value of longitude



19
20
21
# File 'lib/metacarta_geoparser.rb', line 19

def longitude
  @longitude
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



19
20
21
# File 'lib/metacarta_geoparser.rb', line 19

def name
  @name
end

#populationObject

Returns the value of attribute population

Returns:

  • (Object)

    the current value of population



19
20
21
# File 'lib/metacarta_geoparser.rb', line 19

def population
  @population
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



19
20
21
# File 'lib/metacarta_geoparser.rb', line 19

def type
  @type
end

#viewboxObject

Returns the value of attribute viewbox

Returns:

  • (Object)

    the current value of viewbox



19
20
21
# File 'lib/metacarta_geoparser.rb', line 19

def viewbox
  @viewbox
end

Instance Method Details

#coordinatesObject

The latitude and longitude for this location.



115
116
117
# File 'lib/metacarta_geoparser.rb', line 115

def coordinates
  [latitude, longitude]
end