GeoIDs.jl GitHub

Store Module#

The Store module provides functions for creating, retrieving, and managing GEOID sets in the database with versioning support.

Creating GEOID Sets#

Functions for creating new GEOID sets and versions:

GeoIDs.Store.create_geoid_set

source
create_geoid_set(set_name::String, description::String="", geoids::Vector{String}=String[])

Create a new GEOID set with optional initial members.

GeoIDs.Store.create_geoid_set_version

source
create_geoid_set_version(set_name::String, geoids::Vector{String}, 
                        change_description::String="", base_version::Int=0,
                        description::String="") -> Int

Create a new version of an existing GEOID set or create a new set (version 1) if it doesn't exist.

Arguments

  • set_name::String: Name of the set

  • geoids::Vector{String}: GEOIDs for the new version

  • change_description::String: Description of what changed in this version

  • base_version::Int: Base version to create from (0 means latest version or new set)

  • description::String: Description for the set (only used for new sets)

Returns

  • Int: The new version number

Retrieving GEOID Sets#

Functions for retrieving GEOID sets and their versions:

GeoIDs.Store.get_geoid_set

source
get_geoid_set(set_name::String) -> Vector{String}

Get the current version of a GEOID set.

Arguments

  • set_name::String: Name of the set

Returns

  • Vector{String}: GEOIDs in the current version of the set

GeoIDs.Store.get_geoid_set_version

source
get_geoid_set_version(set_name::String, version::Int=0) -> Vector{String}

Get GEOIDs for a specific version of a set. Use version=0 for current version.

Arguments

  • set_name::String: Name of the set

  • version::Int: Version to retrieve (0 means current version)

Returns

  • Vector{String}: GEOIDs in the specified version

GeoIDs.Store.list_geoid_sets

source
list_geoid_sets() -> DataFrame

List all available GEOID sets.

GeoIDs.Store.list_geoid_set_versions

source
list_geoid_set_versions(set_name::String) -> DataFrame

List all versions of a GEOID set with change information.

Arguments

  • set_name::String: Name of the set

Returns

  • DataFrame: DataFrame with version info

Modifying GEOID Sets#

Functions for adding to or removing from GEOID sets:

GeoIDs.Store.add_to_geoid_set

source
add_to_geoid_set(set_name::String, geoids::Vector{String}, change_description::String="Added GEOIDs") -> Int

Add GEOIDs to an existing set by creating a new version.

Arguments

  • set_name::String: Name of the set

  • geoids::Vector{String}: GEOIDs to add

  • change_description::String: Description of the change

Returns

  • Int: The new version number

GeoIDs.Store.remove_from_geoid_set

source
remove_from_geoid_set(set_name::String, geoids::Vector{String}, change_description::String="Removed GEOIDs") -> Int

Remove GEOIDs from an existing set by creating a new version.

Arguments

  • set_name::String: Name of the set

  • geoids::Vector{String}: GEOIDs to remove

  • change_description::String: Description of the change

Returns

  • Int: The new version number

Version Management#

Functions for managing and comparing versions:

GeoIDs.Store.rollback_geoid_set

source
rollback_geoid_set(set_name::String, version::Int) -> Int

Rollback a GEOID set to a previous version by creating a new version.

Arguments

  • set_name::String: Name of the set

  • version::Int: Version to rollback to

Returns

  • Int: The new version number (after rollback)

GeoIDs.Store.compare_geoid_set_versions

source
compare_geoid_set_versions(set_name::String, version1::Int, version2::Int) -> Dict

Compare two versions of a GEOID set and return differences.

Arguments

  • set_name::String: Name of the set

  • version1::Int: First version to compare

  • version2::Int: Second version to compare

Returns

  • Dict: Dictionary with 'added', 'removed', and 'common' GEOIDs

Deleting GEOID Sets#

GeoIDs.Store.delete_geoid_set

source
delete_geoid_set(set_name::String)

Delete a GEOID set and all its versions.

Arguments

  • set_name::String: Name of the set to delete

Module Index#