· 1 observation
Technical updates · 1
Package or technical metadata updated
View technical comparison →Muhammed Enes Duran v0.4.0
Measured geospatial workflows
From the developer
Not specified in the available declarations: limitations, pricing & account requirements.
Design a leakage-safe GeoAI workflow for my geospatial project.
Developer declarations; not independently tested. Listing last checked Nov 22, 2026. Package observed Nov 21, 2026.
From the marketplace listing
Eighteen measured Agent Skills for the full GeoAI lifecycle, with explicit safeguards for CRS, spatial leakage, uncertainty, provenance, and silent geospatial failure modes.
Language: English · Automatically detected from descriptions.
· 1 observation
Package or technical metadata updated
View technical comparison →· 2 observations
Package or technical metadata updated
View technical comparison →· 2 observations
Package or technical metadata updated
View technical comparison →Package or technical metadata updated
View technical comparison →Finding similar plugins… Results will appear here automatically.
Browse plugins →--- name: arcgis-pro-automation description: >- Automate controlled local ArcGIS Pro and ArcPy workflows through arcgis-mcp-bridge: inspect .aprx projects and file geodatabases, run geoprocessing, projection, raster, network, spatial-statistics, editing, symbology, and layout export with path and mutation guards. Use when the user explicitly names ArcGIS Pro, ArcPy, .aprx, .gdb, Esri geoprocessing, muend/arcgis-mcp-bridge, its health_check, PathGuard, or confirmation gates, or sketch-to-GIS extraction. Do not trigger for ArcGIS Online or Enterprise administration, QGIS or PyQGIS, generic open-source GIS, or live GUI control of an already-open ArcGIS Pro session. license: MIT metadata: author: Muhammed Enes Duran --- # ArcGIS Pro Automation Operate saved ArcGIS Pro projects and local GIS datasets through the guarded `arcgis-mcp-bridge` tool surface. Treat the bridge as an execution backend, not as permission to mutate data or claim a result that was never observed. ## Establish the boundary - Require Windows, a licensed ArcGIS Pro installation, and a bridge worker interpreter that can import ArcPy for real geoprocessing. - Use the bridge for local, headless, repeatable ArcPy work. It does not drive the visible ArcGIS Pro UI and does not administer ArcGIS Online or Enterprise. - If the bridge tools are not callable, provide setup or a dry execution plan. Never simulate tool output or imply that an `.aprx` or `.gdb` changed. - Use the schemas exposed by the connected MCP server. Tool names may be host- namespaced; match the semantic catalog name and never invent parameters. - Keep every read and write inside the configured allowed roots. Use absolute paths and a dedicated scratch geodatabase for intermediate outputs. Read [runtime and licensing](references/runtime-and-licensing.md) before the first execution or whenever setup, extension availability, or worker failures are in scope. ## Execute the workflow 1. **Define the contract.** Identify inputs, intended output artifacts, CRS and units, whether a saved `.aprx` must change, and which operations create, overwrite, append, or edit data. 2. **Preflight.** Call `health_check` first. Inspect its worker interpreter, allowed roots, scratch GDB, timeout, and concurrency. Because this call does not import ArcPy, follow it with a non-mutating ArcPy-backed request such as `get_spatial_reference`, `describe_dataset`, or `list_layers` before treating the runtime as execution-ready. 3. **Inspect before acting.** Read dataset descriptions, counts, fields, CRS, extents, project maps/layers, and required extension licenses. Resolve datum transformations, units, and output naming before analysis. 4. **Plan exact tools.** Select the smallest declarative sequence from [tool routing](references/tool-routing.md). Separate read-only inspection, new-output creation, and in-place mutation. Prefer new outputs and working copies over edits to source data. 5. **Authorize mutations.** Read [safety and validation](references/safety-and-validation.md) before any write. Set `confirm=true` only when the user's request clearly authorizes the exact mutating operation and target. Treat `overwrite=true` as a separate explicit decision. Stop on ambiguous target, scope, or intent. 6. **Execute incrementally.** Run one dependent step at a time; preserve returned output paths and geoprocessing messages. Parallelize only independent jobs when license seats, memory, and `max_workers` are known to support them. 7. **Verify independently.** Re-open outputs and test the relevant invariants: existence, count, geometry validity, CRS and units, raster statistics and NoData, network solve status, project contents, or exported layout dimensions. A success status alone is not evidence of a correct GIS result. ## Route domain method and execution separately Use this skill for the ArcGIS execution layer. Pair it with the relevant doma
Preview of the first 4,000 characters. Read full instructions →
Referenced files: 5 — file references are metadata, not package contents.
---
name: cartography-geoviz
description: >-
Always invoke before answering any request to create, compare, design, or
review a user-facing map, even if the request is terse or underspecified.
Covers publication maps, choropleths, map series and small multiples,
comparable multi-date panels, proportional/bivariate/flow maps, raster
rendering, and interactive web maps. Includes classification, color,
legends, projections, accessibility, and large-data aggregation. Do not
trigger for a temporary diagnostic plot inside another analysis.
license: MIT
metadata:
author: Muhammed Enes Duran
---
# Cartography & Geovisualization
Purpose: maps that communicate honestly. Cartographic choices (class
breaks, ramps, normalization, projection) can manufacture or hide
patterns; this skill treats them as analytical decisions with stated
rationale, not styling.
## The first three questions
1. **What's the message?** One map = one message. If two variables
compete, consider small multiples or a bivariate scheme — not twelve
legend classes.
2. **Normalized?** Choropleths of raw counts are population maps in
disguise. Rates, densities, or per-capita for area-based color; raw
magnitudes → proportional symbols instead.
3. **Static or interactive?** Print/PDF/paper → matplotlib/QGIS layout;
exploration/stakeholders → Folium/MapLibre; big point data →
Kepler.gl/deck.gl (GPU).
## Thematic map type selection
| Data | Map type |
|---|---|
| Rate/ratio by polygon | Choropleth |
| Count/magnitude by place | Proportional/graduated symbols |
| Two related rates | Bivariate choropleth (3×3 max) |
| Individual-level density | Dot density or KDE surface (label bandwidth) |
| Continuous field (raster) | Classified or stretched render + hillshade context |
| Movement/OD | Flow map (width∝volume), aggregate to avoid hairballs |
| Change over time | Small multiples > animation for analysis; animation for outreach |
## Classification — the honesty lever
- **Natural breaks (Jenks)**: default for skewed data; breaks are
data-specific, so NOT comparable across maps/dates.
- **Quantiles**: guaranteed color balance; can split near-identical values.
- **Equal interval**: comparable and intuitive; fails on skew.
- **Manual/defined**: the ONLY correct choice for map series (same breaks
across all dates/regions) and for domain thresholds (WHO limits, slope
classes).
- 5±2 classes; show the histogram with breaks in the workflow; state the
scheme in the caption/metadata. Try two schemes — if the story changes
materially, the story is the classification, and the reader must be told.
## Color
- Ramps from ColorBrewer/`cmcrameri`/viridis family: sequential (ordered),
diverging (meaningful midpoint — zero, mean, threshold), qualitative
(categories, ≤ 8).
- Colorblind-safe by default (~8% of male readers); never red-green
diverging without checking a CVD simulator.
- NoData ≠ zero: render as neutral gray with its own legend entry, never
the ramp's low end.
- Muted basemaps (CartoDB Positron) under thematic layers — the basemap
must never win.
## Projection for display
- Web tiles = Web Mercator: fine for city scale; area comparisons at
continental scale on Mercator are visual lies — use equal-area
projections (Albers, Mollweide, Equal Earth) for static thematic maps of
large extents.
- National mapping → the national grid; polar work → polar stereographic.
- Label the projection on publication maps.
## Required furniture (publication static maps)
Title (the message, not the filename), legend (units!, sensible number
formatting), scale bar (projected CRS only — degrees have no fixed scale),
north arrow (only when north isn't up or the audience expects it), data
source + date + projection + author, and an inset locator map for
unfamiliar regions.
```python
# GeoPandas static map core
ax = gdf.plot(column="rate_per_1k", scheme="naturalbreaks", k=5,
cmap="YlGnBu", legend=True, edgecolor="white", liPreview of the first 4,000 characters. Read full instructions →
Referenced files: 2 — file references are metadata, not package contents.
--- name: change-detection description: >- Change analysis, once the observations are comparable. Not for cases whose blocker is comparability itself: mixed sensors, product levels or processing baselines to remote-sensing-analysis, undocumented vertical datums to point-cloud-lidar, multi-decade archive trends over large areas to google-earth-engine. Matching product level does not prove comparability. Otherwise invoke for what, where or how much changed: two-scene comparison, deforestation, urban growth, disaster damage, parcel-change audits, bi-temporal differencing, post-classification comparison, adjusted area, break detection in a series in hand (BFAST/LandTrendr/CCDC). Seasonal mismatch is this skill's own confounder; a documented datum with a stated accuracy budget is settled comparability. Keep both. license: MIT metadata: author: Muhammed Enes Duran --- # Change Detection & Spatio-temporal Analysis Purpose: separate real surface change from the four great impostors — misregistration, radiometric drift, phenology, and classification error. Every method below exists to control one of them; skipping the controls produces confident maps of nothing. ## Preconditions (where change detection is won or lost) Preconditions 1 and 2 are *checked* here but *established* elsewhere. When either fails, the owning skill leads and this skill resumes once comparable observations exist. Precondition 3 is this skill's own problem and is never a reason to route away. 1. **Co-registration**: sub-pixel alignment between dates (AROSICS or manual tie-points). Half a pixel of shift creates edge-shaped phantom change everywhere. Verify: flicker-compare crisp features. For elevation surfaces or point clouds, vertical datum agreement, co-registration and the vertical-accuracy budget belong to `point-cloud-lidar` — a datum offset is not subsidence. 2. **Radiometric consistency**: same processing level (surface reflectance), same sensor, same processing baseline. If any of the three differ, this is a harmonization problem, not a thresholding one: hand it to `remote-sensing-analysis` (HLS for Landsat↔Sentinel-2, relative normalization with PIFs, `BOA_ADD_OFFSET` across the Sentinel-2 2022 baseline change). 3. **Same season / phenological stage** for bi-temporal work — a May vs September pair "detects" summer. If season can't be matched, use composites or time-series methods instead. 4. **Cloud/shadow masks intersected across dates**; analyze only mutually valid pixels and report that coverage %. ## Method selection | Situation | Method | |---|---| | Two dates, continuous "how much" | Index differencing (ΔNDVI, ΔNBR...) with statistical thresholding | | Two dates, categorical "from-what-to-what" | Post-classification comparison (only with strong classifiers) | | Two dates, multivariate robust | Change vector analysis (CVA); MAD/iMAD for sensor-robust detection | | Dense stack, gradual + abrupt | Trend + break analysis (BFAST/LandTrendr/CCDC family; at archive scale → `google-earth-engine`) | | Structure change (buildings) | DL bi-temporal segmentation (siamese U-Net) → `geo-deep-learning` | | SAR pairs (clouds, disasters) | Log-ratio of calibrated backscatter + speckle handling | | Vector vintages (parcels, buildings) | Geometry+attribute diff with tolerance (below) | ## Thresholding — never eyeball it Difference images need a defensible threshold: μ ± k·σ on the difference histogram (report k), Otsu when bimodal, or supervised thresholds calibrated on labeled change/no-change samples. Deliver the histogram with the chosen cut marked. Sensitivity: report changed-area at k-0.5 and k+0.5; if the story flips, the detection is fragile — say so. ## Post-classification comparison (PCC) — handle with care PCC error compounds: two 90%-accurate maps yield ≤ ~81% change accuracy, and biased errors create systematic false transitions. Rules: - Use ONE classifier trained on both dates' im
Preview of the first 4,000 characters. Read full instructions →
Referenced files: 2 — file references are metadata, not package contents.
--- name: geoai-orchestrator description: >- Route genuinely ambiguous or multi-stage geospatial work across specialist skills while enforcing shared CRS, validity, leakage, units, verification, and reproducibility rules. Use for requests spanning multiple stages such as acquisition, imagery, modeling, analysis, and map delivery, or for an explicit end-to-end pipeline. Never invoke for one domain merely because a parameter is unclear. Code implementation/review, backend or platform choice, and production-readiness review are direct specialist tasks. Do not add this skill as a layer around one specialist. license: MIT metadata: author: Muhammed Enes Duran --- # GeoAI Orchestrator The hub of an 18-skill geospatial module. Activate it for routing or pipeline composition, not as a mandatory wrapper around every spatial task. Its job: (1) diagnose what kind of spatial problem the user actually has, (2) design the pipeline across stages, (3) route each stage to the right specialist skill, and (4) enforce the module-wide invariants that every stage must obey. ## Routing gate — read before producing any output This orchestrator routes by **invoking**, never by naming. The gate below overrides every other section of this document, including the pipeline template. 1. **Invoke, do not list.** Every specialist you select must be invoked with the `Skill` tool in the same response that selects it. Naming a skill in a table, plan, or prose sentence is not a handoff. A response that identifies the right specialist but does not invoke it has failed this skill's core function, no matter how accurate the diagnosis is. 2. **Route every correction, not the first one.** When a request contains multiple findings, defects, or stages, each one gets its own routing decision and its own invocation. Routing one item and handling the rest inline is a partial failure; the count of routed items must equal the count of items found. 3. **Never make routing conditional on permission.** Do not write "say the word and I'll route", "I can hand this off if you want", "let me know and I'll bring in the specialist", or any equivalent. Offering to route later is the single most common failure of this skill. If you have identified the specialist, invoke it now. 4. **Clarification is not a substitute for routing.** Missing detail about *scope* (which deliverable, which study area) does not block routing of the stages you have already identified. Ask the scope question and route in the same response. Only a request whose entire domain is undetermined may be routed-free, and then you must say which specialist becomes available under each candidate answer. 5. **Audit requests are `deliver` requests.** "Audit this plan", "review this pipeline", "what is wrong with this workflow" require the completed audit, the routed corrections, and the revised plan in one response. Do not return findings and hold the corrections back for a follow-up turn. If you cannot satisfy the gate, do not activate this skill — route the request directly to the single narrowest specialist instead. ## Module map — route by problem type | Stage / problem | Specialist skill | |---|---| | Data acquisition, formats, CRS, tiling, pipelines | `geo-data-engineering` | | Satellite/aerial imagery, spectral indices, classification | `remote-sensing-analysis` | | Planetary-scale archives, GEE Python API, cloud compositing | `google-earth-engine` | | CNN/U-Net/ViT on EO data, segmentation, detection | `geo-deep-learning` | | Autocorrelation, hotspots, clusters, spatial regression | `spatial-statistics` | | Site selection, suitability, AHP/weighted overlay | `mcda-suitability-analysis` | | Interpolation from point samples, kriging, variograms | `geostatistics-interpolation` | | DEM, slope, watersheds, flow, viewshed | `terrain-hydrology` | | LiDAR / point clouds, DTM/DSM/CHM, PDAL | `point-cloud-lidar` | | Routing, service areas
Preview of the first 4,000 characters. Read full instructions →
Referenced files: 2 — file references are metadata, not package contents.
--- name: geo-data-engineering description: >- Always invoke when geospatial data must be acquired, prepared, repaired, scaled, or moved through a repeatable pipeline. Covers open-data/OSM/STAC acquisition, spatial formats, CRS transforms, quality checks, and batch ETL architecture for growing or recurring joins. Invoke alongside PostGIS for database execution and alongside SWE standards when code is delivered. Do not trigger merely because another specialist reads analysis-ready data. license: MIT metadata: author: Muhammed Enes Duran --- # Geospatial Data Engineering Purpose: get spatial data into a clean, validated, analysis-ready state with a repeatable pipeline — the stage where most real-world GIS time is spent and most silent errors are born. ## Format selection | Format | Use for | Avoid because | |---|---|---| | **GeoParquet** | Analysis interchange, big vector, columnar workflows | Not yet readable by some legacy desktop GIS | | **GeoPackage** | Desktop GIS exchange, multi-layer projects | Slower than Parquet at scale; SQLite locking | | **FlatGeobuf** | Streaming, HTTP range reads | Single layer | | **COG** (Cloud-Optimized GeoTIFF) | All raster deliverables | — (make every GeoTIFF a COG) | | **Zarr/NetCDF** | Multi-dimensional (time × band × y × x) | Overkill for single rasters | | Shapefile | Only when a legacy tool demands it | 10-char columns, 2 GB cap, encoding chaos, multi-file fragility | | CSV + WKT/lon-lat | Simple point exchange | No CRS metadata — document it explicitly | ## Acquisition playbook - **OpenStreetMap**: small areas → `osmnx`; large extracts → Geofabrik PBF + `pyrosm`/`osmium`. Respect tag heterogeneity: always inspect tag value distributions before filtering. - **Buildings/places at scale**: Overture Maps (GeoParquet on S3/Azure, query with DuckDB spatial — often the fastest path). - **Satellite/raster**: STAC APIs via `pystac-client` + `odc-stac` — see `remote-sensing-analysis`; planetary archives → `google-earth-engine`. - **Boundaries**: authoritative national source first; Natural Earth / GADM / geoBoundaries for global work — record which, versions differ materially. - Record every acquisition: source URL, query parameters, retrieval date, license. Put it in a `DATA_SOURCES.md` next to the data. ## CRS engineering - Store in EPSG:4326 or source CRS; **analyze** in a projected CRS suited to the extent: local UTM zone (`gdf.estimate_utm_crs()`), national grid, or equal-area (EPSG:6933/Mollweide) for cross-region area stats. - Datum shifts matter at sub-meter precision: transformations between datums need the right transformation grid (`pyproj.network.set_network_enabled(True)` when accuracy matters). - Never strip or overwrite a CRS to "fix" misaligned layers — diagnose which layer is wrong with a known landmark instead. ## Cleaning pipeline Run `scripts/clean_vector.py` (or import its `clean_vector()` function) as the standard hygiene pass: drops empty/null geometries, repairs invalid ones with `make_valid`, de-duplicates, reprojects, and **prints an accounting report** so silent data loss is impossible. Then: normalize text attributes (trim, collapse whitespace, locale-aware casefold — beware Turkish İ/ı, German ß), coerce dtypes explicitly, and show `value_counts()` of every categorical you will later filter on. ## Scale strategies - **Fits in RAM**: GeoPandas + Shapely 2 vectorized ops. Ensure the spatial index is used (`sjoin`, `query_bulk`) — hand-rolled loops are O(n²). - **Bigger than RAM, single machine**: DuckDB `spatial` extension over GeoParquet (predicate pushdown + spatial SQL), or `dask-geopandas`. - **Served / concurrent / transactional**: PostGIS — see `postgis-spatial-sql`. - Rasters: windowed reads (`rasterio.windows`), chunked xarray + dask; never `read()` a 50 GB mosaic into memory. ## Pipeline standards - Idempotent steps with explicit inputs/outputs on disk; re-running never corrupts state. - Checkpoint after
Preview of the first 4,000 characters. Read full instructions →
Referenced files: 3 — file references are metadata, not package contents.
---
name: geo-deep-learning
description: >-
Invoke before recommending, training, or auditing a neural method for
geospatial imagery, including vision transformers, U-Net/DeepLab/SegFormer,
object detection, pixel classification, building/road extraction, and EO
foundation-model fine-tuning. Also invoke for neural chip-split validity,
IoU/accuracy claims, augmentation, imbalanced losses, spatial validation,
or sliding-window inference. Use remote-sensing-analysis for non-neural
methods and change-detection when temporal change is the deliverable.
license: MIT
metadata:
author: Muhammed Enes Duran
---
# Geospatial Deep Learning
Purpose: deep learning on Earth observation with the two failure modes that
dominate this field designed out from the start: **spatial leakage**
(inflated metrics from nearby train/test pixels) and **georeferencing loss**
(predictions that no longer align with the map).
## Characterise the label set before naming an architecture
Architecture advice given without knowing the label set is guesswork. Before
recommending U-Net versus a foundation model versus a non-deep baseline, state
or ask for:
- **Label count and labelled area** — polygons alone say nothing; 40 polygons
covering 2 ha and 40 covering 2 000 km² are different problems.
- **Geographic spread** — are the labels clustered in one scene, one season and
one sensor, or distributed across the deployment domain? Clustered labels cap
what any model can generalise to, and they decide whether a geographically
independent validation split is even constructible.
- **Class balance and minority-class pixel fraction**, so loss and sampling
choices are grounded rather than assumed.
- **Deployment geography** — where predictions will be made, relative to where
the labels are.
Do not answer "fine-tune a large model or use a simpler approach" before these
are known. When the user has not supplied them, ask and give the provisional
recommendation *conditioned on* the answers ("if the 40 polygons sit in one
scene, then …; if they span the region, then …"), never a single unconditional
recommendation.
## Problem framing first
| Task | Head/architecture default | Metric |
|---|---|---|
| Pixel-wise classes (land cover) | U-Net / DeepLabv3+ (pretrained encoder) | mIoU, per-class IoU |
| Binary extraction (buildings, water, roads) | U-Net + Dice/CE hybrid | IoU, F1; boundary F1 for roads |
| Object detection (vehicles, ships, trees) | YOLO-family / Faster R-CNN, rotated boxes if oriented | mAP@50 |
| Scene classification | Fine-tuned CNN/ViT | F1 (macro) |
| Regression (height, biomass, density) | U-Net with regression head | RMSE/MAE + spatial residual map |
Before any deep model: run a cheap baseline (random forest on bands+indices,
or thresholded index). If the DL model can't beat it clearly, the problem is
data, not architecture. `segmentation-models-pytorch` and `torchgeo` cover
most needs — don't hand-build architectures without a reason.
## Chipping (dataset construction)
- Chip size: 256–512 px; stride < chip size only for training (overlap
augments), never let overlapping chips straddle the train/val boundary.
- **Preserve georeferencing**: store each chip's transform/bounds (torchgeo
datasets or a sidecar index in GeoParquet). A prediction you can't put
back on the map is worthless.
- Keep chips in the native data range; normalize with **dataset-computed**
per-band statistics (ImageNet stats only for 3-band RGB with a pretrained
encoder, and say so).
- Class imbalance is the norm (buildings ≈ 2-5% of pixels). Log per-chip
class fractions; oversample positive-containing chips rather than
distorting the loss beyond recognition.
## Split policy — the non-negotiable
Split by **geographic block or scene**, never by random chip. Adjacent
chips are near-duplicates; random splits produce beautiful, fake validation
curves. Follow the canonical protocol:
`ml-experiment-standards` → `references/spatial-cv-protocolPreview of the first 4,000 characters. Read full instructions →
Referenced files: 2 — file references are metadata, not package contents.
---
name: geostatistics-interpolation
description: >-
Turn scattered point measurements into continuous surfaces with quantified
uncertainty: variogram modeling, ordinary/universal/regression kriging,
IDW, and spatially honest cross-validation. Use when unobserved values must
be estimated from sparse samples such as stations, wells, or soundings.
Trigger on "interpolate", "kriging", "variogram", or "IDW"; a named
interpolation method is sufficient even when the requested surface is
described informally as a heatmap. Do not use for point-density heatmaps,
zonal aggregation, or raster resampling without value interpolation.
license: MIT
metadata:
author: Muhammed Enes Duran
---
# Geostatistics & Interpolation
Purpose: interpolation that reports what it doesn't know. The difference
between a professional product and a pretty raster is the uncertainty
surface and an honest cross-validation — both are non-optional here.
## Method selection
| Situation | Method |
|---|---|
| Dense, smooth phenomenon, quick look | IDW (report power parameter; test 1-3) |
| Physical phenomenon with spatial structure, need uncertainty | **Ordinary kriging** (default professional choice) |
| Clear trend (elevation gradient, coastal effect) | Universal kriging or regression kriging on covariates |
| Strong covariates available (DEM, land cover, distances) | Regression kriging / random-forest residual kriging |
| Categorical target | Indicator kriging |
| Honeycomb-free tessellation, no extrapolation wanted | Natural neighbor |
IDW is a reasonable baseline but has no error model and bullseyes around
extremes; say so when delivering IDW-only products.
## Exploratory phase (before any interpolation)
- Map the points with values; look for duplicates at identical coordinates
(average or offset them — kriging matrices go singular otherwise).
- Histogram + skew: strongly skewed variables (rainfall, concentrations)
usually want a log/normal-score transform; back-transform predictions
properly (bias correction for lognormal kriging).
- Trend check: regress value on x, y, and candidate covariates; visible
trend → universal/regression kriging path.
- Declustering if sampling is preferential (dense where values are high).
## Variogram discipline
The variogram is a MODELING decision, not an auto-fit output:
```python
import gstools as gs
bin_center, gamma = gs.vario_estimate((x, y), values, max_dist=dmax) # dmax ≈ half extent
model = gs.Exponential(dim=2)
model.fit_variogram(bin_center, gamma, nugget=True)
print(model) # report: nugget, sill, range — plus the fitted plot
```
- Max lag ≈ half the domain diameter; ≥30 pairs per bin.
- Check anisotropy with directional variograms (0/45/90/135°); geological
and meteorological fields are often anisotropic — fit an anisotropic
model rather than ignoring it.
- Interpret and report the parameters in words: nugget (measurement error +
micro-scale variance), range (correlation distance), sill. A nugget near
the sill means the data barely support interpolation — say that honestly.
- Never interpolate meaningfully beyond the variogram range from the
nearest sample; mask or flag those cells.
## Kriging execution
```python
from pykrige.ok import OrdinaryKriging
ok = OrdinaryKriging(x, y, values, variogram_model="exponential",
variogram_parameters={"sill": s, "range": r, "nugget": n},
coordinates_type="euclidean")
z, ss = ok.execute("grid", gridx, gridy) # ss = kriging VARIANCE — keep it!
```
- Work in a projected CRS (kriging distances in degrees are wrong except
with explicitly geographic-aware models).
- Deliver TWO rasters: prediction AND kriging standard deviation
(`np.sqrt(ss)`). The uncertainty map drives where to sample next and
where not to trust the map.
- Search neighborhood: 16-32 nearest points typical; document it.
## Validation — leave-one-out and beyond
- **LOOCV** for small n: report ME (bias ≈ 0?), RMSE, and Preview of the first 4,000 characters. Read full instructions →
Referenced files: 2 — file references are metadata, not package contents.
---
name: google-earth-engine
description: >-
Invoke when Earth Engine, GEE, ee., or geemap is named; when work needs its
server-side catalog; or when choosing Earth Engine versus local xarray or
desktop processing for a large area or long archive. Covers image
collections, masking, compositing, reducers, zonal statistics, time series,
classification, quota-aware batching, and exports. This is an execution
platform skill; combine it with remote-sensing-analysis or change-detection
when those skills own the scientific method.
license: MIT
metadata:
author: Muhammed Enes Duran
---
# Google Earth Engine
Purpose: use GEE's server-side model correctly. The recurring failure
modes are **client/server confusion** (calling `.getInfo()` in loops,
Python `if` on server objects), **unbounded computation** (timeouts from
unscaled reductions), and **silent default scales** (statistics computed
at the wrong resolution).
## Should this run here at all? — Earth Engine versus local
Answer this before writing any `ee.` code. The decision turns on six things, and
you cannot make it without them, so establish them first — asking alongside a
provisional recommendation, never instead of one:
1. **Archive extent and duration** — area, and how many years at what revisit.
This is what makes server-side worth its constraints; a single scene does not.
2. **Algorithm expressibility** — can the work be written as masks, reducers and
band math? Anything needing arbitrary per-pixel iteration, a custom solver, or
a Python library GEE does not host belongs local.
3. **Data locality and sensitivity** — restricted or offline data cannot be
uploaded, and that ends the discussion regardless of scale.
4. **Interactive limits versus batch** — see [Quotas and etiquette](#quotas-and-etiquette).
Anything beyond a ~5 minute interactive request has to be designed as a batch
export from the start, not retrofitted when `getInfo` times out.
5. **Export volume** — what actually comes back: a few reduced statistics, or
full-resolution per-pixel stacks you will store and reprocess locally.
6. **Reproducibility cost** — the real price of moving server-side. The catalog
version can shift under you and the computation leaves no local trace, so
choosing GEE obliges you to ship the [provenance record](#provenance-record).
State this cost when you recommend GEE; a recommendation that omits it is
incomplete.
Recommend Earth Engine only when 1 and 2 favour it and 3 permits it. When the
answer is genuinely balanced, say so and name the deciding question rather than
defaulting to the platform this skill is about. `xee` and STAC + `stackstac` /
`odc-stac` are the middle paths worth naming: catalog access with local compute.
## Mental model — everything is deferred
`ee.Image`, `ee.ImageCollection`, `ee.FeatureCollection` are **server-side
descriptions**, not data. Nothing computes until an output is requested
(`getInfo`, export, map tile). Consequences:
- Never use Python `if`/`for` on server values — use `ee.Algorithms.If`
sparingly, prefer `.map()` + filters. A Python loop that calls
`.getInfo()` per element is the #1 GEE performance bug.
- `.getInfo()` blocks and transfers; use it for tiny scalars only.
Anything sized → **Export** (to Drive/GCS/Asset).
- Debug with `.aggregate_array()`, `.first()`, `.limit(3)` probes — not by
printing whole collections.
## Canonical pipeline (Sentinel-2 cloud-free composite)
```python
import ee
ee.Initialize(project="my-project")
aoi = ee.Geometry.Rectangle([27.0, 38.3, 27.4, 38.6])
def mask_s2(img):
# Cloud Score+ is the current best practice (threshold ~0.5-0.65)
cs = img.linkCollection(csplus, ["cs_cdf"]).select("cs_cdf")
return img.updateMask(cs.gte(0.6))
csplus = ee.ImageCollection("GOOGLE/CLOUD_SCORE_PLUS/V1/S2_HARMONIZED")
s2 = (ee.ImageCollection("COPERNICUS/S2_SR_HARMONIZED")
.filterBounds(aoi)
.filterDate("2025-05-01", "2025-09-30")
.map(maskPreview of the first 4,000 characters. Read full instructions →
Referenced files: 2 — file references are metadata, not package contents.
---
name: mcda-suitability-analysis
description: >-
Always invoke for spatial suitability, site selection, AHP, criteria
weights, or weighted-overlay work, including audits of inconsistent
pairwise judgments and requests for only a final map. Covers consistency,
standardization, constraints, ranked surfaces, shortlists, and sensitivity.
Route travel-time placement and location-allocation to
network-accessibility-analysis.
license: MIT
metadata:
author: Muhammed Enes Duran
---
# MCDA & Suitability Analysis
Purpose: produce suitability maps whose weights, scales, and assumptions are
explicit, consistent, and stress-tested. A suitability map without a
sensitivity analysis is an opinion with a legend.
## Workflow
1. **Structure**: goal → criteria (factors) → constraints. Constraints are
binary masks (legal exclusions, water bodies, slope > threshold) applied
at the END by multiplication; factors are continuous and weighted.
Keep them apart — encoding a constraint as a heavily-weighted factor is
a classic error that lets forbidden areas score "acceptable".
2. **Criteria layers**: each factor as a raster on a COMMON grid (same CRS,
extent, cell size, snap). Resample categorical layers with nearest,
continuous with bilinear; document each.
3. **Standardization** to a common suitability scale (0-1 or 0-255):
- Linear min-max for monotonic "more is better/worse".
- Fuzzy membership (sigmoid/linear with control points) when suitability
saturates — justify control points from domain knowledge.
- Categorical layers: explicit reclass table, shown to the user.
Direction check: confirm for EVERY layer whether high raw value means
high or low suitability (slope: low=good; distance-to-road: usually
low=good). Direction bugs survive to the final map invisibly.
4. **Weights** (AHP below, or direct/ranked methods with rationale).
5. **Aggregation**: weighted linear combination (WLC) default; OWA when
the decision-maker's risk attitude (AND-like vs OR-like) matters.
6. **Constraint mask** multiply; classify the result (equal interval or
quantiles — say which and why); **sensitivity analysis**; validate
against known good/bad sites if any exist.
## AHP with consistency enforcement
Pairwise comparisons on Saaty's 1-9 scale; weights from the principal
eigenvector; consistency ratio (CR) must be < 0.10 or the matrix goes back
for revision. Run `scripts/ahp_weights.py` to compute weights + CR from a
reciprocal comparison matrix (it validates reciprocity and reports λ_max).
Practices: elicit comparisons pair by pair with verbal anchors ("moderately
more important" = 3); with multiple experts, aggregate judgments by
geometric mean BEFORE computing weights; report the full matrix, weights,
λ_max and CR in the deliverable. If CR ≥ 0.10, identify the most
inconsistent triad and ask the expert to revisit it — do not silently
massage numbers.
## Aggregation
```python
suit = np.zeros_like(factors[0], dtype="float32")
for w_i, f in zip(weights, factors): # factors already standardized 0-1
suit += w_i * f
suit *= constraint_mask # binary 0/1, applied last
```
OWA variant: sort factor values per cell and apply order weights — full
AND (min) to full OR (max) continuum; use when stakeholders disagree on
risk tolerance and show 2-3 scenarios.
## Sensitivity analysis — mandatory
A result that flips with a small weight change is not a result:
- **One-at-a-time**: perturb each weight ±20% (renormalize), recompute,
report % of area changing suitability class and a stability map (cells
that never change class across perturbations).
- **Scenario**: 2-3 alternative weight sets from different stakeholder
priorities; present side-by-side.
- If a Monte Carlo budget exists: sample weights from Dirichlet around the
AHP vector; per-cell probability of "highly suitable" is a far stronger
product than a single map.
## Deliverable standard
Suitability map (classified + conPreview of the first 4,000 characters. Read full instructions →
Referenced files: 3 — file references are metadata, not package contents.
---
name: ml-experiment-standards
description: >-
Always invoke for training, validating, tuning, benchmarking, or claiming
readiness of a predictive model. Covers leakage audits, spatial and grouped
splits, metrics, reproducibility, and honest reporting. Invoke especially
when spatial dependence, split design, or deployment geography is unknown;
uncertainty is a reason to use this skill. Do not trigger for descriptive
EDA or non-predictive statistical inference.
license: MIT
metadata:
author: Muhammed Enes Duran
---
# ML Experiment Standards
Purpose: every ML job (quick prototypes included) is reproducible,
leakage-free, and metric-justified. These are not optional polish; every
skipped item typically returns as "the model collapsed in production" or
"the result didn't replicate".
## 1. EDA comes first
Before any model, produce and show: distributions, missingness rates,
outliers, target balance, salient correlations. Metric and loss choice
depend on this information; a model recommendation without EDA is a guess.
## 2. Leakage audit
At every split decision, answer explicitly (and write the answer as a code
comment): "Does the training set contain indirect information about any
test sample?"
| Data type | Correct split | Why |
|---|---|---|
| Independent samples | Stratified k-fold | Preserves class ratios |
| Time series | TimeSeriesSplit / walk-forward | Future must not leak into past |
| **Spatial data** | Spatial block CV — see `references/spatial-cv-protocol.md` | Neighbors are near-duplicates |
| Grouped data (patient, parcel, scene) | GroupKFold | A group must not straddle the split |
- Scalers/encoders/imputers are **fit on train only**; the clean path is
`sklearn.pipeline.Pipeline` — CV then fits correctly by construction.
- Target-derived features (target encoding etc.) must be computed
out-of-fold, and shown to be.
The spatial protocol in `references/spatial-cv-protocol.md` is the single
canonical source for this repo — other skills link here; do not restate it.
## 3. Metric selection — justified
Never choose a metric by default; write a one-sentence rationale:
- Imbalanced classes → **F1 / AUC-PR**, not accuracy (accuracy rewards
majority-class memorization).
- Segmentation → **IoU/Dice** (pixel accuracy is inflated by background).
- Regression → RMSE (sensitive to large errors) vs MAE (robust) vs R²
(variance explained) — justify from the use case.
- Every point estimate gets uncertainty: bootstrap CI or mean ± std across
CV folds. A single number hides whether a difference is signal or noise.
## 4. Reproducibility skeleton
Every training script follows this shape (script-first; no notebook magic):
```python
"""Experiment: <name>. Goal and success criterion: <one sentence>."""
from dataclasses import dataclass, asdict
import json, random
import numpy as np
@dataclass
class Config:
seed: int = 42
lr: float = 1e-3
batch_size: int = 32
epochs: int = 100
patience: int = 10 # early stopping
def set_seed(seed: int) -> None:
random.seed(seed)
np.random.seed(seed)
# if torch: torch.manual_seed(seed); torch.cuda.manual_seed_all(seed)
def main(cfg: Config) -> None:
set_seed(cfg.seed)
... # data -> split -> pipeline -> train -> evaluate
with open("runs/run_meta.json", "w", encoding="utf-8") as f:
json.dump({"config": asdict(cfg), "metrics": metrics}, f, indent=2)
if __name__ == "__main__":
main(Config())
```
- Config lives in a dataclass/YAML, never hardcoded — sweeps and run
comparison depend on it.
- Pin library versions (`pip freeze > requirements.txt`).
- Use MLflow/W&B when available; the JSON log above is the minimum.
## 5. Deep learning extras
- **Loss rationale**: Dice/Dice+CE for imbalanced segmentation; write why.
Focal only after comparison — not a free win.
- **Augmentation rationale**: state which transforms respect the physics
of the problem (orientation-dependent tasks forbid some rotations;
multispPreview of the first 4,000 characters. Read full instructions →
Referenced files: 3 — file references are metadata, not package contents.
---
name: movement-trajectory
description: >-
Movement and trajectory analytics from GPS/GNSS tracks: cleaning, stop/trip
detection, road-network map matching, speed/direction, flow aggregation,
and origin-destination construction. Use for fleets, human mobility, animal
tracking, AIS, or sports tracks. Trigger on GPS points, GPX, trajectories,
stop detection, map matching, or timestamped positions per moving object.
Also invoke for privacy, aggregation, de-identification, or release of
individual trajectories. Use network-accessibility-analysis for
hypothetical routes, isochrones, or static OD costs without observed tracks.
license: MIT
metadata:
author: Muhammed Enes Duran
---
# Movement & Trajectory Analytics
Purpose: turn noisy timestamped points into defensible movement facts. The
recurring failure modes: **speed computed through GPS noise** (teleporting
points → 400 km/h pedestrians), **stops invented by signal drift**, and
**privacy-blind delivery** of individual-level traces.
## Data model first
A trajectory = ordered fixes per object: `(object_id, timestamp, x, y,
[accuracy, ...])`. Before analysis, report per object: fix count, time
span, median sampling interval, and interval distribution — **sampling
rate drives every method choice** (1 s vehicle traces and 1 fix/hour
animal tags are different problems wearing the same schema).
```python
import movingpandas as mpd
import geopandas as gpd
gdf = gpd.GeoDataFrame(df, geometry=gpd.points_from_xy(df.lon, df.lat),
crs=4326).to_crs(gdf_utm_epsg)
tc = mpd.TrajectoryCollection(gdf, "object_id", t="timestamp")
```
### Declare CRS and time base before any threshold
Every distance radius, speed limit and dwell duration in this skill is
meaningless until two things are stated **in the answer, before the number is
used**:
1. **The projected CRS** all distance and speed computation runs in — a "50 m
stop radius" applied to raw lon/lat degrees is not 50 m anywhere, and the
error scales with latitude. Name the CRS (`estimate_utm_crs()` for a local
fleet, an equal-distance projection for continental extents).
2. **The timestamp base**, normalised to timezone-aware UTC. Fleet logs mix
local times, DST shifts and naive strings; a dwell that straddles a DST
boundary gains or loses an hour, and stop durations silently corrupt.
State both before proposing a radius or duration, not afterwards as a caveat.
**Declaring is not withholding.** An unknown CRS or timezone is never grounds to
stop and ask instead of answering. State it as an explicit, named assumption and
deliver the method anyway:
> Assuming a local UTM zone for distance and that timestamps are naive local time
> needing UTC normalisation — confirm both, since they change dwell durations.
Then give the cleaning steps, the parameters, and the sensitivity check. A
response that asks for the CRS, the timezone, or the file *in place of* the
method has failed this skill even if the question is a good one. Ask alongside
the answer, never instead of it. Never silently treat naive timestamps as UTC —
but "silently" is the operative word: an assumption you have labelled and
surfaced is exactly what is wanted.
## Cleaning pipeline (in order)
1. **Deduplicate** identical (object, timestamp) fixes.
2. **Accuracy filter**: drop fixes above an HDOP/accuracy threshold if
the column exists (report the threshold and % dropped).
3. **Speed filter**: drop fixes implying impossible speed for the mode
(walk > 15 km/h sustained, car > 200 km/h...); iterate — one bad fix
creates two bad segments (`mpd.OutlierCleaner`).
4. **Gap splitting**: split trajectories at temporal gaps (e.g., > 5×
median interval) — interpolating across a tunnel/power-off invents
movement.
5. Optional smoothing (Kalman/rolling median) for jittery urban-canyon
data — AFTER outlier removal, and never before stop detection tuning.
Accounting line per step: fixes in → out.
## Stops and trips
Preview of the first 4,000 characters. Read full instructions →
Referenced files: 2 — file references are metadata, not package contents.
---
name: network-accessibility-analysis
description: >-
Always invoke for access to facilities or opportunities by walking,
driving, cycling, or public transport, even for a conceptual question with
no routing terms or data yet. Covers hospital and service access,
transit/GTFS, routes, isochrones, OD matrices, closest facility, 2SFCA,
walkability, coverage, and equity. Invoke when Euclidean buffers proxy for
network access. Use movement-trajectory for observed tracks and MCDA for
suitability without network costs.
license: MIT
metadata:
author: Muhammed Enes Duran
---
# Network & Accessibility Analysis
Purpose: replace as-the-crow-flies guesswork with network-true travel
costs, at the right scale and with honest assumptions about speeds and
modes. First decision on every task: Euclidean distance is only acceptable
as a declared approximation — flag it whenever you see it standing in for
access.
## Tool selection by scale
| Scale | Tool |
|---|---|
| Neighborhood-city, research flexibility | **OSMnx + NetworkX** |
| City-region, many-to-many OD (>10⁴×10⁴) | **r5py** (multimodal + transit w/ GTFS) or **pandana** (contraction-hierarchy speed) |
| Production routing service | Valhalla / OSRM / OpenRouteService API |
| Proprietary stacks | ArcGIS Network Analyst (script it headlessly) |
NetworkX chokes on metro-scale many-to-many — don't loop `shortest_path`
over thousands of origins; switch tools instead.
## Graph construction (OSMnx)
```python
import osmnx as ox
G = ox.graph_from_place("City, Country", network_type="drive") # walk/bike/all
G = ox.add_edge_speeds(G) # imputes from highway tags where maxspeed missing
G = ox.add_edge_travel_times(G) # edge attr: travel_time (s)
G = ox.project_graph(G) # metric CRS before any distance work
```
- **network_type matters**: pedestrian analysis on a `drive` graph misses
paths, stairs, plazas; driving on `all` uses footpaths. Match mode.
- Imputed speeds are averages by road class — a systematic bias, not
noise. State it; calibrate against known trips when stakes are high.
- Keep the strongly connected component for routing
(`ox.truncate.largest_component(G, strongly=True)`); orphan islands
cause spurious infinities.
- **Snapping**: origins/destinations map to nearest nodes/edges
(`ox.distance.nearest_nodes`). Report the snap-distance distribution;
a facility snapped 2 km away (riverside, gated area) silently corrupts
results.
## Core products
- **Isochrones / service areas**: ego-graph by travel_time cutoff → alpha
shape or buffered edge union around reached edges. Node-based convex
hulls overstate coverage across rivers/highways — prefer edge-based
polygons. Always label the assumptions: mode, speed model, cutoff.
- **OD matrix**: many-to-many travel costs; the substrate for
accessibility and location-allocation. For big matrices use
pandana/r5py; store as Parquet with origin/destination IDs.
- **Closest facility**: k-nearest by network cost (not Euclidean); report
both the assigned facility and the cost.
- **Centrality**: betweenness on travel_time (sampled `k` for big
graphs — exact is O(nm)); edge betweenness ≈ through-traffic potential.
Interpret as network structure, not observed traffic.
## Accessibility metrics — pick deliberately
| Metric | Question it answers | Weakness |
|---|---|---|
| Cumulative opportunities (# jobs/POIs within T min) | Simple, communicable | Cliff at T; all-or-nothing |
| Gravity-based (distance-decayed sum) | Smooth access | Decay parameter must be justified |
| **2SFCA / E2SFCA** | Supply-demand ratio access (health care standard) | Catchment size choice drives results |
| Closest-facility time | Worst-case need | Ignores capacity/congestion |
For equity analyses, join metrics to population/demographic polygons
(area-weighted or dasymetric — see `geo-data-engineering`) and report
distributions per group, not just city means. Route statistical testing of
disparities to `sPreview of the first 4,000 characters. Read full instructions →
Referenced files: 2 — file references are metadata, not package contents.
---
name: point-cloud-lidar
description: >-
LiDAR and point cloud processing: PDAL pipelines, LAS/LAZ/COPC handling,
ground classification, DTM/DSM/CHM generation, canopy and building
metrics, and photogrammetric (SfM) point clouds. Use when the primary input
is LAS, LAZ, COPC, LiDAR, or an unstructured 3D point cloud. This skill owns
vertical datum agreement, co-registration and the vertical-accuracy budget
when two acquisitions are differenced with comparability not yet established;
once datum, geoid and accuracy are documented, a subsidence or
elevation-change question is change-detection's. Route a derived DEM, DTM,
DSM or CHM to terrain-hydrology unless point-level classification,
comparability, or metrics remain in scope.
license: MIT
metadata:
author: Muhammed Enes Duran
---
# Point Clouds & LiDAR
Purpose: from raw returns to defensible elevation and structure products.
The recurring failure modes: **trusting vendor classification blindly**,
**mixing return types in surfaces** (DSM from last returns, DTM with
vegetation), and **ignoring point density** when choosing output
resolution.
## First contact with any cloud
```bash
pdal info input.laz --summary # counts, bounds, CRS, classes, returns
```
Report before touching anything: point count, density (pts/m² — decides
achievable raster resolution), CRS (horizontal AND vertical datum —
ellipsoidal vs orthometric heights differ by the geoid undulation, tens of
meters in places), classification present?, return numbers present?,
flight-line overlap artifacts. A cloud without CRS metadata: resolve from
the provider, never assume.
## Format and scale
| Format | Use |
|---|---|
| **LAZ** | Compressed interchange/archive — default |
| **COPC** (cloud-optimized LAZ) | Streaming/HTTP range access, web viewers |
| LAS | Only when a tool can't read LAZ |
| Entwine/EPT | Massive multi-tile collections, indexed |
Tile large collections; process per-tile with buffered edges (~2× search
radius) to avoid seam artifacts in filters and surfaces; drop the buffer
on write.
## PDAL pipeline pattern
```json
{
"pipeline": [
"input.laz",
{"type": "filters.reprojection", "out_srs": "EPSG:32636"},
{"type": "filters.outlier", "method": "statistical",
"mean_k": 8, "multiplier": 2.5},
{"type": "filters.smrf", "slope": 0.15, "window": 18.0,
"threshold": 0.5, "scalar": 1.2},
{"type": "writers.las", "filename": "classified.laz",
"extra_dims": "all"}
]
}
```
Run: `pdal pipeline pipeline.json`. Denoise BEFORE ground classification
(low outliers below ground destroy SMRF/CSF); tune `slope` up for steep
terrain, `window` to the largest non-ground object (big buildings need
bigger windows).
## Ground classification & DTM
- If vendor class 2 (ground) exists: **audit it** on 2-3 cross-sections
(bridges, dense canopy, steep slopes) before trusting; reclassify where
it fails.
- Algorithms: SMRF (PDAL default, robust), CSF (cloth simulation, good in
steep forest). Parameters are terrain-dependent — show a cross-section
plot as evidence, not just the parameter list.
- DTM from ground-only points; interpolation: TIN → raster (standard for
DTM) or IDW for dense clouds. Output resolution ≥ ~1/√density; a 0.5 m
DTM from 1 pt/m² data is invented detail.
- DSM from **first returns / highest-point** binning. CHM = DSM − DTM,
clamp negatives to 0, and use a pit-free algorithm for forestry (naive
CHMs are pocked by within-crown pits).
## Structure metrics
- **Forestry**: height percentiles (p95 ≈ canopy height), canopy cover
(first returns > 2 m / all first returns), density metrics per grid cell
or plot; normalize heights against the DTM first (`filters.hag_dem` or
`filters.hag_nn`). Individual tree detection: local maxima on pit-free
CHM + watershed segmentation — validate count against field plots or
manual photo-interpretation samples.
- **Buildings**: class 6 or planar-patch extraction; building height =
p90Preview of the first 4,000 characters. Read full instructions →
Referenced files: 2 — file references are metadata, not package contents.
--- name: postgis-spatial-sql description: >- Invoke whenever spatial SQL or its execution backend is the decision: PostGIS, DuckDB Spatial, SpatiaLite, ST_* functions, recurring spatial joins, concurrent/growing workloads, or large GeoParquet queries. Covers backend selection, schemas, GiST/BRIN indexes, KNN, geometry versus geography, correctness benchmarks, and EXPLAIN optimization. Use PostGIS for managed concurrent services and embedded engines for bounded local analytics when evidence supports that choice. Use geo-data-engineering for acquisition, conversion, and file-based ETL without spatial SQL. license: MIT metadata: author: Muhammed Enes Duran --- # PostGIS & Spatial SQL Purpose: correct-and-fast spatial SQL. The two recurring failure modes are semantic (geometry vs geography, SRID mismatches → wrong answers) and performance (missing index usage → hour-long joins); this skill guards both. ## When the database is the right tool Move from files/GeoPandas to PostGIS when any of: features > a few million, concurrent readers/writers, repeated ad-hoc querying, a serving API on top, or transactional integrity needs. For single-shot analytical scans over GeoParquet, **DuckDB Spatial** is often the fastest zero-install path — same SQL mindset, no server. When requirements are incomplete, do not turn this heuristic into a final recommendation. First obtain current and forecast data volume, concurrency, delivery and mutation pattern, latency/SLA, serving needs, and operational ownership (including backup and recovery). Define representative ingestion, join, and read queries for both viable backends; compare runtime and resource use only after row counts, join cardinality, SRID, geometry validity, and sample outputs agree. Include this benchmark and correctness plan in the current response; do not merely offer to draft it later. ## Schema fundamentals This runnable example assumes the data is contained in UTM zone 33N. Replace EPSG:32633 with a projected CRS verified for the actual area of interest. ```sql CREATE TABLE parcels ( id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY, parcel_no text NOT NULL, landuse text, area_m2 double precision, -- unit in the name, always geom geometry(MultiPolygon, 32633) NOT NULL ); CREATE INDEX parcels_geom_gix ON parcels USING gist (geom); ANALYZE parcels; ``` - **Type the geometry column fully**: `geometry(MultiPolygon, SRID)` — an untyped `geometry` column happily accepts mixed garbage. - Promote to Multi* on load (`ST_Multi`) so Polygon/MultiPolygon mixing never bites. - **geometry vs geography**: geometry in a projected SRID for regional analysis (fast, full function set); geography (SRID 4326) when the extent is global/cross-zone and you want meters without picking a projection (slower, smaller function set). Never store in 4326 geometry and call `ST_Area` expecting m² — that's square degrees. - Never use EPSG:3857/Web Mercator for area or length measurement. When the analysis CRS is not yet known, either use 4326 geography for a geodesic result or stop and select a verified local/equal-area CRS; do not present a known-distorting CRS as a runnable measurement alternative. - **Any stored geometry column you recommend must be typed with its SRID.** Advising a "second projected geometry column" for repeated measurement is incomplete until it is written as `geometry(<Type>, <SRID>)` with the index and the populating `ST_Transform`. An untyped column recommended as a fix reintroduces the mixed-SRID problem it was meant to solve: ```sql ALTER TABLE parcels ADD COLUMN geom_32633 geometry(MultiPolygon, 32633); UPDATE parcels SET geom_32633 = ST_Transform(geom, 32633); CREATE INDEX parcels_geom_32633_gix ON parcels USING gist (geom_32633); ``` - GiST index on every geometry column, `ANALYZE` after bulk loads; BRIN only for huge, spatially-ordered, append-only tables. - Load paths: `ogr2
Preview of the first 4,000 characters. Read full instructions →
Referenced files: 2 — file references are metadata, not package contents.
---
name: remote-sensing-analysis
description: >-
Always invoke for classical analysis, classification, validation, or
comparability of satellite, aerial, or drone imagery. This skill owns
sensor, product, processing-level and processing-baseline harmonization,
including multi-date inputs; add change-detection only after comparable
observations exist. Two scenes of the same product level are not
automatically comparable: Sentinel-2 L2A crossed a reflectance offset at
Processing Baseline 04.00 in January 2022, so any pair spanning that date
starts here. Covers spectral indices, masking, compositing, SAR, land cover,
and accuracy assessment. Route neural methods to geo-deep-learning and
planetary server-side execution to google-earth-engine.
license: MIT
metadata:
author: Muhammed Enes Duran
---
# Remote Sensing Analysis
Purpose: turn raw Earth observation imagery into defensible analytical
products. The failure modes here are subtle — uncorrected DNs treated as
reflectance, clouds counted as land cover change, indices computed on the
wrong bands — so this skill front-loads the checks.
## Data access (STAC-first)
Search via STAC APIs rather than per-provider portals; the workflow is
uniform and scriptable:
```python
import pystac_client
import odc.stac
catalog = pystac_client.Client.open("https://earth-search.aws.element84.com/v1")
items = catalog.search(
collections=["sentinel-2-l2a"],
bbox=[27.0, 38.3, 27.4, 38.6],
datetime="2025-05-01/2025-09-30",
query={"eo:cloud_cover": {"lt": 20}},
).item_collection()
ds = odc.stac.load(items, bands=["red", "nir", "scl"], resolution=10, chunks={})
```
Key collections: `sentinel-2-l2a` (10 m optical, surface reflectance),
`landsat-c2-l2` (30 m, 1982→), `sentinel-1-grd` (SAR, weather-independent).
Microsoft Planetary Computer mirrors most (needs `planetary_computer`
signing). For continental/global extents or decades-long stacks, route to
`google-earth-engine` instead of downloading. Record collection + item IDs +
search parameters for reproducibility.
## Processing-level discipline
| Level | Meaning | Analysis-ready? |
|---|---|---|
| L1C / L1TP | Top-of-atmosphere (TOA) | Indices OK-ish; cross-date comparison risky |
| **L2A / L2SP** | Surface reflectance (BOA) | Yes — default choice |
| GRD (SAR) | Detected amplitude | Needs terrain correction + speckle filter |
Always state which level you used. Never mix TOA and BOA scenes in one
composite or time series. Landsat Collection 2 L2 needs its scale factors
applied (`reflectance = DN * 0.0000275 - 0.2`).
### The Sentinel-2 baseline discontinuity — passes the level check above
Processing Baseline 04.00, applied from **25 January 2022**, added a constant
`BOA_ADD_OFFSET` (currently −1000) to L2A digital numbers so that negative
surface reflectance can be encoded. Two scenes on opposite sides of that date
are **both L2A**: the level check above sees nothing wrong while their DNs sit
1000 apart. Differencing them yields a systematic reflectance shift that reads
as real change and survives every mask, threshold and accuracy report you
apply afterwards.
- Read `BOA_ADD_OFFSET` and `QUANTIFICATION_VALUE` from each product's
metadata rather than hardcoding −1000 and 10000; both are per-band and the
baseline has changed before.
- Convert with `reflectance = (DN + BOA_ADD_OFFSET) / QUANTIFICATION_VALUE`.
- Record the **processing baseline of every scene** in the manifest, not just
the product level. Two L2A scenes is not a sufficient statement.
- **Do not correct twice.** Harmonised collections — Earth Engine's
`COPERNICUS/S2_SR_HARMONIZED` and several commercial mirrors — have already
shifted post-baseline data back to the pre-2022 range. Applying the offset
again inverts the error rather than removing it.
- If the baseline is undocumented for either scene, the comparison is not
defensible. Say that instead of assuming pre- or post-2022.
## Cloud and quality masking — before anything ePreview of the first 4,000 characters. Read full instructions →
Referenced files: 2 — file references are metadata, not package contents.
---
name: spatial-statistics
description: >-
Always invoke before testing a geographic pattern for clustering, hotspots,
dependence, or explanatory regression, even when aggregation or ordinary
OLS is proposed as routine. Covers Moran's I, LISA, Getis-Ord Gi*, weights,
MAUP and scale sensitivity for areas/grids, residual dependence, and
spatial lag/error/GWR/MGWR models. Use ML standards for predictive
evaluation and geostatistics for continuous surfaces from sparse samples.
license: MIT
metadata:
author: Muhammed Enes Duran
---
# Spatial Statistics
Purpose: answer "is it clustered, where, and why" with defensible inference.
The core discipline: spatial data violates independence assumptions, so
standard statistics silently overstate significance — every analysis here
starts with weights design and ends with residual diagnostics.
## Spatial weights (W) — the analysis IS the weights
Every result downstream depends on W; choose it for substantive reasons and
run a sensitivity check with one alternative:
| Weights | Use when |
|---|---|
| Queen/Rook contiguity | Irregular polygons (admin units, parcels) |
| K-nearest neighbors | Points; islands present (contiguity leaves them unconnected) |
| Distance band | Physical process with known range |
| Kernel (distance-decayed) | Smooth influence, GWR-style local models |
```python
from libpysal.weights import Queen
w = Queen.from_dataframe(gdf, use_index=True)
print(f"islands: {w.islands}") # unconnected units break stats — fix or document
w.transform = "r" # row-standardize (default for Moran/lag models)
```
Always report: weights type, parameters, number of islands, and whether
results survive an alternative W.
## Global → local workflow
1. **Global Moran's I** (`esda.Moran`, permutation inference ≥999) —
answers "any clustering at all?" Report I, p_sim, and the permutation
distribution, not the analytical p.
2. **LISA / local Moran** (`esda.Moran_Local`) — maps WHERE: High-High,
Low-Low clusters, High-Low/Low-High outliers. Correct for multiple
testing (FDR at minimum) before coloring a map — uncorrected LISA maps
overstate clusters and this is the field's most common abuse.
3. **Getis-Ord Gi\*** (`esda.G_Local`, star=True) — hot/cold spots of
intensity (a distinct question from Moran clusters — Gi* finds
concentrations of high values, LISA finds similarity structure).
4. Rates, not counts, for population-based phenomena; use Empirical Bayes
smoothing (`esda.smoothing`) for small-population units before any of
the above — raw rates in sparse units are noise.
## Point patterns
- Separate first-order intensity (density varies) from second-order
interaction (points attract/repel) — KDE describes the former, Ripley's
K/L (`pointpats`) tests the latter.
- Always test against an inhomogeneous null when the study area has obvious
density gradients (population, roads); CSR against a city is a strawman.
- KDE bandwidth drives the story: report it, justify it (Silverman/CV), and
show one alternative.
## Spatial regression decision path
Run OLS first, then diagnose — never start with a spatial model:
```python
from spreg import OLS
ols = OLS(y, X, w=w, spat_diag=True, moran=True, name_y="price", name_x=xnames)
```
Decision (Anselin's rule via LM tests): LM-Lag significant & LM-Error not →
**spatial lag (SAR)**; reverse → **spatial error (SEM)**; both → compare
robust LM versions; neither → OLS stands (report that as a finding).
Interpretation caveats: in SAR, coefficients are NOT marginal effects —
report direct/indirect (spillover) effects. In SEM, spatial structure is
nuisance correlation, no spillover story allowed.
**GWR/MGWR** (`mgwr`): when relationships plausibly vary over space.
Bandwidth by AICc search; map local coefficients WITH local t-values masked
for insignificance; MGWR when predictors operate at different scales.
GWR is exploratory — resist causal language on local coefficients.
## Inference hoPreview of the first 4,000 characters. Read full instructions →
Referenced files: 2 — file references are metadata, not package contents.
---
name: swe-devops-standards
description: >-
Always invoke to review, repair, or deliver geospatial or GeoAI code,
including contract compliance, security, error handling, transactions,
tests, scripts, functions, notebooks, packages, CI/CD, and repository
changes, even when deployment is not requested. Pair with the domain skill
for ETL and other production code. Covers CRS/data invariants, dependencies,
cross-platform reproducibility, automation, and shipping. Do not trigger for
unrelated software or analysis requesting no code or repository artifact.
license: MIT
metadata:
author: Muhammed Enes Duran
---
# Geospatial SWE & DevOps Standards
Purpose: code produced as part of geospatial work should run in the user's
real environment and meet peer-level engineering quality. Apply these rules
only when code or repository artifacts are in scope.
## 1. Environment realities (the top error source)
- **Script-first by default**: no `%matplotlib inline`, `!pip install`, or
`display()` unless the user is explicitly in a notebook. Every file runs
from a terminal via `python script.py` behind an
`if __name__ == "__main__":` block. (Cell markers like `# %%` are fine
as an addition — the script must also work without them.)
- **Cross-platform paths**: always `pathlib.Path`; never string-concatenate
or hardcode `/` or `\\`. Ask or detect the user's OS before giving shell
commands; give CMD/PowerShell syntax on Windows, POSIX elsewhere —
don't mix (`export` vs `set`, `venv/bin/activate` vs
`venv\Scripts\activate`).
- **Encodings**: explicit `encoding="utf-8"` on every text file open —
Windows still defaults to legacy code pages, and non-ASCII content
corrupts silently.
- **Modern Python (3.11+)**: `X | None` unions, `type` aliases, structural
pattern matching where they clarify; state the minimum version if a
feature requires it.
## 2. Code quality defaults
Applied to every generated function/module, even when not asked:
```python
def compute_share(values: list[float], total: float) -> list[float]:
"""Return each value's share of the total.
Args:
values: Values to compute shares for.
total: Denominator; must be non-zero.
Returns:
Shares in the same order as values.
Raises:
ValueError: If total is zero.
"""
if total == 0:
raise ValueError("total must be non-zero — share is undefined.")
return [v / total for v in values]
```
- Type hints on every signature; `dataclass`/`TypeAlias` for complex types.
- Google-style docstrings; one-liners suffice for trivial functions.
- **Never bare `except:`**; catch specific exceptions, handle or re-raise
with `raise ... from e`. A silent `pass` costs a week of debugging.
- `logging` over `print` (leveled, formatted), except user-facing CLI
output.
- Note algorithmic complexity where it matters ("this is O(n log n), safe
at n>10⁶") — especially around nested loops and pandas `apply`.
- Magic numbers → named module-level constants.
## 3. Testing and verification
- Offer at least a skeleton pytest for every function carrying real logic:
```python
# test_compute.py — run: python -m pytest -q
import pytest
from compute import compute_share
def test_basic() -> None:
assert compute_share([1, 1], 2) == [0.5, 0.5]
def test_zero_total_raises() -> None:
with pytest.raises(ValueError):
compute_share([1.0], 0)
```
- Numerical code: test edge cases — empty input, NaN, negatives, single
element.
- Run generated code yourself when an execution environment exists;
otherwise mark it explicitly "not executed" — no silent assumptions.
## 4. Dependencies and reproducibility
- New project → virtual environment + pinned `requirements.txt`
(`package==version`); never "install the latest".
- Seed randomness and put the seed in config (details in
`ml-experiment-standards`).
- Note environment-difference risks where relevant (BLAS, CUDA, locale).
## 5. Git practices
- ConventiPreview of the first 4,000 characters. Read full instructions →
Referenced files: 2 — file references are metadata, not package contents.
---
name: terrain-hydrology
description: >-
Always invoke for terrain, drainage, viewshed, or visibility analysis from
elevation, even before the DEM or correct surface is chosen. Covers
DTM-versus-DSM selection, slope, aspect, curvature, hillshade, conditioning,
flow direction/accumulation, streams, watersheds, and catchments. Use
point-cloud-lidar first only when an elevation surface must be created from
LiDAR or photogrammetric points.
license: MIT
metadata:
author: Muhammed Enes Duran
---
# Terrain & Hydrology
Purpose: terrain products whose numbers are physically meaningful. The two
recurring failure modes: **unit mismatch** (degree coordinates with meter
elevations silently corrupts every derivative) and **unconditioned DEMs**
(flow routed into spurious pits produces fragmented, fictional streams).
## DEM hygiene first
| Check | Rule |
|---|---|
| Surface type | **DTM** (bare earth) for hydrology/slope; **DSM** (with canopy/buildings) for viewshed/solar. Using a DSM for watersheds routes rivers over treetops. |
| Source | Copernicus GLO-30 > SRTM for most global work; national LiDAR DTMs when available (see `point-cloud-lidar` to make your own). Record source + acquisition date. |
| Nodata | Identify the nodata value (-9999, -32768, 3.4e38) and mask it — never let it enter statistics or fill algorithms as "very deep hole". |
| Voids | Fill data voids (interpolation from edges) BEFORE hydrological conditioning; document filled areas. |
| **CRS + units** | Reproject to a projected CRS so horizontal units = vertical units (meters). Slope from a 4326 DEM without z-factor correction is the classic silent error. If staying geographic, apply a latitude-dependent z-factor — better: don't. |
## Derivatives
```python
import whitebox
wbt = whitebox.WhiteboxTools()
wbt.slope("dem.tif", "slope_deg.tif", units="degrees")
wbt.aspect("dem.tif", "aspect_deg.tif")
wbt.plan_curvature("dem.tif", "plan_curv.tif")
```
- Slope: state units (degrees vs percent — 45° = 100%); Horn's method
(3×3) is the standard; steeper terrain → consider resolution effects
(slope flattens as cell size grows — report cell size with every slope
statistic).
- Aspect: circular variable — never average it arithmetically; use vector
(sin/cos) averaging; flat cells have undefined aspect (mask, don't zero).
- Curvature: plan (flow convergence) vs profile (flow acceleration) —
pick per question.
- Hillshade is for cartography (see `cartography-geoviz`), never analysis
input.
- Ruggedness/position: TRI, TPI (radius-dependent — report the radius),
geomorphons for landform classification.
## Hydrological conditioning — order matters
```
voids filled → breach depressions (preferred) → fill remaining pits
→ flow direction → flow accumulation → streams → watersheds
```
- **Breaching before filling** (WhiteboxTools
`BreachDepressionsLeastCost`): carves through barriers (road embankments
over culverts) instead of flooding upstream areas flat. Pure fill on
flat/embanked terrain creates large artificial lakes with arbitrary flow
paths.
- Real depressions exist (karst, prairie potholes, reservoirs). If the
landscape genuinely holds water, don't condition it away — model with
explicit sink handling and say so.
- Flow direction: **D8** for stream networks/watersheds (discrete,
standard); **D-infinity/MFD** for dispersal quantities (wetness index,
erosion) on hillslopes.
## Streams and watersheds
- Stream extraction threshold (min. accumulation) is a MODELING choice:
derive from a mapped reference network (match total stream length) or
report the threshold and show two alternatives — never present one
threshold's network as "the" rivers.
- **Pour point snapping**: outlet coordinates rarely fall on the modeled
stream cell. Snap to the highest-accumulation cell within a search
radius (`wbt.jenson_snap_pour_points`) — an unsnapped pour point yields
a tiny, wrong watershed silently.
- Verify delineation: watershed area vPreview of the first 4,000 characters. Read full instructions →
Referenced files: 2 — file references are metadata, not package contents.
Publisher declarations from the archived package. These are separate from our research and the live service's terms.
Package observed Nov 21, 2026.
plugins_6a68c8b958b88191b2bfeae31847c8da
Download plugin data (JSON)Plugin details: served from cache. Prepared . Refreshed when plugin data changes or after 6 hours. Your account and Follow status are live.