Metadata-Version: 2.4
Name: geo-micro
Version: 0.1.0
Summary: A zero-dependency micro-utility for fast GeoJSON sanitisation and spatial checks.
Author-email: Coby Williams <cobyw16@hotmail.com>
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: GIS
License-File: LICENSE
Project-URL: Homepage, https://github.com/LionEmpire/geo-micro

# geo-micro

A zero-dependency, ultra-lightweight (<10KB) Python utility for GeoJSON sanitisation, coordinate order correction, bounding box calculations, and fast ray-casted point-in-polygon checks.
Designed for AWS Lambda functions, microservices, and edge computing environments where heavy C-based libraries like Shapely or GDAL are overkill.

## Features

- Zero External Dependencies
- Dirty Data Repair (string coordinates to floats and auto-closes unclosed polygon rings)
- Coordinate Swapper: (`[Lat, Lng]` to `[Lng, Lat]` and vice versa)
- Point-in-Polygon

## Quickstart

```python
from geomicro import GeoMicro, convert_coords

# 1. Fix Lat/Lng order for a list of coordinates
bad_coords = [[-27.468, 153.028], [-27.470, 153.030]]
fixed = convert_coords(bad_coords, mode="to_geojson")

# 2. Check containment and bounding boxes
polygon_feature = {
    "type": "Polygon",
    "coordinates": [[[153.0, -27.0], [154.0, -27.0], [154.0, -28.0], [153.0, -27.0]]]
}

geo = GeoMicro(polygon_feature)
print(geo.bbox()) # (153.0, -28.0, 154.0, -27.0)
print(geo.contains([153.5, -27.5])) # True
```

