Module: BroadbandMap::Client::Geography

Included in:
BroadbandMap::Client
Defined in:
lib/broadband_map/client/geography.rb

Instance Method Summary collapse

Instance Method Details

#geography_id(params = {}, options = {}) ⇒ Hash

Returns a geography of a specified geography type by the geography id.

Examples:

geography_id({:geography_type => 'congdistrict', :geography_id => '0111101'})

Parameters:

  • params (Hash) (defaults to: {})

    :geography_type, :geography_id and optional :format, :callback

  • options (Hash) (defaults to: {})

    A customizable set of options.

Returns:

  • (Hash)

See Also:



13
14
15
16
# File 'lib/broadband_map/client/geography.rb', line 13

def geography_id(params={}, options={})
  params = {:format => 'json'}.merge(params)
  get("geography/#{params[:geography_type]}/id/#{params[:geography_id]}?format=#{params[:format]}&callback=#{params[:callback]}")
end

#geography_type(params = {}, options = {}) ⇒ Hash

Returns all geographies of a specified geography type.

Examples:

geography_type({:geography_type => 'congdistrict', :max_results => 1000})

Parameters:

  • params (Hash) (defaults to: {})

    :geography_type, and optional :format, :max_results, :callback

  • options (Hash) (defaults to: {})

    A customizable set of options.

Returns:

  • (Hash)

See Also:



26
27
28
29
# File 'lib/broadband_map/client/geography.rb', line 26

def geography_type(params={}, options={})
  params = {:format => 'json', :max_results => 100}.merge(params)
  get("geography/#{params[:geography_type]}?format=#{params[:format]}&maxresults=#{params[:max_results]}&all=#{params[:all]}&callback=#{params[:callback]}")
end

#geography_type_name(params = {}, options = {}) ⇒ Hash

Returns geographies by name of a specific geography type.

Examples:

geography_type_name({:geography_type => 'censusplace', :geography_name => 'sei'})

Parameters:

  • params (Hash) (defaults to: {})

    :geography_type, :geography_name and optional :format, :max_results, :callback

  • options (Hash) (defaults to: {})

    A customizable set of options.

Returns:

  • (Hash)

See Also:



39
40
41
42
# File 'lib/broadband_map/client/geography.rb', line 39

def geography_type_name(params={}, options={})
  params = {:format => 'json', :max_results => 100}.merge(params)
  get("geography/#{params[:geography_type]}/name/#{params[:geography_name]}?format=#{params[:format]}&maxresults=#{params[:max_results]}&all=#{params[:all]}&callback=#{params[:callback]}")
end

#geography_type_name_state(params = {}, options = {}) ⇒ Hash

Returns geographies by name of a specific geography type within a state.

Examples:

geography_type_name_state({:geography_type => 'county', :state_fips => '17', :geography_name => 'mar'})

Parameters:

  • params (Hash) (defaults to: {})

    :state_fips, :geography_type, :geography_name and optional :format, :max_results, :callback

  • options (Hash) (defaults to: {})

    A customizable set of options.

Returns:

  • (Hash)

See Also:



65
66
67
68
# File 'lib/broadband_map/client/geography.rb', line 65

def geography_type_name_state(params={}, options={})
  params = {:format => 'json', :max_results => 100}.merge(params)
  get("geography/state/#{params[:state_fips]}/#{params[:geography_type]}/name/#{params[:geography_name]}?format=#{params[:format]}&maxresults=#{params[:max_results]}&all=#{params[:all]}&callback=#{params[:callback]}")
end

#geography_type_state(params = {}, options = {}) ⇒ Hash

Returns all geographies of specific geography type within a state.

Examples:

geography_type_state({:geography_type => 'msa', :state_fips => '01'})

Parameters:

  • params (Hash) (defaults to: {})

    :state_fips, :geography_type, :geography_type and optional :format, :max_results, :callback

  • options (Hash) (defaults to: {})

    A customizable set of options.

Returns:

  • (Hash)

See Also:



52
53
54
55
# File 'lib/broadband_map/client/geography.rb', line 52

def geography_type_state(params={}, options={})
  params = {:format => 'json', :max_results => 100}.merge(params)
  get("geography/state/#{params[:state_fips]}/#{params[:geography_type]}?format=#{params[:format]}&maxresults=#{params[:max_results]}&all=#{params[:all]}&callback=#{params[:callback]}")
end