Fetch Module
The Fetch module provides functions for retrieving GEOIDs based on various criteria, including spatial filters, state boundaries, and predefined regions.
Spatial Filtering
Functions for retrieving GEOIDs based on spatial criteria:
GeoIDs.Fetch.get_geoids_by_spatial_filter — Functionget_geoids_by_spatial_filter(filter_type::Symbol, parameters::Dict) -> Vector{String}Generate GEOIDs based on spatial filtering parameters.
Filter Types
:longitude: Filter by longitude range (requiresmin_lon,max_lon):latitude: Filter by latitude range (requiresmin_lat,max_lat):bounding_box: Filter by bounding box (requiresmin_lon,max_lon,min_lat,max_lat):distance: Filter by distance from point (requirescenter_lon,center_lat,radius_miles):state: Filter by state (requiresstatesas array of state abbreviations):intersects: Filter by intersection with geometry (requiresgeometry)
Example
# Get counties within longitude range
west_counties = get_geoids_by_spatial_filter(:longitude, Dict("min_lon" => -120.0, "max_lon" => -110.0))
# Get counties within 50 miles of Chicago
chicago_area = get_geoids_by_spatial_filter(:distance, Dict(
"center_lon" => -87.623177,
"center_lat" => 41.881832,
"radius_miles" => 50
))Regional and State Filters
Functions for retrieving GEOIDs based on predefined regions or state boundaries:
GeoIDs.Fetch.get_geoids_by_state — Functionget_geoids_by_state(state::String) -> Vector{String}Get GEOIDs for all counties in a state.
Arguments
state::String: State postal code (e.g., "CA")
Returns
Vector{String}: GEOIDs for counties in the state
Example
ca_geoids = get_geoids_by_state("CA")GeoIDs.Fetch.get_western_geoids — Functionget_western_geoids() -> Vector{String}Returns GEOIDs for counties west of 100°W longitude and east of 115°W longitude, getting the high plains counties with historically low rainfall (< 20 inches per year).
GeoIDs.Fetch.get_eastern_geoids — Functionget_eastern_geoids() -> Vector{String}Returns GEOIDs for counties between 90°W and 100°W longitude, getting the eastern counties with historically high rainfall (> 20 inches per year).
GeoIDs.Fetch.get_florida_south_geoids — Functionget_florida_south_geoids() -> Vector{String}Returns GEOIDs for Florida counties with centroids south of 29°N latitude.
County Information
Functions for retrieving information about counties:
Missing docstring for get_county_name. Check Documenter's build log for details.
Missing docstring for get_county_geom. Check Documenter's build log for details.
Missing docstring for get_county_centroid. Check Documenter's build log for details.
County Retrieval
Missing docstring for get_geoids_by_state. Check Documenter's build log for details.
GeoIDs.Fetch.get_geoids_by_states — Functionget_geoids_by_states(states::Vector{String}) -> Vector{String}Get GEOIDs for all counties in multiple states.
Arguments
states::Vector{String}: Vector of state postal codes (e.g., ["CA", "OR", "WA"])
Returns
Vector{String}: GEOIDs for counties in the specified states
Example
west_coast_geoids = get_geoids_by_states(["CA", "OR", "WA"])GeoIDs.Fetch.get_geoids_by_county_names — Functionget_geoids_by_county_names(state::String, counties::Vector{String}) -> Vector{String}Get GEOIDs for specific counties in a state by name.
Arguments
state::String: State postal code (e.g., "CA")counties::Vector{String}: Vector of county names
Returns
Vector{String}: GEOIDs for the specified counties
Example
socal_geoids = get_geoids_by_county_names("CA", ["Los Angeles", "Orange", "San Diego"])GeoIDs.Fetch.get_geoids_by_population_range — Functionget_geoids_by_population_range(min_pop::Int, max_pop::Int) -> Vector{String}Get GEOIDs for counties with population within the specified range.
Arguments
min_pop::Int: Minimum populationmax_pop::Int: Maximum population
Returns
Vector{String}: GEOIDs for counties in the population range
Example
rural_counties = get_geoids_by_population_range(0, 50000)GeoIDs.Fetch.get_geoids_by_custom_query — Functionget_geoids_by_custom_query(query::String, params::Vector=[]) -> Vector{String}Get GEOIDs using a custom SQL query.
Arguments
query::String: Custom SQL query (must return a 'geoid' column)params::Vector: Query parameters
Returns
Vector{String}: GEOIDs returned by the query
Example
custom_geoids = get_geoids_by_custom_query(
"SELECT geoid FROM census.counties WHERE name LIKE $1",
["%San%"]
)Module Index
GeoIDs.Fetch.get_eastern_geoidsGeoIDs.Fetch.get_florida_south_geoidsGeoIDs.Fetch.get_geoids_by_county_namesGeoIDs.Fetch.get_geoids_by_custom_queryGeoIDs.Fetch.get_geoids_by_population_rangeGeoIDs.Fetch.get_geoids_by_spatial_filterGeoIDs.Fetch.get_geoids_by_stateGeoIDs.Fetch.get_geoids_by_statesGeoIDs.Fetch.get_western_geoids