Skip to main content

Small, dependency-light geospatial feature primitives: distance, jitter, coordinate validation and normalization.

Project description

aei-geo-features

PyPI version

Small, dependency-light geospatial feature primitives for tabular data: great-circle distance, distance-to-landmark, location-jitter (movement between successive points), coordinate normalization, and coordinate validation. Built on pandas/numpy only - no geopandas, no shapely, no Dask, no network calls.

Status: published on PyPI. This repository is public on GitHub under Apache License 2.0. See the production PyPI project page.

Why this exists

aei-geo-features is a small, general-purpose geospatial feature utility

  • distance, jitter, coordinate validation and normalization over tabular data. It exists as a small, independently reviewable example of AID Edge Inc.'s engineering quality: typed errors, deterministic functions, no hidden I/O, and a test suite that exercises real behavior rather than mocks.

This project is separate from, and does not include, any part of AID Edge Inc.'s proprietary Velorona telecom and decision-intelligence capabilities. It contains only generic geospatial math and ships with no data beyond three widely-known public landmarks used as illustrative examples - no telecom, network, or detection-specific logic of any kind.

Install

pip install aei-geo-features

Quick start

import pandas as pd
from aei_geo_features import haversine_distance, add_distance_to_landmark

# Single-pair distance
toronto = (43.6426, -79.3871)
paris = (48.8584, 2.2945)
print(haversine_distance(*toronto, *paris))  # km

# DataFrame feature helper
df = pd.DataFrame({"latitude": [43.64], "longitude": [-79.38]})
df = add_distance_to_landmark(df, landmark="CN_TOWER")

See examples/basic_usage.py for a complete, runnable example.

Public API

Function / value Purpose
haversine_distance(lat1, lon1, lat2, lon2, unit="km") Great-circle distance between two points.
validate_coordinate(lat, lon) Raises InvalidCoordinateError for an out-of-range or non-numeric pair; returns True otherwise.
add_distance_to_landmark(df, landmark=..., ...) Adds a distance-to-landmark column to a DataFrame.
add_location_jitter(df, ...) Adds a distance-from-previous-row column (optionally time-sorted first).
normalize_coordinates(df, ...) Clips latitude to [-90, 90], wraps longitude into [-180, 180].
validate_dataframe(df, ...) Validates a DataFrame's coordinate columns exist, are numeric, and are in range.
REFERENCE_LANDMARKS Three illustrative public landmarks (CN Tower, Eiffel Tower, Statue of Liberty) - not a claim about any real deployment or dataset.
GeoFeatureError and subclasses (InvalidCoordinateError, MissingColumnError, UnsupportedUnitError, LandmarkNotFoundError) Typed, catchable errors - never a bare ValueError/Exception for a domain failure.

This is deliberately a narrow API. It does not include polygon region assignment, CRS transformation, spatial indexing, or GeoJSON export - those are heavier, geopandas/shapely/pyproj-dependent capabilities that were evaluated and intentionally excluded from this release candidate (see CHANGELOG.md and the project's internal audit notes) as out of scope for a small, narrowly-useful public library. They may be reconsidered for a future major version if there is real external demand.

What this is not

  • Not a GIS platform. No polygon operations, no coordinate-reference-system transforms, no spatial database integration.
  • Not a routing, geocoding, or reverse-geocoding library.
  • Not affiliated with the Apache Software Foundation. "Apache License 2.0" refers only to the license text under which this project is distributed
    • see LICENSE.
  • Not a certified or compliance-audited product. No FIPS, SOC 2, GDPR, ISO 27001, or similar claim is made anywhere in this project.

Dependencies

Runtime: pandas, numpy. Nothing else. See CHANGELOG.md for the full dependency and license audit.

Security

See SECURITY.md for supported versions and how to report a vulnerability privately. See docs/PUBLISHING.md for the release process. PyPI releases use Trusted Publishing with OIDC and no stored API token.

Contributing

See CONTRIBUTING.md.

License

Apache License 2.0 - see LICENSE.

Copyright 2026 AID Edge Inc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aei_geo_features-0.1.3.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aei_geo_features-0.1.3-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file aei_geo_features-0.1.3.tar.gz.

File metadata

  • Download URL: aei_geo_features-0.1.3.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for aei_geo_features-0.1.3.tar.gz
Algorithm Hash digest
SHA256 82c6377421d7c085b926970ef8ea821bfa0a9f53cae5bf246aeb3a8501cac329
MD5 1297eea46c2e5797d8d7360049986cf3
BLAKE2b-256 9fb8a1dd939cf0af93f898fa4a893d71db1cb2693f603e546f6bc5aba9d88b67

See more details on using hashes here.

Provenance

The following attestation bundles were made for aei_geo_features-0.1.3.tar.gz:

Publisher: publish.yml on AIDEdgeInc-Lab/aei-geo-features

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aei_geo_features-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for aei_geo_features-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7a77ee32a22236dd47003a3fbee08868703ce38c8ae6473a93ab274c0c92e98a
MD5 1c1a5b9286e0a5f8bfb170b2d3a675df
BLAKE2b-256 43da342414cdf8ea57ef8263c69444d462b28534416c4e3e7694583d2d399068

See more details on using hashes here.

Provenance

The following attestation bundles were made for aei_geo_features-0.1.3-py3-none-any.whl:

Publisher: publish.yml on AIDEdgeInc-Lab/aei-geo-features

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page