GEO INFER DATA

From ActiveInferenceInstitute/GEO-INFER · View interactive version

GEO INFER DATA is an AI agent skill from the GitHub repository ActiveInferenceInstitute/GEO-INFER. Data connectors, ETL pipelines, and data management for geospatial datasets. Use when loading spatial data from databases, APIs, files (GeoJSON, Shapefile, GeoParquet), or building data transformation pipelines.

How to use this skill

Skill file

GEO-INFER-DATA

Instructions

Core Capabilities

Key Imports

from geo_infer_data import (
    MultiSourceDataIngestion,
    IntelligentETLPipeline,
    AdaptiveDataStorage,
    DataQualityManager,
)
from geo_infer_data.connectors.file import FileConnector
from geo_infer_data.connectors.database import DatabaseConnector
from geo_infer_data.connectors.cloud import S3Connector
from geo_infer_data.utils.validation import GeospatialValidator
from geo_infer_data.utils.indexing import SpatialIndexer
from geo_infer_data.models.schemas import DatasetMetadata, DataLineage

Examples

Read and validate a GeoJSON file:

import asyncio

from geo_infer_data.connectors.file import FileConnector
from geo_infer_data.utils.validation import GeospatialValidator


async def main() -> None:
    connector = FileConnector()
    gdf = await connector.read_geospatial("data/buildings.geojson")
    print(f"Loaded {len(gdf)} features")

    check = await GeospatialValidator().validate_data(gdf)
    print(f"Quality: {check.score:.2f} ({check.status})")


asyncio.run(main())

Store data and query it back with spatial/temporal filters:

import asyncio

from geo_infer_data import AdaptiveDataStorage
from geo_infer_data.models.schemas import DatasetMetadata, DataLineage


async def main() -> None:
    storage = AdaptiveDataStorage(storage_backends=["local"])
    metadata = DatasetMetadata(
        title="sensor readings",
        lineage=DataLineage(source="demo", process="ingest", created_by="script"),
    )

    data_id = await storage.store_geospatial_data(gdf, metadata)
    results = await storage.adaptive_query(
        spatial_bounds=[-122.5, 37.7, -122.3, 37.9],
        temporal_range=(start, end),
    )
    print(f"Stored {data_id}; query returned {len(results)} rows")


asyncio.run(main())

Run the ETL pipeline:

from geo_infer_data import IntelligentETLPipeline

pipeline = IntelligentETLPipeline(workflow_config=None, error_recovery="intelligent_retry")
result = await pipeline.execute_workflow(
    source_data=raw_data,
    target_storage=storage,
    transformation_rules={"reproject_to": "EPSG:4326", "validate_bounds": True},
)

Agent interfaces

Use uv run --frozen geo-infer catalog DATA to discover public source

APIs, then geo-infer describe before calling a selected target. Scripts use

geo_infer_api.agent_runtime.AgentSession; the optional stdio MCP server is

geo-infer-mcp. See requests, native objects and composition.

The adapter retains this module's dependencies and authorization requirements.

Guidelines

Integrations

Dataset/model and cache timestamps require explicit timezone offsets and normalize

to UTC through geo_infer_time.core.timestamps.normalize_timestamp. Select backend

extras explicitly: postgres (psycopg2 + asyncpg), s3 (boto3), minio, redis,

and raster (rasterio). Base/local operations do not import those clients; an

unavailable selected backend raises an error naming its installation extra.

HTTP connector calls and downloads run off the event loop; requests are spaced

using a monotonic clock, and failed pagination does not return partial success.

DuckDB Spatial verification

Provision official signed HTTPFS and Spatial matching the installed stable DuckDB

version and native platform with

uv run python GEO-INFER-DATA/provision_duckdb_spatial.py. Python HTTPS downloads

bootstrap HTTPFS without DuckDB's auto-install path. The product identifies

itself to the repository; TLS verification and official-origin redirect checks

remain enabled. Both gzip archives download and decompress before installation.

A separate, stdlib-only worker bounds DNS, TLS, headers, body and gzip parsing;

--download-timeout 120 shares one monotonic download budget, and

--max-extension-bytes 536870912 limits each compressed and decompressed archive.

DuckDB verifies signatures with unsigned extensions disabled. The success JSON

records runtime ABI, official URLs, decompressed sizes and SHA-256 hashes.

An ordinary failure returns failed JSON, full diagnostic stderr and exit 1;

no retry or cached extension can certify a failed download. Installation itself

is not a transaction across extensions: a later install failure can leave the

first signed extension installed. read_cloud_native_vector(path, require_duckdb=True) requires the

actual DuckDB path and propagates backend errors. Normal reads load an installed

extension without downloading one; GeoParquet uses native Parquet with declared

WKB geometry columns and preserves their names, null geometries and CRS.

GeoParquet is a hybrid reader: native DuckDB supplies geometry and compatible

Arrow fields; selective original Arrow reads retain physical index fields and

changed types such as timezone-aware nanosecond timestamps and ordered

categories. Original pandas metadata restores Index/MultiIndex/RangeIndex,

nullable/string dtypes and timezone labels. This operation lazily requires

geo-infer-data[integrations] (including PyArrow); source files are read only.

The native single-file scan explicitly preserves insertion order and validates

schema/row counts against the original Parquet file; reader layer/keyword options use GeoPandas

when they are unsupported by DuckDB.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.