Class: USGeo::CombinedStatisticalArea

Inherits:
BaseRecord
  • Object
show all
Includes:
Area, Population
Defined in:
lib/us_geo/combined_statistical_area.rb

Overview

Combined statistical area (CSA) of multiple metropolitan areas with weak regional and economic connectoins between them.

Constant Summary

Constants inherited from BaseRecord

BaseRecord::STATUS_IMPORTED, BaseRecord::STATUS_MANUAL, BaseRecord::STATUS_REMOVED

Instance Attribute Summary collapse

Attributes included from Area

#land_area, #water_area

Attributes included from Population

#housing_units, #population

Attributes inherited from BaseRecord

#status, #updated_at

Class Method Summary collapse

Methods included from Area

#land_area_km, #percent_land, #total_area, #water_area_km

Methods included from Population

#housing_density, #housing_density_km, #population_density, #population_density_km

Methods inherited from BaseRecord

#imported?, #manual?, #removed?

Instance Attribute Details

#geoidString



# File 'lib/us_geo/combined_statistical_area.rb', line 23

#nameString



# File 'lib/us_geo/combined_statistical_area.rb', line 26

Class Method Details

.load!(uri = nil) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/us_geo/combined_statistical_area.rb', line 33

def load!(uri = nil)
  location = data_uri(uri || "combined_statistical_areas.csv")
  import! do
    load_data_file(location) do |row|
      load_record!(geoid: row["GEOID"]) do |record|
        record.name = row["Name"]
        record.short_name = row["Short Name"]
        record.population = row["Population"]
        record.housing_units = row["Housing Units"]
        record.land_area = row["Land Area"]
        record.water_area = row["Water Area"]
      end
    end
  end
end