Module: BroadbandMap::Client::Census
- Included in:
- BroadbandMap::Client
- Defined in:
- lib/broadband_map/client/census.rb
Instance Method Summary collapse
-
#census_coords(params = {}, options = {}) ⇒ Hash
Returns the US Census Block geography ID information given a passed Latitude and Longitude.
-
#census_fips(params = {}, options = {}) ⇒ Hash
Returns the geography of a specified geography type by geography id within the entire United States.
-
#census_geo_name(params = {}, options = {}) ⇒ Hash
Returns all the geographies specified by a geography name (e.g., Washington) of a specific geography type (e.g., congressional district) within the entire United States.
Instance Method Details
#census_coords(params = {}, options = {}) ⇒ Hash
Returns the US Census Block geography ID information given a passed Latitude and Longitude.
13 14 15 16 |
# File 'lib/broadband_map/client/census.rb', line 13 def census_coords(params={}, ={}) params = {:format => 'json'}.merge(params) get("census/#{params[:geography_type]}?latitude=#{params[:latitude]}&longitude=#{params[:longitude]}&format=#{params[:format]}&callback=#{params[:callback]}") end |
#census_fips(params = {}, options = {}) ⇒ Hash
Returns the geography of a specified geography type by geography id within the entire United States.
26 27 28 29 |
# File 'lib/broadband_map/client/census.rb', line 26 def census_fips(params={}, ={}) params = {:format => 'json'}.merge(params) get("census/#{params[:geography_type]}/fips/#{params[:fips]}?format=#{params[:format]}&callback=#{params[:callback]}") end |
#census_geo_name(params = {}, options = {}) ⇒ Hash
Returns all the geographies specified by a geography name (e.g., Washington) of a specific geography type (e.g., congressional district) within the entire United States.
39 40 41 42 |
# File 'lib/broadband_map/client/census.rb', line 39 def census_geo_name(params={}, ={}) params = {:format => 'json', :max_results => 100}.merge(params) get("census/#{params[:geography_type]}/#{params[:geography_name]}?format=#{params[:format]}&maxresults=#{params[:max_results]}&all=#{params[:all]}") end |