domains / science / geospatial-remote-sensing / geomaster

geomaster

Skill card

combined

The K-Dense copy is a rigorous, versioned procedure that emphasizes provenance, CRS verification, alignment, and safe use of bundled helpers, while the Vibe-Skills copy is a broad catalog of installation commands and illustrative examples (including Earth Engine and a naive NDVI snippet) that the K-Dense copy explicitly warns against. Each contains material steps the other lacks, and they disagree on how to handle CRS and NDVI, so crowning one would hide a real alternative.

Repositories

RepositoryPath
K-Dense-AI/scientific-agent-skillsskills/geomaster/SKILL.md
foryourhealth111-pixel/Vibe-Skillsbundled/skills/geomaster/SKILL.md

Other copies

RoleRepositoryPath
peerK-Dense-AI/scientific-agent-skillsskills/geomaster/SKILL.md
peerforyourhealth111-pixel/Vibe-Skillsbundled/skills/geomaster/SKILL.md

Combined skill

---
name: geomaster
description: Geospatial research workflows for remote sensing, vector and raster GIS, spatial statistics, terrain and network analysis, and machine learning for Earth observation.
license: MIT License
metadata:
  version: "1.5"
  skill-author: K-Dense Inc.
---

# GeoMaster

Geospatial analysis across vector/raster GIS, remote sensing, spatial ML, terrain, networks, and scientific applications. Start with the relevant workflow, inspect input provenance, and load only the reference needed for the task.

## Installation

Set up a dedicated environment. Install only the workflow's optional dependencies.

```bash
uv venv --python 3.13
uv pip install geopandas==1.2.0 rasterio==1.5.2 shapely==2.1.2 pyproj==3.8.0
uv pip install rioxarray==0.23.0 xarray==2026.9.0 'dask[array]' scikit-learn==1.9.1
uv pip install pystac-client==0.9.0 planetary-computer==1.0.0 odc-stac
```

For native GIS applications, point cloud processing, or additional languages, install the required runtimes separately (e.g., conda-forge for GDAL/PDAL, R packages for sf/terra, Julia packages for ArchGDAL).

## Workflow

1. Record product/collection ID, acquisition time, processing baseline, license, band names, scale/offset, QA meaning, horizontal/vertical CRS and units.
2. Verify CRS from authoritative metadata. `set_crs` labels coordinates; `to_crs` transforms them. Never infer an unknown CRS from plausible bounds.
3. Align extent, affine transform, dimensions, pixel registration and resolution. Reproject categorical masks with nearest-neighbor resampling; choose an appropriate resampler for continuous data. Matching array shape alone does not prove alignment.
4. Preserve nodata, clouds, shadows and saturation masks. Convert unsigned integers to floating point before differences; apply the provider's radiometric transform once.
5. Run the analysis at a defensible support/resolution. Keep training labels and validation blocks separate. Terrain elevation and horizontal units must agree.
6. Export CRS, transform, valid-data mask, units, model settings and provenance. Check numeric expectations on a small known fixture before scaling up.

## Local Raster Recipes

Import the bundled raster helper from its directory. It implements small in-memory recipes; use windows/Dask for larger data. Writers require a new output path. It does not infer band identities or masks.

### NDVI

```python
from raster_workflows import write_ndvi

# This example assumes a VERIFIED four-band B02/B03/B04/B08 stack whose mask
# already excludes clouds/shadows, and harmonized DN reflectance = DN * 0.0001.
write_ndvi('s2_masked_stack.tif', 'ndvi.tif', red_band=3, nir_band=4,
           scale=0.0001, offset=0.0)
```

Do not use those indices or calibration for an arbitrary `sentinel2.tif`. SAFE products and STAC assets are often separate single-band rasters. Additive radiometric offsets affect even NDVI. EVI/SAVI require physical reflectance. `normalized_difference` keeps undefined ratios and invalid cells as NaN, not zero.

### Terrain

```python
import rasterio
from raster_workflows import terrain_metrics

with rasterio.open('dem_metres.tif') as src:
    slope_deg, aspect_deg, shade = terrain_metrics(
        src.read(1, masked=True), src.transform, src.crs)
```

The helper requires a north-up projected metric grid and elevations in metres. Aspect points downslope clockwise from north; it is undefined for flat cells. Slope is resolution-aware; nodata contaminating a derivative stencil stays invalid. Hillshade is an illumination visualization, not hydrological flow or exposure risk.

### Classification

```python
import geopandas as gpd
from raster_workflows import classify_imagery

training = gpd.read_file('training.gpkg')  # polygons with class_id in 1..65534
model = classify_imagery('masked_features.tif', training, 'classified.tif')
```

The helper checks CRS, geometry, labels, valid training pixels and overlapping labels, then preserves nodata in a uint16 output. It fits a small demonstration model; it does not measure accuracy. Use spatial/temporal holdouts at the field, scene or regional level before reporting predictive performance.

## Vector Analysis

```python
import geopandas as gpd

zones = gpd.read_file('zones.geojson')
points = gpd.read_file('points.geojson')
if zones.crs is None or points.crs is None:
    raise ValueError('Resolve missing CRS before analysis')
points = points.to_crs(zones.crs)
joined = gpd.sjoin(points, zones, how='inner', predicate='within')
stats = joined.groupby('zone_id')['value'].agg(['count', 'mean', 'std'])

# Local data only: verify the estimated CRS area of use before accepting it.
metric = zones.to_crs(zones.estimate_utm_crs())
metric['area_m2'] = metric.area
buffers = metric.geom.buffer(100)
```

## Conflicts

- **CRS Verification**: K-Dense-AI/scientific-agent-skills requires verifying CRS from authoritative metadata and never inferring an unknown CRS, while foryourhealth111-pixel/Vibe-Skills simply checks if CRS differ and transforms without that verification step.
- **NDVI Handling**: K-Dense-AI/scientific-agent-skills warns against using arbitrary band indices or calibration for an arbitrary sentinel2.tif and keeps invalid cells as NaN, while foryourhealth111-pixel/Vibe-Skills reads bands 4 and 8 directly and replaces NaN with 0.
- **Installation**: K-Dense-AI/scientific-agent-skills pins specific package versions and uses uv for a dedicated environment, while foryourhealth111-pixel/Vibe-Skills recommends conda-forge and lists many additional optional packages without version pins.