GeoIDs.jl GitHub

Core Module#

The Core module contains foundational functionality for GeoIDs.jl, including predefined GEOID constants, initialization functions, and backup/restore capabilities.

Predefined Constants#

The following constants provide quick access to common geographic regions. They are loaded from the database during package initialization:

  • WESTERN_GEOIDS: Counties west of 100°W longitude (traditionally requiring irrigation)

  • EASTERN_GEOIDS: Counties between 90°W and 100°W (historically high rainfall)

  • FLORIDA_SOUTH_GEOIDS: Florida counties south of 29°N latitude

  • COLORADO_BASIN_GEOIDS: Counties in the Colorado River Basin

Initialization Functions#

GeoIDs.initialize_predefined_geoid_sets

source
initialize_predefined_geoid_sets()

Initialize all predefined GEOID sets in the database. This is called during the first module load to ensure all standard GEOID sets are available in the versioned database.

GeoIDs.load_predefined_geoids

source
load_predefined_geoids()

Load all predefined GEOID sets from the database into module constants.

GeoIDs.Setup.initialize_database

source
initialize_database()

Main function to set up the database schema, use the local shapefile, and load county data to the database.

Note: The initialize_database function now uses a local shapefile from the GeoIDs.jl/data directory instead of downloading it from the internet. The function also now uses PostgreSQL's default socket authentication for local connections.

Backup and Restore#

These functions enable exporting and importing GEOID sets with their complete version history:

GeoIDs.backup_geoid_sets

source
backup_geoid_sets(output_file::String)

Create a complete backup of all GEOID sets and their versions.

Arguments

  • output_file::String: Path to save the backup file (JSON format)

Example

backup_geoid_sets("geoid_sets_backup_2023-10-15.json")

GeoIDs.restore_geoid_sets

source
restore_geoid_sets(input_file::String, overwrite::Bool=false)

Restore GEOID sets from a backup file.

Arguments

  • input_file::String: Path to the backup file

  • overwrite::Bool: Whether to overwrite existing sets

Example

restore_geoid_sets("geoid_sets_backup_2023-10-15.json")

Module Index#