@pikaa-ai/pikaa 0.3.23 → 0.3.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/assets/brand/orbit-logo-option4-whale.jpg +0 -0
  2. package/assets/brand/orbit-logo.jpg +0 -0
  3. package/assets/brand/orbit-logo.png +0 -0
  4. package/assets/brand/orbit-logo.svg +3 -0
  5. package/dist/cli.js +337 -162
  6. package/dist/index.js +1 -2
  7. package/package.json +1 -2
  8. package/skills/adaptyv/SKILL.md +0 -240
  9. package/skills/aeon/SKILL.md +0 -402
  10. package/skills/analytical-method-validation/SKILL.md +0 -299
  11. package/skills/anndata/SKILL.md +0 -431
  12. package/skills/arbor/SKILL.md +0 -152
  13. package/skills/arboreto/SKILL.md +0 -267
  14. package/skills/astropy/SKILL.md +0 -353
  15. package/skills/autoskill/SKILL.md +0 -233
  16. package/skills/benchling-integration/SKILL.md +0 -229
  17. package/skills/bgpt-paper-search/SKILL.md +0 -75
  18. package/skills/bids/SKILL.md +0 -237
  19. package/skills/biopython/SKILL.md +0 -472
  20. package/skills/bioservices/SKILL.md +0 -399
  21. package/skills/bulk-rnaseq/SKILL.md +0 -198
  22. package/skills/cellxgene-census/SKILL.md +0 -283
  23. package/skills/cirq/SKILL.md +0 -370
  24. package/skills/citation-management/SKILL.md +0 -329
  25. package/skills/clinical-decision-support/SKILL.md +0 -238
  26. package/skills/clinical-decision-support/references/README.md +0 -62
  27. package/skills/clinical-reports/SKILL.md +0 -248
  28. package/skills/clinical-reports/references/README.md +0 -34
  29. package/skills/cobrapy/SKILL.md +0 -496
  30. package/skills/consciousness-council/SKILL.md +0 -151
  31. package/skills/dask/SKILL.md +0 -482
  32. package/skills/database-lookup/SKILL.md +0 -386
  33. package/skills/datamol/SKILL.md +0 -200
  34. package/skills/deepchem/SKILL.md +0 -244
  35. package/skills/deepspot-m/SKILL.md +0 -175
  36. package/skills/deeptools/SKILL.md +0 -412
  37. package/skills/depmap/SKILL.md +0 -301
  38. package/skills/dhdna-profiler/SKILL.md +0 -184
  39. package/skills/diffdock/SKILL.md +0 -488
  40. package/skills/dnanexus-integration/SKILL.md +0 -325
  41. package/skills/docx/SKILL.md +0 -99
  42. package/skills/esm/SKILL.md +0 -334
  43. package/skills/etetoolkit/SKILL.md +0 -327
  44. package/skills/exa-search/SKILL.md +0 -102
  45. package/skills/executing-plans/SKILL.md +0 -14
  46. package/skills/experimental-design/SKILL.md +0 -234
  47. package/skills/exploratory-data-analysis/SKILL.md +0 -280
  48. package/skills/flowio/SKILL.md +0 -310
  49. package/skills/fluidsim/SKILL.md +0 -279
  50. package/skills/frontend-design/SKILL.md +0 -100
  51. package/skills/generate-image/SKILL.md +0 -304
  52. package/skills/geniml/SKILL.md +0 -310
  53. package/skills/genomic-coordinates/SKILL.md +0 -189
  54. package/skills/genomic-intelligence/SKILL.md +0 -243
  55. package/skills/geomaster/README.md +0 -105
  56. package/skills/geomaster/SKILL.md +0 -366
  57. package/skills/geopandas/SKILL.md +0 -250
  58. package/skills/get-available-resources/SKILL.md +0 -260
  59. package/skills/gget/SKILL.md +0 -153
  60. package/skills/ginkgo-cloud-lab/SKILL.md +0 -106
  61. package/skills/glycoengineering/SKILL.md +0 -339
  62. package/skills/gtars/SKILL.md +0 -282
  63. package/skills/guardian-rails/SKILL.md +0 -54
  64. package/skills/histolab/SKILL.md +0 -243
  65. package/skills/hugging-science/SKILL.md +0 -132
  66. package/skills/hypogenic/SKILL.md +0 -290
  67. package/skills/hypothesis-generation/SKILL.md +0 -264
  68. package/skills/imaging-data-commons/SKILL.md +0 -496
  69. package/skills/infographics/SKILL.md +0 -315
  70. package/skills/iso-standards-readiness/SKILL.md +0 -352
  71. package/skills/lab-hardware-cad/SKILL.md +0 -372
  72. package/skills/labarchive-integration/SKILL.md +0 -216
  73. package/skills/lamindb/SKILL.md +0 -408
  74. package/skills/latchbio-integration/SKILL.md +0 -227
  75. package/skills/latex-posters/SKILL.md +0 -369
  76. package/skills/latex-posters/references/README.md +0 -439
  77. package/skills/liteparse/SKILL.md +0 -295
  78. package/skills/literature-review/SKILL.md +0 -263
  79. package/skills/markdown-mermaid-writing/SKILL.md +0 -322
  80. package/skills/market-research-reports/SKILL.md +0 -337
  81. package/skills/markitdown/SKILL.md +0 -264
  82. package/skills/matchms/SKILL.md +0 -276
  83. package/skills/matlab/SKILL.md +0 -274
  84. package/skills/matplotlib/SKILL.md +0 -378
  85. package/skills/medchem/SKILL.md +0 -321
  86. package/skills/modal/SKILL.md +0 -468
  87. package/skills/molecular-dynamics/SKILL.md +0 -458
  88. package/skills/molfeat/SKILL.md +0 -348
  89. package/skills/ncats-arax/SKILL.md +0 -178
  90. package/skills/networkx/SKILL.md +0 -440
  91. package/skills/neurokit2/SKILL.md +0 -323
  92. package/skills/neuropixels-analysis/SKILL.md +0 -412
  93. package/skills/nextflow/SKILL.md +0 -195
  94. package/skills/omero-integration/SKILL.md +0 -222
  95. package/skills/onekgpd/SKILL.md +0 -371
  96. package/skills/ontology-term-resolution/SKILL.md +0 -147
  97. package/skills/open-notebook/SKILL.md +0 -297
  98. package/skills/openpiv/SKILL.md +0 -469
  99. package/skills/opentrons-integration/SKILL.md +0 -322
  100. package/skills/optimize-for-gpu/SKILL.md +0 -176
  101. package/skills/owasp-top10/SKILL.md +0 -48
  102. package/skills/pacsomatic/LICENSE +0 -21
  103. package/skills/pacsomatic/SKILL.md +0 -150
  104. package/skills/paper-lookup/SKILL.md +0 -263
  105. package/skills/paperclip/SKILL.md +0 -413
  106. package/skills/paperzilla/SKILL.md +0 -159
  107. package/skills/parallel-web/SKILL.md +0 -128
  108. package/skills/pathml/SKILL.md +0 -222
  109. package/skills/pathogen-variant-surveillance/SKILL.md +0 -208
  110. package/skills/pathway-enrichment/SKILL.md +0 -194
  111. package/skills/pdf/SKILL.md +0 -322
  112. package/skills/peer-review/SKILL.md +0 -288
  113. package/skills/penetration-testing/SKILL.md +0 -31
  114. package/skills/pennylane/SKILL.md +0 -240
  115. package/skills/phylogenetics/SKILL.md +0 -409
  116. package/skills/pi-agent/SKILL.md +0 -83
  117. package/skills/pkpd-modeling/SKILL.md +0 -381
  118. package/skills/polars/SKILL.md +0 -393
  119. package/skills/polars-bio/SKILL.md +0 -379
  120. package/skills/ponytail/SKILL.md +0 -31
  121. package/skills/ponytail-audit/SKILL.md +0 -18
  122. package/skills/pptx/SKILL.md +0 -246
  123. package/skills/pptx-posters/SKILL.md +0 -258
  124. package/skills/primekg/SKILL.md +0 -99
  125. package/skills/protocolsio-integration/SKILL.md +0 -236
  126. package/skills/pufferlib/SKILL.md +0 -328
  127. package/skills/pydeseq2/SKILL.md +0 -369
  128. package/skills/pydicom/SKILL.md +0 -381
  129. package/skills/pyhealth/SKILL.md +0 -124
  130. package/skills/pylabrobot/SKILL.md +0 -216
  131. package/skills/pymatgen/SKILL.md +0 -404
  132. package/skills/pymc/SKILL.md +0 -310
  133. package/skills/pymoo/SKILL.md +0 -276
  134. package/skills/pyopenms/SKILL.md +0 -179
  135. package/skills/pysam/SKILL.md +0 -330
  136. package/skills/pytdc/SKILL.md +0 -297
  137. package/skills/pytorch-lightning/SKILL.md +0 -191
  138. package/skills/pyzotero/SKILL.md +0 -137
  139. package/skills/qiskit/SKILL.md +0 -259
  140. package/skills/qutip/SKILL.md +0 -317
  141. package/skills/rdkit/SKILL.md +0 -94
  142. package/skills/relsa-severity-assessment/SKILL.md +0 -354
  143. package/skills/research-grants/SKILL.md +0 -296
  144. package/skills/research-grants/references/README.md +0 -287
  145. package/skills/research-lookup/README.md +0 -106
  146. package/skills/research-lookup/SKILL.md +0 -338
  147. package/skills/rowan/SKILL.md +0 -398
  148. package/skills/scanpy/SKILL.md +0 -303
  149. package/skills/scholar-evaluation/SKILL.md +0 -296
  150. package/skills/scientific-brainstorming/SKILL.md +0 -282
  151. package/skills/scientific-critical-thinking/SKILL.md +0 -180
  152. package/skills/scientific-schematics/SKILL.md +0 -370
  153. package/skills/scientific-slides/SKILL.md +0 -379
  154. package/skills/scientific-visualization/SKILL.md +0 -285
  155. package/skills/scientific-writing/SKILL.md +0 -356
  156. package/skills/scikit-bio/SKILL.md +0 -470
  157. package/skills/scikit-learn/SKILL.md +0 -324
  158. package/skills/scikit-survival/SKILL.md +0 -313
  159. package/skills/scvelo/SKILL.md +0 -328
  160. package/skills/scvi-tools/SKILL.md +0 -201
  161. package/skills/seaborn/SKILL.md +0 -254
  162. package/skills/security-auditor/SKILL.md +0 -37
  163. package/skills/shap/SKILL.md +0 -282
  164. package/skills/simpy/SKILL.md +0 -283
  165. package/skills/stable-baselines3/SKILL.md +0 -325
  166. package/skills/statistical-analysis/SKILL.md +0 -446
  167. package/skills/statistical-power/SKILL.md +0 -200
  168. package/skills/statsmodels/SKILL.md +0 -238
  169. package/skills/sympy/SKILL.md +0 -354
  170. package/skills/systematic-debugging/SKILL.md +0 -35
  171. package/skills/tamarind/SKILL.md +0 -285
  172. package/skills/tdd/SKILL.md +0 -26
  173. package/skills/tiledbvcf/SKILL.md +0 -456
  174. package/skills/timesfm-forecasting/SKILL.md +0 -408
  175. package/skills/timesfm-forecasting/examples/global-temperature/README.md +0 -178
  176. package/skills/torch-geometric/SKILL.md +0 -458
  177. package/skills/torchdrug/SKILL.md +0 -241
  178. package/skills/transformers/SKILL.md +0 -195
  179. package/skills/treatment-plans/SKILL.md +0 -174
  180. package/skills/treatment-plans/references/README.md +0 -19
  181. package/skills/umap-learn/SKILL.md +0 -488
  182. package/skills/uncertainty-and-units/SKILL.md +0 -384
  183. package/skills/usfiscaldata/SKILL.md +0 -171
  184. package/skills/vaex/SKILL.md +0 -204
  185. package/skills/venue-templates/SKILL.md +0 -269
  186. package/skills/verification-before-completion/SKILL.md +0 -22
  187. package/skills/waypoint-bio/SKILL.md +0 -273
  188. package/skills/what-if-oracle/SKILL.md +0 -184
  189. package/skills/writing-plans/SKILL.md +0 -15
  190. package/skills/xlsx/SKILL.md +0 -110
  191. package/skills/zarr-python/SKILL.md +0 -241
