GeoIDs.jl
A Julia package for managing, storing, and manipulating geographic GEOID sets with versioning support.
Overview
GeoIDs.jl provides a comprehensive solution for working with Census GEOID identifiers, particularly at the county level. The package enables you to:
- Create and Manage Geographic Area Sets: Define sets of counties for analysis
- Track Changes Over Time: Full version history for every geographic definition
- Apply Set Operations: Union, intersection, difference, and symmetric difference
- Filter Spatially: Select counties by latitude, longitude, distance, or bounding box
- Back Up and Restore: Export and import full version history
- Access Census Data: Integrate with TIGER/Line shapefiles
Prerequisites
GeoIDs.jl requires:
- PostgreSQL database server (version 12 or higher)
- PostGIS extension (version 3.0 or higher)
Important: Before using GeoIDs.jl, follow our PostgreSQL Setup Guide to install and configure these prerequisites.
Installation
import Pkg
Pkg.add(url="https://github.com/technocrat/GeoIDs.jl.git")Quick Start
1. Set Up the Database
using GeoIDs
# Initialize the database (only needed once)
initialize_database()2. Create GEOID Sets
# Get all Florida counties
florida_counties = get_geoids_by_state("FL")
create_geoid_set("florida_counties", "All counties in Florida", florida_counties)
# Filter for southern Florida counties
south_fl = get_geoids_by_spatial_filter(:latitude, Dict(
"min_lat" => 25.0,
"max_lat" => 27.0
))
create_geoid_set("south_florida", "Southern Florida counties", south_fl)3. Perform Set Operations
# Get counties in Florida but not in South Florida
central_fl = difference_geoid_sets(
"florida_counties",
"south_florida",
"central_florida"
)
# Get coastal counties in Florida
coastal_fl = intersect_geoid_sets(
["florida_counties", "coastal_counties"],
"florida_coastal"
)4. List and Manage Sets
# List all available GEOID sets
sets = list_geoid_sets()
# View version history of a set
versions = list_geoid_set_versions("south_florida")
# Add a county to a set
new_version = add_to_geoid_set("south_florida", ["12021"]) # Add Collier County
# Revert to a previous version
rollback_geoid_set("south_florida", 1)Documentation
User Guides
- Setting up PostgreSQL
- Database Configuration
- Database Setup
- Getting Started
- GEOID Sets
- Spatial Filtering
- Set Operations
- Versioning System
API Reference
Index
GeoIDs.DB.executeGeoIDs.DB.execute_queryGeoIDs.DB.get_connectionGeoIDs.DB.get_connection_stringGeoIDs.DB.get_db_nameGeoIDs.DB.get_db_paramsGeoIDs.DB.setup_tablesGeoIDs.DB.with_connectionGeoIDs.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_geoidsGeoIDs.Operations.difference_geoid_setsGeoIDs.Operations.intersect_geoid_setsGeoIDs.Operations.symmetric_difference_geoid_setsGeoIDs.Operations.union_geoid_setsGeoIDs.Setup.download_county_shapefileGeoIDs.Setup.ensure_database_existsGeoIDs.Setup.extract_shapefileGeoIDs.Setup.initialize_databaseGeoIDs.Setup.load_counties_to_dbGeoIDs.Setup.setup_census_schemaGeoIDs.Store.add_to_geoid_setGeoIDs.Store.compare_geoid_set_versionsGeoIDs.Store.create_geoid_setGeoIDs.Store.create_geoid_set_versionGeoIDs.Store.delete_geoid_setGeoIDs.Store.get_geoid_setGeoIDs.Store.get_geoid_set_versionGeoIDs.Store.list_geoid_set_versionsGeoIDs.Store.list_geoid_setsGeoIDs.Store.remove_from_geoid_setGeoIDs.Store.rollback_geoid_setGeoIDs.backup_geoid_setsGeoIDs.initialize_predefined_geoid_setsGeoIDs.load_predefined_geoidsGeoIDs.restore_geoid_sets