Skip to content
Back to skills

GEO INFER API

ASecurity

REST API endpoints for geospatial services. Use when building API routes, defining spatial query endpoints, or exposing GEO-INFER functionality as web services.

  • 17 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 1, 2026
developmentpythongofastapiapifrontend

Works with

  • api

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned September 22, 2026

npx -y skills add ActiveInferenceInstitute/GEO-INFER --skill GEO-INFER-API --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of GEO INFER API?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for GEO INFER API
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/activeinferenceinstitute-geo-infer-api/badge)](https://www.skillsdirectory.com/skills/activeinferenceinstitute-geo-infer-api)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: geo-infer-api
description: REST API endpoints for geospatial services. Use when building API routes, defining spatial query endpoints, or exposing GEO-INFER functionality as web services.
prerequisites:
  required:
    - geo-infer-data
  recommended:
    - geo-infer-space
    - geo-infer-time
difficulty: intermediate
estimated_time: 45min
examples_dir: ../GEO-INFER-EXAMPLES/examples/
---

# GEO-INFER-API

## Instructions

### Core Capabilities

- **REST endpoints**: FastAPI app with health, GeoJSON feature, and processing-algorithm routes (`/api/v1`)
- **GeoJSON utilities**: RFC 7946 models plus validation, ray-cast containment, buffering, and RDP simplification helpers
- **Middleware**: error handling and request logging wired into `create_app`
- **CORS**: explicit, wildcard-free origin lists enable credentialed CORS (fail-closed)

Out of scope for this module: GraphQL schema, JWT/API-key authentication middleware, rate limiting. There is no auth middleware today; `SECRET_KEY` is a required fail-closed setting only.

### Key Imports

```python
from geo_infer_api.app import create_app
from geo_infer_api.core.config import Settings, get_settings
from geo_infer_api.core.middleware import ErrorHandlerMiddleware, RequestLoggingMiddleware
from geo_infer_api import (
    Feature, FeatureCollection, Polygon, PolygonFeature,
)
from geo_infer_api.utils.geojson_helpers import (
    polygon_contains_point, create_buffer, simplify_polygon,
    calculate_polygon_area, validate_polygon_rings,
)
```

### Examples

Build the FastAPI application (requires `SECRET_KEY` to be set):

```python
import os
os.environ["SECRET_KEY"] = "change-me"

from geo_infer_api.app import create_app
app = create_app()  # serve with: uvicorn geo_infer_api.app:main_app
```

Point-in-polygon and buffering on GeoJSON polygons:

```python
from geo_infer_api.utils.geojson_helpers import polygon_contains_point, create_buffer

square = {"type": "Polygon", "coordinates": [[(0, 0), (10, 0), (10, 10), (0, 10), (0, 0)]]}
assert polygon_contains_point(square, (5.0, 5.0)) is True
buffered = create_buffer(square, distance=1.0, unit="kilometers")
```

## Guidelines

- FastAPI with async handlers for spatial operations
- Response format defaults to GeoJSON (RFC 7946, `[lon, lat]` coordinate order)
- The polygon feature store is process-local memory — data does not survive worker restarts; it is capped at `polygon_store_max_size` (default 10,000) and further POSTs beyond the cap return 409 RESOURCE_CONFLICT
- Test: `uv run python GEO-INFER-TEST/run_unified_tests.py --module API`

### Integrations

- **SEC** → JWT/API-key authentication middleware
- **DATA** → Spatial query endpoint data sources
- **SPACE** → H3 and geographic query parameters (algorithms router proxies `geo_infer_space.core.algorithm_registry` when installed; 503 otherwise)
- **OPS** → API monitoring via `/health`
- **APP** → Frontend consuming API endpoints

Files in this skill

  • AGENTS.md1.5 KB
  • README.md1.1 KB
  • SKILL.md2 KB
  • docs/AGENTS.md1.2 KB
  • docs/README.md1000 B
  • docs/algorithms_api.md2 KB
  • docs/geojson_api.md1.6 KB
  • docs/openapi_spec.yaml32.2 KB
  • examples/AGENTS.md1.2 KB
  • examples/README.md1.5 KB
  • examples/curl_examples.sh4 KB
  • examples/javascript_client.js9.7 KB
  • examples/python_client.py7.7 KB
  • pyproject.toml3.4 KB
  • requirements.txt381 B
  • setup.py1.5 KB
  • src/AGENTS.md1.1 KB
  • src/README.md954 B
  • src/geo_infer_api/AGENTS.md1.2 KB
  • src/geo_infer_api/README.md1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.