@@ -1,366 +0,0 @@
1
- ---
2
- name: geomaster
3
- description: Comprehensive geospatial science skill covering remote sensing, GIS, spatial analysis, machine learning for earth observation, and 30+ scientific domains. Supports satellite imagery processing (Sentinel, Landsat, MODIS, SAR, hyperspectral), vector and raster data operations, spatial statistics, point cloud processing, network analysis, cloud-native workflows (STAC, COG, Planetary Computer), and 8 programming languages (Python, R, Julia, JavaScript, C++, Java, Go, Rust) with 500+ code examples. Use for remote sensing workflows, GIS analysis, spatial ML, Earth observation data processing, terrain analysis, hydrological modeling, marine spatial analysis, atmospheric science, and any geospatial computation task.
4
- license: MIT License
5
- metadata:
6
- version: "1.1"
7
- skill-author: K-Dense Inc.
8
- ---
9
-
10
- # GeoMaster
11
-
12
- Comprehensive geospatial science skill covering GIS, remote sensing, spatial analysis, and ML for Earth observation across 70+ topics with 500+ code examples in 8 programming languages.
13
-
14
- ## Installation
15
-
16
- ```bash
17
- # Core Python stack (conda recommended)
18
- conda install -c conda-forge gdal rasterio fiona shapely pyproj geopandas
19
-
20
- # Remote sensing & ML
21
- uv pip install rsgislib torchgeo earthengine-api
22
- uv pip install scikit-learn xgboost torch-geometric
23
-
24
- # Network & visualization
25
- uv pip install osmnx networkx folium keplergl
26
- uv pip install cartopy contextily mapclassify
27
-
28
- # Big data & cloud
29
- uv pip install xarray rioxarray dask-geopandas
30
- uv pip install pystac-client planetary-computer
31
-
32
- # Point clouds
33
- uv pip install laspy pylas open3d pdal
34
-
35
- # Databases
36
- conda install -c conda-forge postgis spatialite
37
- ```
38
-
39
- ## Quick Start
40
-
41
- ### NDVI from Sentinel-2
42
-
43
- ```python
44
- import rasterio
45
- import numpy as np
46
-
47
- with rasterio.open('sentinel2.tif') as src:
48
- red = src.read(4).astype(float) # B04
49
- nir = src.read(8).astype(float) # B08
50
- ndvi = (nir - red) / (nir + red + 1e-8)
51
- ndvi = np.nan_to_num(ndvi, nan=0)
52
-
53
- profile = src.profile
54
- profile.update(count=1, dtype=rasterio.float32)
55
-
56
- with rasterio.open('ndvi.tif', 'w', **profile) as dst:
57
- dst.write(ndvi.astype(rasterio.float32), 1)
58
- ```
59
-
60
- ### Spatial Analysis with GeoPandas
61
-
62
- ```python
63
- import geopandas as gpd
64
-
65
- # Load and ensure same CRS
66
- zones = gpd.read_file('zones.geojson')
67
- points = gpd.read_file('points.geojson')
68
-
69
- if zones.crs != points.crs:
70
- points = points.to_crs(zones.crs)
71
-
72
- # Spatial join and statistics
73
- joined = gpd.sjoin(points, zones, how='inner', predicate='within')
74
- stats = joined.groupby('zone_id').agg({
75
- 'value': ['count', 'mean', 'std', 'min', 'max']
76
- }).round(2)
77
- ```
78
-
79
- ### Google Earth Engine Time Series
80
-
81
- ```python
82
- import ee
83
- import pandas as pd
84
-
85
- ee.Initialize(project='your-project')
86
- roi = ee.Geometry.Point([-122.4, 37.7]).buffer(10000)
87
-
88
- s2 = (ee.ImageCollection('COPERNICUS/S2_SR_HARMONIZED')
89
- .filterBounds(roi)
90
- .filterDate('2020-01-01', '2023-12-31')
91
- .filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 20)))
92
-
93
- def add_ndvi(img):
94
- return img.addBands(img.normalizedDifference(['B8', 'B4']).rename('NDVI'))
95
-
96
- s2_ndvi = s2.map(add_ndvi)
97
-
98
- def extract_series(image):
99
- stats = image.reduceRegion(ee.Reducer.mean(), roi.centroid(), scale=10, maxPixels=1e9)
100
- return ee.Feature(None, {'date': image.date().format('YYYY-MM-dd'), 'ndvi': stats.get('NDVI')})
101
-
102
- series = s2_ndvi.map(extract_series).getInfo()
103
- df = pd.DataFrame([f['properties'] for f in series['features']])
104
- df['date'] = pd.to_datetime(df['date'])
105
- ```
106
-
107
- ## Core Concepts
108
-
109
- ### Data Types
110
-
111
- | Type | Examples | Libraries |
112
- |------|----------|-----------|
113
- | Vector | Shapefile, GeoJSON, GeoPackage | GeoPandas, Fiona, GDAL |
114
- | Raster | GeoTIFF, NetCDF, COG | Rasterio, Xarray, GDAL |
115
- | Point Cloud | LAS, LAZ | Laspy, PDAL, Open3D |
116
-
117
- ### Coordinate Systems
118
-
119
- - **EPSG:4326** (WGS 84) - Geographic, lat/lon, use for storage
120
- - **EPSG:3857** (Web Mercator) - Web maps only (don't use for area/distance!)
121
- - **EPSG:326xx/327xx** (UTM) - Metric calculations, <1% distortion per zone
122
- - Use `gdf.estimate_utm_crs()` for automatic UTM detection
123
-
124
- ```python
125
- # Always check CRS before operations
126
- assert gdf1.crs == gdf2.crs, "CRS mismatch!"
127
-
128
- # For area/distance calculations, use projected CRS
129
- gdf_metric = gdf.to_crs(gdf.estimate_utm_crs())
130
- area_sqm = gdf_metric.geometry.area
131
- ```
132
-
133
- ### OGC Standards
134
-
135
- - **WMS**: Web Map Service - raster maps
136
- - **WFS**: Web Feature Service - vector data
137
- - **WCS**: Web Coverage Service - raster coverage
138
- - **STAC**: Spatiotemporal Asset Catalog - modern metadata
139
-
140
- ## Common Operations
141
-
142
- ### Spectral Indices
143
-
144
- ```python
145
- def calculate_indices(image_path):
146
- """NDVI, EVI, SAVI, NDWI from Sentinel-2."""
147
- with rasterio.open(image_path) as src:
148
- B02, B03, B04, B08, B11 = [src.read(i).astype(float) for i in [1,2,3,4,5]]
149
-
150
- ndvi = (B08 - B04) / (B08 + B04 + 1e-8)
151
- evi = 2.5 * (B08 - B04) / (B08 + 6*B04 - 7.5*B02 + 1)
152
- savi = ((B08 - B04) / (B08 + B04 + 0.5)) * 1.5
153
- ndwi = (B03 - B08) / (B03 + B08 + 1e-8)
154
-
155
- return {'NDVI': ndvi, 'EVI': evi, 'SAVI': savi, 'NDWI': ndwi}
156
- ```
157
-
158
- ### Vector Operations
159
-
160
- ```python
161
- # Buffer (use projected CRS!)
162
- gdf_proj = gdf.to_crs(gdf.estimate_utm_crs())
163
- gdf['buffer_1km'] = gdf_proj.geometry.buffer(1000)
164
-
165
- # Spatial relationships
166
- intersects = gdf[gdf.geometry.intersects(other_geometry)]
167
- contains = gdf[gdf.geometry.contains(point_geometry)]
168
-
169
- # Geometric operations
170
- gdf['centroid'] = gdf.geometry.centroid
171
- gdf['simplified'] = gdf.geometry.simplify(tolerance=0.001)
172
-
173
- # Overlay operations
174
- intersection = gpd.overlay(gdf1, gdf2, how='intersection')
175
- union = gpd.overlay(gdf1, gdf2, how='union')
176
- ```
177
-
178
- ### Terrain Analysis
179
-
180
- ```python
181
- def terrain_metrics(dem_path):
182
- """Calculate slope, aspect, hillshade from DEM."""
183
- with rasterio.open(dem_path) as src:
184
- dem = src.read(1)
185
-
186
- dy, dx = np.gradient(dem)
187
- slope = np.arctan(np.sqrt(dx**2 + dy**2)) * 180 / np.pi
188
- aspect = (90 - np.arctan2(-dy, dx) * 180 / np.pi) % 360
189
-
190
- # Hillshade
191
- az_rad, alt_rad = np.radians(315), np.radians(45)
192
- hillshade = (np.sin(alt_rad) * np.sin(np.radians(slope)) +
193
- np.cos(alt_rad) * np.cos(np.radians(slope)) *
194
- np.cos(np.radians(aspect) - az_rad))
195
-
196
- return slope, aspect, hillshade
197
- ```
198
-
199
- ### Network Analysis
200
-
201
- ```python
202
- import osmnx as ox
203
- import networkx as nx
204
-
205
- # Download and analyze street network
206
- G = ox.graph_from_place('San Francisco, CA', network_type='drive')
207
- G = ox.add_edge_speeds(G).add_edge_travel_times(G)
208
-
209
- # Shortest path
210
- orig = ox.distance.nearest_nodes(G, -122.4, 37.7)
211
- dest = ox.distance.nearest_nodes(G, -122.3, 37.8)
212
- route = nx.shortest_path(G, orig, dest, weight='travel_time')
213
- ```
214
-
215
- ## Image Classification
216
-
217
- ```python
218
- from sklearn.ensemble import RandomForestClassifier
219
- import rasterio
220
- from rasterio.features import rasterize
221
-
222
- def classify_imagery(raster_path, training_gdf, output_path):
223
- """Train RF and classify imagery."""
224
- with rasterio.open(raster_path) as src:
225
- image = src.read()
226
- profile = src.profile
227
- transform = src.transform
228
-
229
- # Extract training data
230
- X_train, y_train = [], []
231
- for _, row in training_gdf.iterrows():
232
- mask = rasterize([(row.geometry, 1)],
233
- out_shape=(profile['height'], profile['width']),
234
- transform=transform, fill=0, dtype=np.uint8)
235
- pixels = image[:, mask > 0].T
236
- X_train.extend(pixels)
237
- y_train.extend([row['class_id']] * len(pixels))
238
-
239
- # Train and predict
240
- rf = RandomForestClassifier(n_estimators=100, max_depth=20, n_jobs=-1)
241
- rf.fit(X_train, y_train)
242
-
243
- prediction = rf.predict(image.reshape(image.shape[0], -1).T)
244
- prediction = prediction.reshape(profile['height'], profile['width'])
245
-
246
- profile.update(dtype=rasterio.uint8, count=1)
247
- with rasterio.open(output_path, 'w', **profile) as dst:
248
- dst.write(prediction.astype(rasterio.uint8), 1)
249
-
250
- return rf
251
- ```
252
-
253
- ## Modern Cloud-Native Workflows
254
-
255
- ### STAC + Planetary Computer
256
-
257
- ```python
258
- import pystac_client
259
- import planetary_computer
260
- import odc.stac
261
-
262
- # Search Sentinel-2 via STAC
263
- catalog = pystac_client.Client.open(
264
- "https://planetarycomputer.microsoft.com/api/stac/v1",
265
- modifier=planetary_computer.sign_inplace,
266
- )
267
-
268
- search = catalog.search(
269
- collections=["sentinel-2-l2a"],
270
- bbox=[-122.5, 37.7, -122.3, 37.9],
271
- datetime="2023-01-01/2023-12-31",
272
- query={"eo:cloud_cover": {"lt": 20}},
273
- )
274
-
275
- # Load as xarray (cloud-native!)
276
- data = odc.stac.load(
277
- list(search.get_items())[:5],
278
- bands=["B02", "B03", "B04", "B08"],
279
- crs="EPSG:32610",
280
- resolution=10,
281
- )
282
-
283
- # Calculate NDVI on xarray
284
- ndvi = (data.B08 - data.B04) / (data.B08 + data.B04)
285
- ```
286
-
287
- ### Cloud-Optimized GeoTIFF (COG)
288
-
289
- ```python
290
- import rasterio
291
- from rasterio.session import AWSSession
292
-
293
- # Read COG directly from cloud (partial reads)
294
- session = AWSSession(aws_access_key_id=..., aws_secret_access_key=...)
295
- with rasterio.open('s3://bucket/path.tif', session=session) as src:
296
- # Read only window of interest
297
- window = ((1000, 2000), (1000, 2000))
298
- subset = src.read(1, window=window)
299
-
300
- # Write COG
301
- with rasterio.open('output.tif', 'w', **profile,
302
- tiled=True, blockxsize=256, blockysize=256,
303
- compress='DEFLATE', predictor=2) as dst:
304
- dst.write(data)
305
-
306
- # Validate COG
307
- from rio_cogeo.cogeo import cog_validate
308
- cog_validate('output.tif')
309
- ```
310
-
311
- ## Performance Tips
312
-
313
- ```python
314
- # 1. Spatial indexing (10-100x faster queries)
315
- gdf.sindex # Auto-created by GeoPandas
316
-
317
- # 2. Chunk large rasters
318
- with rasterio.open('large.tif') as src:
319
- for i, window in src.block_windows(1):
320
- block = src.read(1, window=window)
321
-
322
- # 3. Dask for big data
323
- import dask.array as da
324
- dask_array = da.from_rasterio('large.tif', chunks=(1, 1024, 1024))
325
-
326
- # 4. Use Arrow for I/O
327
- gdf.to_file('output.gpkg', use_arrow=True)
328
-
329
- # 5. GDAL caching
330
- from osgeo import gdal
331
- gdal.SetCacheMax(2**30) # 1GB cache
332
-
333
- # 6. Parallel processing
334
- rf = RandomForestClassifier(n_jobs=-1) # All cores
335
- ```
336
-
337
- ## Best Practices
338
-
339
- 1. **Always check CRS** before spatial operations
340
- 2. **Use projected CRS** for area/distance calculations
341
- 3. **Validate geometries**: `gdf = gdf[gdf.is_valid]`
342
- 4. **Handle missing data**: `gdf['geometry'] = gdf['geometry'].fillna(None)`
343
- 5. **Use efficient formats**: GeoPackage > Shapefile, Parquet for large data
344
- 6. **Apply cloud masking** to optical imagery
345
- 7. **Preserve lineage** for reproducible research
346
- 8. **Use appropriate resolution** for your analysis scale
347
-
348
- ## Detailed Documentation
349
-
350
- - **[Coordinate Systems](references/coordinate-systems.md)** - CRS fundamentals, UTM, transformations
351
- - **[Core Libraries](references/core-libraries.md)** - GDAL, Rasterio, GeoPandas, Shapely
352
- - **[Remote Sensing](references/remote-sensing.md)** - Satellite missions, spectral indices, SAR
353
- - **[Machine Learning](references/machine-learning.md)** - Deep learning, CNNs, GNNs for RS
354
- - **[GIS Software](references/gis-software.md)** - QGIS, ArcGIS, GRASS integration
355
- - **[Scientific Domains](references/scientific-domains.md)** - Marine, hydrology, agriculture, forestry
356
- - **[Advanced GIS](references/advanced-gis.md)** - 3D GIS, spatiotemporal, topology
357
- - **[Big Data](references/big-data.md)** - Distributed processing, GPU acceleration
358
- - **[Industry Applications](references/industry-applications.md)** - Urban planning, disaster management
359
- - **[Programming Languages](references/programming-languages.md)** - Python, R, Julia, JS, C++, Java, Go, Rust
360
- - **[Data Sources](references/data-sources.md)** - Satellite catalogs, APIs
361
- - **[Troubleshooting](references/troubleshooting.md)** - Common issues, debugging, error reference
362
- - **[Code Examples](references/code-examples.md)** - 500+ examples
363
-
364
- ---
365
-
366
- **GeoMaster covers everything from basic GIS operations to advanced remote sensing and machine learning.**
@@ -1,250 +0,0 @@
1
- ---
2
- name: geopandas
3
- description: Guidance and local audit tools for Python workflows that directly use GeoPandas GeoSeries, GeoDataFrame, spatial operations, or vector-data I/O.
4
- license: MIT
5
- compatibility: Requires Python 3.10+ and uv. Bundled CLIs are local-only; runtime analysis requires the pinned GeoPandas stack below.
6
- allowed-tools: Read Write Bash Glob Grep
7
- metadata:
8
- version: "1.1"
9
- skill-author: K-Dense Inc.
10
- last-reviewed: "2026-07-23"
11
- ---
12
-
13
- # GeoPandas
14
-
15
- Use GeoPandas for planar vector data represented as pandas-like `GeoSeries` and
16
- `GeoDataFrame` objects. This skill targets stable **GeoPandas 1.1.4** (released
17
- 2026-06-26), not the unreleased 1.2 documentation.
18
-
19
- ## Reproducible environment
20
-
21
- GeoPandas 1.1.4 requires Python 3.10+; its tagged source requires NumPy >=1.24,
22
- pandas >=2.0, Shapely >=2.0, pyproj >=3.5, pyogrio >=0.7.2, and `packaging`.
23
- This exact Python 3.12 snapshot was smoke-tested on 2026-07-23:
24
-
25
- ```bash
26
- uv venv --python 3.12
27
- uv pip install \
28
- "geopandas==1.1.4" \
29
- "numpy==2.5.1" \
30
- "pandas==3.0.5" \
31
- "shapely==2.1.2" \
32
- "pyproj==3.7.2" \
33
- "pyogrio==0.13.0" \
34
- "pyarrow==25.0.0" \
35
- "packaging==26.2"
36
- ```
37
-
38
- Keep optional plotting and PostGIS packages pinned in the project lock as well.
39
- Do not mix binary geospatial packages from incompatible package channels.
40
-
41
- ## Safety and privacy contract
42
-
43
- - Treat exact coordinates, addresses, parcel boundaries, trajectories, and
44
- small-area joins as sensitive. Default reports to counts, categories, coarse
45
- extents, and redacted identifiers. Generalize before publication.
46
- - Never automatically load a URL, cloud URI, GDAL `/vsi*` path, archive, or
47
- geocode an address. Obtain explicit approval, validate provenance and hashes,
48
- then stage an unpacked local file in an isolated workspace.
49
- - GDAL/OGR drivers, GEOS, PROJ, pyogrio, Shapely, pyproj, and their wheels are a
50
- native-code trust boundary. Prefer official wheels/conda-forge, record native
51
- versions, restrict drivers, and process untrusted data in a sandbox.
52
- - Do not open macro-enabled office files or nested archives through permissive
53
- GDAL drivers. The bundled CLIs use an extension allowlist and reject archives.
54
- - Read only named database secrets such as `GEOPANDAS_POSTGIS_PASSWORD`; use a
55
- secret manager or scoped environment variable. Never embed a password in a
56
- URL or source, print an engine/URL, or dump the environment.
57
- - Every derived artifact needs source hashes/versions, CRS, operation parameters,
58
- predicate, join cardinality, precision/repair choices, and row-count checks.
59
-
60
- ## Correctness gates
61
-
62
- Apply these gates before trusting a result:
63
-
64
- 1. **Identity and provenance** — identify the source layer, stable feature key,
65
- duplicate IDs, row count, geometry column, parser/driver, and content hash.
66
- 2. **Geometry state** — count null, empty, invalid, mixed, Z/M, and collapsed
67
- geometries separately. `None` is missing; an empty Shapely geometry is real.
68
- 3. **CRS semantics** — require CRS metadata. `set_crs()` assigns metadata;
69
- `to_crs()` transforms coordinates. Never guess a CRS from coordinate ranges.
70
- 4. **Units and operation** — GeoPandas is planar. Geographic coordinates are
71
- angular; do not use them directly for buffer, distance, area, nearest joins,
72
- precision grids, or tolerances. Choose a fit-for-purpose local/equal-area CRS
73
- or a geodesic method.
74
- 5. **Transform quality** — inspect axis order, area of use, datum pipeline,
75
- expected accuracy, ballpark status, and missing grids. Keep PROJ network
76
- disabled unless the user explicitly approves grid retrieval.
77
- 6. **Topology and precision** — validate before and after repair/overlay. Pick a
78
- precision grid from source accuracy and CRS units; arbitrary snapping can
79
- collapse features or create bias.
80
- 7. **Cardinality** — state expected one-to-one, one-to-many, or many-to-many
81
- behavior before `merge`, `sjoin`, or `sjoin_nearest`; audit unmatched and
82
- multiplied rows afterward.
83
- 8. **Output contract** — use a new output path, preserve a stable feature ID,
84
- document schema/CRS/encoding, reopen the artifact, and compare counts/types.
85
-
86
- ## CRS and antimeridian rules
87
-
88
- GeoPandas stores CRS as `pyproj.CRS`. Coordinate arrays use traditional GIS
89
- `(x, y)` order, while authority definitions can advertise latitude-first axes.
90
- Use `Transformer(..., always_xy=True)` for explicit coordinate-array pipelines,
91
- and record that choice.
92
-
93
- `to_crs()` transforms vertices and assumes each segment is straight in the
94
- source CRS; it does not transform geodesic arcs. Geometries crossing ±180° or a
95
- projection boundary can be badly wrapped. Detect crossings, split/unwrap and
96
- densify in a documented geographic representation, transform parts, then
97
- validate. Do not use Web Mercator as a general measurement CRS.
98
-
99
- ```python
100
- crs = gdf.crs # a pyproj.CRS when present
101
- if crs is None or crs.is_geographic:
102
- raise ValueError("Choose a justified projected CRS before planar measurement")
103
-
104
- unit_names = [axis.unit_name for axis in crs.axis_info]
105
- areas = gdf.geometry.area # square CRS units, not automatically square metres
106
- ```
107
-
108
- See [CRS management](references/crs-management.md).
109
-
110
- ## Core API decisions
111
-
112
- ### Data structures
113
-
114
- - A `GeoDataFrame` can hold multiple geometry columns, each with CRS metadata,
115
- but only `active_geometry_name` drives frame-level spatial operations.
116
- - Binary `GeoSeries` methods are row-wise and align by index by default. Use
117
- `align=False` only when positional pairing is explicitly intended and lengths
118
- and order were verified.
119
- - Duplicate column names and duplicate feature IDs are ambiguous; reject or
120
- resolve them before joins and exports.
121
-
122
- See [data structures](references/data-structures.md).
123
-
124
- ### Geometry validity, precision, and union
125
-
126
- Use `is_valid` and redacted `is_valid_reason()` categories before
127
- `make_valid(method="linework"|"structure", keep_collapsed=...)`. Repair can
128
- change geometry type or dimension; retain the original and compare counts,
129
- area, types, empties, and collapsed parts.
130
-
131
- `set_precision(grid_size, mode=...)` uses **CRS units** and may remove duplicate
132
- vertices or collapse features. `union_all(method="unary", grid_size=...)` is the
133
- robust default. Use `coverage` only after `is_valid_coverage()` proves
134
- non-overlap and edge matching; use `disjoint_subset` with Shapely >=2.1 when its
135
- partitioning assumption is useful.
136
-
137
- See [geometric operations](references/geometric-operations.md).
138
-
139
- ### Joins, overlay, clip, and dissolve
140
-
141
- - `sjoin` predicates are directional: `left.within(right)` is not
142
- `left.contains(right)`. `intersects` includes boundary contact; `contains`
143
- excludes boundary-only points, while `covers` includes boundary points.
144
- - `predicate="dwithin"` requires `distance`; scalar or per-left-row distances
145
- are in CRS units. `sjoin_nearest` returns all equidistant nearest matches and
146
- does **not** implement a `k=` parameter.
147
- - `overlay(..., make_valid=True)` repairs invalid input but can change types;
148
- `keep_geom_type=None` drops other types with a warning. Precision mismatch can
149
- create slivers; quantify them rather than silently deleting them.
150
- - `clip` dissolves the mask. Rectangle clipping is fast but possibly dirty and
151
- may omit a line collapsed to a point; validate its output.
152
- - `dissolve` combines `groupby.agg` with `union_all`; choose explicit attribute
153
- aggregations and audit null group keys.
154
-
155
- See [spatial analysis](references/spatial-analysis.md).
156
-
157
- ### I/O, Arrow, and PostGIS
158
-
159
- GeoPandas 1.x defaults to pyogrio. Driver availability and semantics come from
160
- the installed GDAL, not GeoPandas alone. Prefer local GeoPackage for general
161
- interchange and WKB GeoParquet for columnar interoperability.
162
-
163
- GeoParquet defaults to stable schema 1.0.0. Native GeoArrow encodings and bbox
164
- covering require schema 1.1.0 and remain less interoperable. A missing GeoParquet
165
- `crs` key means `OGC:CRS84`; explicit `crs: null` means unknown—do not conflate
166
- them. Reopen and validate every export.
167
-
168
- Use parameterized SQL and a SQLAlchemy `Engine`/`Connection` for PostGIS.
169
- `if_exists="replace"` is destructive; default to `"fail"` and use a transaction.
170
-
171
- See [data I/O](references/data-io.md).
172
-
173
- ## Migration checklist
174
-
175
- For code moving from GeoPandas 0.14 or earlier:
176
-
177
- - GeoPandas 1.0 supports Shapely >=2 only; PyGEOS, Shapely <2, and the rtree
178
- spatial-index backend were removed.
179
- - pyogrio replaced Fiona as the installed/default I/O engine. Set `engine=`
180
- explicitly and test schema, empty, datetime, encoding, and append behavior.
181
- - Replace `sjoin(op=...)` with `predicate=`, `sindex.query_bulk()` with
182
- `sindex.query()`, `unary_union` with `union_all()`, and
183
- `GeometryArray.data` with `to_numpy()`/`np.asarray`.
184
- - Replace `read_file(include_fields=...|ignore_fields=...)` with `columns=`.
185
- Use `schema_version=`, not the removed GeoParquet `version=` compatibility.
186
- - Do not use removed `geopandas.datasets`, internal `geopandas.io.*` entry
187
- points, plot `axes`/`colormap`, or set-operation operators.
188
- - `explode()` now defaults `index_parts=False`; a named Series passed to
189
- `set_geometry()` supplies the new active-column name; a named right index can
190
- replace `index_right` in `sjoin` output.
191
- - Do not assign `.crs` to override metadata or rely on deprecated
192
- `set_geometry(drop=...)`; use explicit `set_crs()` and rename/drop steps.
193
- - GeoPandas 1.1 requires Python >=3.10, pandas >=2.0, NumPy >=1.24, and pyproj
194
- >=3.5. Version 1.1.2 fixed SQL injection through a PostGIS geometry-column
195
- name; the pinned 1.1.4 includes that fix.
196
-
197
- ### Plotting and exploration
198
-
199
- Maps are analytical outputs: label units, classification method, missing data,
200
- normalization denominator, and date. `explore()` can expose every attribute in
201
- tooltips/popups and contact tile/CDN servers; generalize first and use
202
- `tiles=None`, `tooltip=False`, and `popup=False` for a local draft.
203
-
204
- See [visualization](references/visualization.md).
205
-
206
- ## Bundled local CLIs
207
-
208
- All helpers are deterministic, reject network/archive paths, bound input bytes
209
- and feature counts, keep imports lazy so `--help` is dependency-free, and emit
210
- JSON without coordinates or record identifiers.
211
-
212
- | CLI | Purpose |
213
- |---|---|
214
- | `scripts/vector_inventory.py` | Redacted local vector/GeoParquet technical inventory |
215
- | `scripts/crs_reprojection_plan.py` | CRS units, axes, candidate transform and antimeridian plan |
216
- | `scripts/geometry_validity_report.py` | Dry-run validity audit; optional repair to a new GeoPackage |
217
- | `scripts/spatial_join_audit.py` | Predicate semantics, duplicate IDs and join cardinality |
218
- | `scripts/export_plan.py` | Non-executing vector/GeoParquet export contract |
219
- | `scripts/sensitive_coordinates_checklist.py` | Privacy/generalization release gate |
220
-
221
- ```bash
222
- python skills/geopandas/scripts/vector_inventory.py --help
223
- python skills/geopandas/scripts/crs_reprojection_plan.py \
224
- --source-crs EPSG:4326 --target-crs EPSG:32631
225
- python skills/geopandas/scripts/geometry_validity_report.py data.gpkg
226
- python skills/geopandas/scripts/spatial_join_audit.py points.gpkg zones.gpkg \
227
- --predicate within --left-id point_id --right-id zone_id
228
- python skills/geopandas/scripts/export_plan.py data.gpkg result.parquet \
229
- --format geoparquet --schema-version 1.0.0 \
230
- --stable-id-column feature_id --id-unique-verified
231
- python skills/geopandas/scripts/sensitive_coordinates_checklist.py \
232
- --public-output --precise-points --contains-addresses
233
- ```
234
-
235
- ## Reference index
236
-
237
- - [Data structures](references/data-structures.md)
238
- - [CRS management](references/crs-management.md)
239
- - [Geometric operations](references/geometric-operations.md)
240
- - [Spatial analysis](references/spatial-analysis.md)
241
- - [Data I/O](references/data-io.md)
242
- - [Visualization](references/visualization.md)
243
-
244
- ## Sources (verified 2026-07-23)
245
-
246
- - [GeoPandas 1.1.4 on PyPI](https://pypi.org/project/geopandas/1.1.4/) — released 2026-06-26.
247
- - [GeoPandas 1.1.4 release](https://github.com/geopandas/geopandas/releases/tag/v1.1.4) — bug-fix release.
248
- - [GeoPandas 1.1.4 tagged dependencies](https://github.com/geopandas/geopandas/blob/v1.1.4/pyproject.toml).
249
- - [Stable GeoPandas documentation](https://geopandas.org/en/stable/).
250
- - [GeoPandas 1.0 migration release](https://github.com/geopandas/geopandas/releases/tag/v1.0.0).