[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M735JSP7V2X1H6RGSJKVD259":3,"skill-same:01M735JSP7V2X1H6RGSJKVD259":107},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":33,"ownerDescription":6,"updatedAt":34,"install":35,"resources":48},"01M735JSP7V2X1H6RGSJKVD259","alterlab-geomaster",null,"Part of the AlterLab Academic Skills suite. 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.","roohe\u002Fagentic-super-skills","roohe","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99054084?v=4","01M734WCDFP6RZVT5CNM00QR26","01M734WCE4BD0T4NZS5PCV9V5F",10,"MIT","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Falterlab-geomaster\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: alterlab-geomaster\ndescription: Part of the AlterLab Academic Skills suite. 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.\nlicense: MIT License\nmetadata:\n    skill-author: AlterLab\n    version: \"1.0.0\"\n---\n\n# GeoMaster\n\nComprehensive 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.\n\n## Installation\n\n```bash\n# Core Python stack (conda recommended)\nconda install -c conda-forge gdal rasterio fiona shapely pyproj geopandas\n\n# Remote sensing & ML\nuv pip install rsgislib torchgeo earthengine-api\nuv pip install scikit-learn xgboost torch-geometric\n\n# Network & visualization\nuv pip install osmnx networkx folium keplergl\nuv pip install cartopy contextily mapclassify\n\n# Big data & cloud\nuv pip install xarray rioxarray dask-geopandas\nuv pip install pystac-client planetary-computer\n\n# Point clouds\nuv pip install laspy pylas open3d pdal\n\n# Databases\nconda install -c conda-forge postgis spatialite\n```\n\n## Quick Start\n\n### NDVI from Sentinel-2\n\n```python\nimport rasterio\nimport numpy as np\n\nwith rasterio.open('sentinel2.tif') as src:\n    red = src.read(4).astype(float)   # B04\n    nir = src.read(8).astype(float)   # B08\n    ndvi = (nir - red) \u002F (nir + red + 1e-8)\n    ndvi = np.nan_to_num(ndvi, nan=0)\n\n    profile = src.profile\n    profile.update(count=1, dtype=rasterio.float32)\n\n    with rasterio.open('ndvi.tif', 'w', **profile) as dst:\n        dst.write(ndvi.astype(rasterio.float32), 1)\n```\n\n### Spatial Analysis with GeoPandas\n\n```python\nimport geopandas as gpd\n\n# Load and ensure same CRS\nzones = gpd.read_file('zones.geojson')\npoints = gpd.read_file('points.geojson')\n\nif zones.crs != points.crs:\n    points = points.to_crs(zones.crs)\n\n# Spatial join and statistics\njoined = gpd.sjoin(points, zones, how='inner', predicate='within')\nstats = joined.groupby('zone_id').agg({\n    'value': ['count', 'mean', 'std', 'min', 'max']\n}).round(2)\n```\n\n### Google Earth Engine Time Series\n\n```python\nimport ee\nimport pandas as pd\n\nee.Initialize(project='your-project')\nroi = ee.Geometry.Point([-122.4, 37.7]).buffer(10000)\n\ns2 = (ee.ImageCollection('COPERNICUS\u002FS2_SR_HARMONIZED')\n      .filterBounds(roi)\n      .filterDate('2020-01-01', '2023-12-31')\n      .filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 20)))\n\ndef add_ndvi(img):\n    return img.addBands(img.normalizedDifference(['B8', 'B4']).rename('NDVI'))\n\ns2_ndvi = s2.map(add_ndvi)\n\ndef extract_series(image):\n    stats = image.reduceRegion(ee.Reducer.mean(), roi.centroid(), scale=10, maxPixels=1e9)\n    return ee.Feature(None, {'date': image.date().format('YYYY-MM-dd'), 'ndvi': stats.get('NDVI')})\n\nseries = s2_ndvi.map(extract_series).getInfo()\ndf = pd.DataFrame([f['properties'] for f in series['features']])\ndf['date'] = pd.to_datetime(df['date'])\n```\n\n## Core Concepts\n\n### Data Types\n\n| Type | Examples | Libraries |\n|------|----------|-----------|\n| Vector | Shapefile, GeoJSON, GeoPackage | GeoPandas, Fiona, GDAL |\n| Raster | GeoTIFF, NetCDF, COG | Rasterio, Xarray, GDAL |\n| Point Cloud | LAS, LAZ | Laspy, PDAL, Open3D |\n\n### Coordinate Systems\n\n- **EPSG:4326** (WGS 84) - Geographic, lat\u002Flon, use for storage\n- **EPSG:3857** (Web Mercator) - Web maps only (don't use for area\u002Fdistance!)\n- **EPSG:326xx\u002F327xx** (UTM) - Metric calculations, \u003C1% distortion per zone\n- Use `gdf.estimate_utm_crs()` for automatic UTM detection\n\n```python\n# Always check CRS before operations\nassert gdf1.crs == gdf2.crs, \"CRS mismatch!\"\n\n# For area\u002Fdistance calculations, use projected CRS\ngdf_metric = gdf.to_crs(gdf.estimate_utm_crs())\narea_sqm = gdf_metric.geometry.area\n```\n\n### OGC Standards\n\n- **WMS**: Web Map Service - raster maps\n- **WFS**: Web Feature Service - vector data\n- **WCS**: Web Coverage Service - raster coverage\n- **STAC**: Spatiotemporal Asset Catalog - modern metadata\n\n## Common Operations\n\n### Spectral Indices\n\n```python\ndef calculate_indices(image_path):\n    \"\"\"NDVI, EVI, SAVI, NDWI from Sentinel-2.\"\"\"\n    with rasterio.open(image_path) as src:\n        B02, B03, B04, B08, B11 = [src.read(i).astype(float) for i in [1,2,3,4,5]]\n\n    ndvi = (B08 - B04) \u002F (B08 + B04 + 1e-8)\n    evi = 2.5 * (B08 - B04) \u002F (B08 + 6*B04 - 7.5*B02 + 1)\n    savi = ((B08 - B04) \u002F (B08 + B04 + 0.5)) * 1.5\n    ndwi = (B03 - B08) \u002F (B03 + B08 + 1e-8)\n\n    return {'NDVI': ndvi, 'EVI': evi, 'SAVI': savi, 'NDWI': ndwi}\n```\n\n### Vector Operations\n\n```python\n# Buffer (use projected CRS!)\ngdf_proj = gdf.to_crs(gdf.estimate_utm_crs())\ngdf['buffer_1km'] = gdf_proj.geometry.buffer(1000)\n\n# Spatial relationships\nintersects = gdf[gdf.geometry.intersects(other_geometry)]\ncontains = gdf[gdf.geometry.contains(point_geometry)]\n\n# Geometric operations\ngdf['centroid'] = gdf.geometry.centroid\ngdf['simplified'] = gdf.geometry.simplify(tolerance=0.001)\n\n# Overlay operations\nintersection = gpd.overlay(gdf1, gdf2, how='intersection')\nunion = gpd.overlay(gdf1, gdf2, how='union')\n```\n\n### Terrain Analysis\n\n```python\ndef terrain_metrics(dem_path):\n    \"\"\"Calculate slope, aspect, hillshade from DEM.\"\"\"\n    with rasterio.open(dem_path) as src:\n        dem = src.read(1)\n\n    dy, dx = np.gradient(dem)\n    slope = np.arctan(np.sqrt(dx**2 + dy**2)) * 180 \u002F np.pi\n    aspect = (90 - np.arctan2(-dy, dx) * 180 \u002F np.pi) % 360\n\n    # Hillshade\n    az_rad, alt_rad = np.radians(315), np.radians(45)\n    hillshade = (np.sin(alt_rad) * np.sin(np.radians(slope)) +\n                 np.cos(alt_rad) * np.cos(np.radians(slope)) *\n                 np.cos(np.radians(aspect) - az_rad))\n\n    return slope, aspect, hillshade\n```\n\n### Network Analysis\n\n```python\nimport osmnx as ox\nimport networkx as nx\n\n# Download and analyze street network\nG = ox.graph_from_place('San Francisco, CA', network_type='drive')\nG = ox.add_edge_speeds(G).add_edge_travel_times(G)\n\n# Shortest path\norig = ox.distance.nearest_nodes(G, -122.4, 37.7)\ndest = ox.distance.nearest_nodes(G, -122.3, 37.8)\nroute = nx.shortest_path(G, orig, dest, weight='travel_time')\n```\n\n## Image Classification\n\n```python\nfrom sklearn.ensemble import RandomForestClassifier\nimport rasterio\nfrom rasterio.features import rasterize\n\ndef classify_imagery(raster_path, training_gdf, output_path):\n    \"\"\"Train RF and classify imagery.\"\"\"\n    with rasterio.open(raster_path) as src:\n        image = src.read()\n        profile = src.profile\n        transform = src.transform\n\n    # Extract training data\n    X_train, y_train = [], []\n    for _, row in training_gdf.iterrows():\n        mask = rasterize([(row.geometry, 1)],\n                        out_shape=(profile['height'], profile['width']),\n                        transform=transform, fill=0, dtype=np.uint8)\n        pixels = image[:, mask > 0].T\n        X_train.extend(pixels)\n        y_train.extend([row['class_id']] * len(pixels))\n\n    # Train and predict\n    rf = RandomForestClassifier(n_estimators=100, max_depth=20, n_jobs=-1)\n    rf.fit(X_train, y_train)\n\n    prediction = rf.predict(image.reshape(image.shape[0], -1).T)\n    prediction = prediction.reshape(profile['height'], profile['width'])\n\n    profile.update(dtype=rasterio.uint8, count=1)\n    with rasterio.open(output_path, 'w', **profile) as dst:\n        dst.write(prediction.astype(rasterio.uint8), 1)\n\n    return rf\n```\n\n## Modern Cloud-Native Workflows\n\n### STAC + Planetary Computer\n\n```python\nimport pystac_client\nimport planetary_computer\nimport odc.stac\n\n# Search Sentinel-2 via STAC\ncatalog = pystac_client.Client.open(\n    \"https:\u002F\u002Fplanetarycomputer.microsoft.com\u002Fapi\u002Fstac\u002Fv1\",\n    modifier=planetary_computer.sign_inplace,\n)\n\nsearch = catalog.search(\n    collections=[\"sentinel-2-l2a\"],\n    bbox=[-122.5, 37.7, -122.3, 37.9],\n    datetime=\"2023-01-01\u002F2023-12-31\",\n    query={\"eo:cloud_cover\": {\"lt\": 20}},\n)\n\n# Load as xarray (cloud-native!)\ndata = odc.stac.load(\n    list(search.get_items())[:5],\n    bands=[\"B02\", \"B03\", \"B04\", \"B08\"],\n    crs=\"EPSG:32610\",\n    resolution=10,\n)\n\n# Calculate NDVI on xarray\nndvi = (data.B08 - data.B04) \u002F (data.B08 + data.B04)\n```\n\n### Cloud-Optimized GeoTIFF (COG)\n\n```python\nimport rasterio\nfrom rasterio.session import AWSSession\n\n# Read COG directly from cloud (partial reads)\nsession = AWSSession(aws_access_key_id=..., aws_secret_access_key=...)\nwith rasterio.open('s3:\u002F\u002Fbucket\u002Fpath.tif', session=session) as src:\n    # Read only window of interest\n    window = ((1000, 2000), (1000, 2000))\n    subset = src.read(1, window=window)\n\n# Write COG\nwith rasterio.open('output.tif', 'w', **profile,\n                   tiled=True, blockxsize=256, blockysize=256,\n                   compress='DEFLATE', predictor=2) as dst:\n    dst.write(data)\n\n# Validate COG\nfrom rio_cogeo.cogeo import cog_validate\ncog_validate('output.tif')\n```\n\n## Performance Tips\n\n```python\n# 1. Spatial indexing (10-100x faster queries)\ngdf.sindex  # Auto-created by GeoPandas\n\n# 2. Chunk large rasters\nwith rasterio.open('large.tif') as src:\n    for i, window in src.block_windows(1):\n        block = src.read(1, window=window)\n\n# 3. Dask for big data\nimport dask.array as da\ndask_array = da.from_rasterio('large.tif', chunks=(1, 1024, 1024))\n\n# 4. Use Arrow for I\u002FO\ngdf.to_file('output.gpkg', use_arrow=True)\n\n# 5. GDAL caching\nfrom osgeo import gdal\ngdal.SetCacheMax(2**30)  # 1GB cache\n\n# 6. Parallel processing\nrf = RandomForestClassifier(n_jobs=-1)  # All cores\n```\n\n## Best Practices\n\n1. **Always check CRS** before spatial operations\n2. **Use projected CRS** for area\u002Fdistance calculations\n3. **Validate geometries**: `gdf = gdf[gdf.is_valid]`\n4. **Handle missing data**: `gdf['geometry'] = gdf['geometry'].fillna(None)`\n5. **Use efficient formats**: GeoPackage > Shapefile, Parquet for large data\n6. **Apply cloud masking** to optical imagery\n7. **Preserve lineage** for reproducible research\n8. **Use appropriate resolution** for your analysis scale\n\n## Detailed Documentation\n\n- **[Coordinate Systems](references\u002Fcoordinate-systems.md)** - CRS fundamentals, UTM, transformations\n- **[Core Libraries](references\u002Fcore-libraries.md)** - GDAL, Rasterio, GeoPandas, Shapely\n- **[Remote Sensing](references\u002Fremote-sensing.md)** - Satellite missions, spectral indices, SAR\n- **[Machine Learning](references\u002Fmachine-learning.md)** - Deep learning, CNNs, GNNs for RS\n- **[GIS Software](references\u002Fgis-software.md)** - QGIS, ArcGIS, GRASS integration\n- **[Scientific Domains](references\u002Fscientific-domains.md)** - Marine, hydrology, agriculture, forestry\n- **[Advanced GIS](references\u002Fadvanced-gis.md)** - 3D GIS, spatiotemporal, topology\n- **[Big Data](references\u002Fbig-data.md)** - Distributed processing, GPU acceleration\n- **[Industry Applications](references\u002Findustry-applications.md)** - Urban planning, disaster management\n- **[Programming Languages](references\u002Fprogramming-languages.md)** - Python, R, Julia, JS, C++, Java, Go, Rust\n- **[Data Sources](references\u002Fdata-sources.md)** - Satellite catalogs, APIs\n- **[Troubleshooting](references\u002Ftroubleshooting.md)** - Common issues, debugging, error reference\n- **[Code Examples](references\u002Fcode-examples.md)** - 500+ examples\n\n---\n\n**GeoMaster covers everything from basic GIS operations to advanced remote sensing and machine learning.**\n","# GeoMaster\n\nComprehensive 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.\n\n## Installation\n\n```bash\n# Core Python stack (conda recommended)\nconda install -c conda-forge gdal rasterio fiona shapely pyproj geopandas\n\n# Remote sensing & ML\nuv pip install rsgislib torchgeo earthengine-api\nuv pip install scikit-learn xgboost torch-geometric\n\n# Network & visualization\nuv pip install osmnx networkx folium keplergl\nuv pip install cartopy contextily mapclassify\n\n# Big data & cloud\nuv pip install xarray rioxarray dask-geopandas\nuv pip install pystac-client planetary-computer\n\n# Point clouds\nuv pip install laspy pylas open3d pdal\n\n# Databases\nconda install -c conda-forge postgis spatialite\n```\n\n## Quick Start\n\n### NDVI from Sentinel-2\n\n```python\nimport rasterio\nimport numpy as np\n\nwith rasterio.open('sentinel2.tif') as src:\n    red = src.read(4).astype(float)   # B04\n    nir = src.read(8).astype(float)   # B08\n    ndvi = (nir - red) \u002F (nir + red + 1e-8)\n    ndvi = np.nan_to_num(ndvi, nan=0)\n\n    profile = src.profile\n    profile.update(count=1, dtype=rasterio.float32)\n\n    with rasterio.open('ndvi.tif', 'w', **profile) as dst:\n        dst.write(ndvi.astype(rasterio.float32), 1)\n```\n\n### Spatial Analysis with GeoPandas\n\n```python\nimport geopandas as gpd\n\n# Load and ensure same CRS\nzones = gpd.read_file('zones.geojson')\npoints = gpd.read_file('points.geojson')\n\nif zones.crs != points.crs:\n    points = points.to_crs(zones.crs)\n\n# Spatial join and statistics\njoined = gpd.sjoin(points, zones, how='inner', predicate='within')\nstats = joined.groupby('zone_id').agg({\n    'value': ['count', 'mean', 'std', 'min', 'max']\n}).round(2)\n```\n\n### Google Earth Engine Time Series\n\n```python\nimport ee\nimport pandas as pd\n\nee.Initialize(project='your-project')\nroi = ee.Geometry.Point([-122.4, 37.7]).buffer(10000)\n\ns2 = (ee.ImageCollection('COPERNICUS\u002FS2_SR_HARMONIZED')\n      .filterBounds(roi)\n      .filterDate('2020-01-01', '2023-12-31')\n      .filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 20)))\n\ndef add_ndvi(img):\n    return img.addBands(img.normalizedDifference(['B8', 'B4']).rename('NDVI'))\n\ns2_ndvi = s2.map(add_ndvi)\n\ndef extract_series(image):\n    stats = image.reduceRegion(ee.Reducer.mean(), roi.centroid(), scale=10, maxPixels=1e9)\n    return ee.Feature(None, {'date': image.date().format('YYYY-MM-dd'), 'ndvi': stats.get('NDVI')})\n\nseries = s2_ndvi.map(extract_series).getInfo()\ndf = pd.DataFrame([f['properties'] for f in series['features']])\ndf['date'] = pd.to_datetime(df['date'])\n```\n\n## Core Concepts\n\n### Data Types\n\n| Type | Examples | Libraries |\n|------|----------|-----------|\n| Vector | Shapefile, GeoJSON, GeoPackage | GeoPandas, Fiona, GDAL |\n| Raster | GeoTIFF, NetCDF, COG | Rasterio, Xarray, GDAL |\n| Point Cloud | LAS, LAZ | Laspy, PDAL, Open3D |\n\n### Coordinate Systems\n\n- **EPSG:4326** (WGS 84) - Geographic, lat\u002Flon, use for storage\n- **EPSG:3857** (Web Mercator) - Web maps only (don't use for area\u002Fdistance!)\n- **EPSG:326xx\u002F327xx** (UTM) - Metric calculations, \u003C1% distortion per zone\n- Use `gdf.estimate_utm_crs()` for automatic UTM detection\n\n```python\n# Always check CRS before operations\nassert gdf1.crs == gdf2.crs, \"CRS mismatch!\"\n\n# For area\u002Fdistance calculations, use projected CRS\ngdf_metric = gdf.to_crs(gdf.estimate_utm_crs())\narea_sqm = gdf_metric.geometry.area\n```\n\n### OGC Standards\n\n- **WMS**: Web Map Service - raster maps\n- **WFS**: Web Feature Service - vector data\n- **WCS**: Web Coverage Service - raster coverage\n- **STAC**: Spatiotemporal Asset Catalog - modern metadata\n\n## Common Operations\n\n### Spectral Indices\n\n```python\ndef calculate_indices(image_path):\n    \"\"\"NDVI, EVI, SAVI, NDWI from Sentinel-2.\"\"\"\n    with rasterio.open(image_path) as src:\n        B02, B03, B04, B08, B11 = [src.read(i).astype(float) for i in [1,2,3,4,5]]\n\n    ndvi = (B08 - B04) \u002F (B08 + B04 + 1e-8)\n    evi = 2.5 * (B08 - B04) \u002F (B08 + 6*B04 - 7.5*B02 + 1)\n    savi = ((B08 - B04) \u002F (B08 + B04 + 0.5)) * 1.5\n    ndwi = (B03 - B08) \u002F (B03 + B08 + 1e-8)\n\n    return {'NDVI': ndvi, 'EVI': evi, 'SAVI': savi, 'NDWI': ndwi}\n```\n\n### Vector Operations\n\n```python\n# Buffer (use projected CRS!)\ngdf_proj = gdf.to_crs(gdf.estimate_utm_crs())\ngdf['buffer_1km'] = gdf_proj.geometry.buffer(1000)\n\n# Spatial relationships\nintersects = gdf[gdf.geometry.intersects(other_geometry)]\ncontains = gdf[gdf.geometry.contains(point_geometry)]\n\n# Geometric operations\ngdf['centroid'] = gdf.geometry.centroid\ngdf['simplified'] = gdf.geometry.simplify(tolerance=0.001)\n\n# Overlay operations\nintersection = gpd.overlay(gdf1, gdf2, how='intersection')\nunion = gpd.overlay(gdf1, gdf2, how='union')\n```\n\n### Terrain Analysis\n\n```python\ndef terrain_metrics(dem_path):\n    \"\"\"Calculate slope, aspect, hillshade from DEM.\"\"\"\n    with rasterio.open(dem_path) as src:\n        dem = src.read(1)\n\n    dy, dx = np.gradient(dem)\n    slope = np.arctan(np.sqrt(dx**2 + dy**2)) * 180 \u002F np.pi\n    aspect = (90 - np.arctan2(-dy, dx) * 180 \u002F np.pi) % 360\n\n    # Hillshade\n    az_rad, alt_rad = np.radians(315), np.radians(45)\n    hillshade = (np.sin(alt_rad) * np.sin(np.radians(slope)) +\n                 np.cos(alt_rad) * np.cos(np.radians(slope)) *\n                 np.cos(np.radians(aspect) - az_rad))\n\n    return slope, aspect, hillshade\n```\n\n### Network Analysis\n\n```python\nimport osmnx as ox\nimport networkx as nx\n\n# Download and analyze street network\nG = ox.graph_from_place('San Francisco, CA', network_type='drive')\nG = ox.add_edge_speeds(G).add_edge_travel_times(G)\n\n# Shortest path\norig = ox.distance.nearest_nodes(G, -122.4, 37.7)\ndest = ox.distance.nearest_nodes(G, -122.3, 37.8)\nroute = nx.shortest_path(G, orig, dest, weight='travel_time')\n```\n\n## Image Classification\n\n```python\nfrom sklearn.ensemble import RandomForestClassifier\nimport rasterio\nfrom rasterio.features import rasterize\n\ndef classify_imagery(raster_path, training_gdf, output_path):\n    \"\"\"Train RF and classify imagery.\"\"\"\n    with rasterio.open(raster_path) as src:\n        image = src.read()\n        profile = src.profile\n        transform = src.transform\n\n    # Extract training data\n    X_train, y_train = [], []\n    for _, row in training_gdf.iterrows():\n        mask = rasterize([(row.geometry, 1)],\n                        out_shape=(profile['height'], profile['width']),\n                        transform=transform, fill=0, dtype=np.uint8)\n        pixels = image[:, mask > 0].T\n        X_train.extend(pixels)\n        y_train.extend([row['class_id']] * len(pixels))\n\n    # Train and predict\n    rf = RandomForestClassifier(n_estimators=100, max_depth=20, n_jobs=-1)\n    rf.fit(X_train, y_train)\n\n    prediction = rf.predict(image.reshape(image.shape[0], -1).T)\n    prediction = prediction.reshape(profile['height'], profile['width'])\n\n    profile.update(dtype=rasterio.uint8, count=1)\n    with rasterio.open(output_path, 'w', **profile) as dst:\n        dst.write(prediction.astype(rasterio.uint8), 1)\n\n    return rf\n```\n\n## Modern Cloud-Native Workflows\n\n### STAC + Planetary Computer\n\n```python\nimport pystac_client\nimport planetary_computer\nimport odc.stac\n\n# Search Sentinel-2 via STAC\ncatalog = pystac_client.Client.open(\n    \"https:\u002F\u002Fplanetarycomputer.microsoft.com\u002Fapi\u002Fstac\u002Fv1\",\n    modifier=planetary_computer.sign_inplace,\n)\n\nsearch = catalog.search(\n    collections=[\"sentinel-2-l2a\"],\n    bbox=[-122.5, 37.7, -122.3, 37.9],\n    datetime=\"2023-01-01\u002F2023-12-31\",\n    query={\"eo:cloud_cover\": {\"lt\": 20}},\n)\n\n# Load as xarray (cloud-native!)\ndata = odc.stac.load(\n    list(search.get_items())[:5],\n    bands=[\"B02\", \"B03\", \"B04\", \"B08\"],\n    crs=\"EPSG:32610\",\n    resolution=10,\n)\n\n# Calculate NDVI on xarray\nndvi = (data.B08 - data.B04) \u002F (data.B08 + data.B04)\n```\n\n### Cloud-Optimized GeoTIFF (COG)\n\n```python\nimport rasterio\nfrom rasterio.session import AWSSession\n\n# Read COG directly from cloud (partial reads)\nsession = AWSSession(aws_access_key_id=..., aws_secret_access_key=...)\nwith rasterio.open('s3:\u002F\u002Fbucket\u002Fpath.tif', session=session) as src:\n    # Read only window of interest\n    window = ((1000, 2000), (1000, 2000))\n    subset = src.read(1, window=window)\n\n# Write COG\nwith rasterio.open('output.tif', 'w', **profile,\n                   tiled=True, blockxsize=256, blockysize=256,\n                   compress='DEFLATE', predictor=2) as dst:\n    dst.write(data)\n\n# Validate COG\nfrom rio_cogeo.cogeo import cog_validate\ncog_validate('output.tif')\n```\n\n## Performance Tips\n\n```python\n# 1. Spatial indexing (10-100x faster queries)\ngdf.sindex  # Auto-created by GeoPandas\n\n# 2. Chunk large rasters\nwith rasterio.open('large.tif') as src:\n    for i, window in src.block_windows(1):\n        block = src.read(1, window=window)\n\n# 3. Dask for big data\nimport dask.array as da\ndask_array = da.from_rasterio('large.tif', chunks=(1, 1024, 1024))\n\n# 4. Use Arrow for I\u002FO\ngdf.to_file('output.gpkg', use_arrow=True)\n\n# 5. GDAL caching\nfrom osgeo import gdal\ngdal.SetCacheMax(2**30)  # 1GB cache\n\n# 6. Parallel processing\nrf = RandomForestClassifier(n_jobs=-1)  # All cores\n```\n\n## Best Practices\n\n1. **Always check CRS** before spatial operations\n2. **Use projected CRS** for area\u002Fdistance calculations\n3. **Validate geometries**: `gdf = gdf[gdf.is_valid]`\n4. **Handle missing data**: `gdf['geometry'] = gdf['geometry'].fillna(None)`\n5. **Use efficient formats**: GeoPackage > Shapefile, Parquet for large data\n6. **Apply cloud masking** to optical imagery\n7. **Preserve lineage** for reproducible research\n8. **Use appropriate resolution** for your analysis scale\n\n## Detailed Documentation\n\n- **[Coordinate Systems](references\u002Fcoordinate-systems.md)** - CRS fundamentals, UTM, transformations\n- **[Core Libraries](references\u002Fcore-libraries.md)** - GDAL, Rasterio, GeoPandas, Shapely\n- **[Remote Sensing](references\u002Fremote-sensing.md)** - Satellite missions, spectral indices, SAR\n- **[Machine Learning](references\u002Fmachine-learning.md)** - Deep learning, CNNs, GNNs for RS\n- **[GIS Software](references\u002Fgis-software.md)** - QGIS, ArcGIS, GRASS integration\n- **[Scientific Domains](references\u002Fscientific-domains.md)** - Marine, hydrology, agriculture, forestry\n- **[Advanced GIS](references\u002Fadvanced-gis.md)** - 3D GIS, spatiotemporal, topology\n- **[Big Data](references\u002Fbig-data.md)** - Distributed processing, GPU acceleration\n- **[Industry Applications](references\u002Findustry-applications.md)** - Urban planning, disaster management\n- **[Programming Languages](references\u002Fprogramming-languages.md)** - Python, R, Julia, JS, C++, Java, Go, Rust\n- **[Data Sources](references\u002Fdata-sources.md)** - Satellite catalogs, APIs\n- **[Troubleshooting](references\u002Ftroubleshooting.md)** - Common issues, debugging, error reference\n- **[Code Examples](references\u002Fcode-examples.md)** - 500+ examples\n\n---\n\n**GeoMaster covers everything from basic GIS operations to advanced remote sensing and machine learning.**\n",{"name":5,"license":23,"metadata":24,"description":7},"MIT License",{"version":25,"skill-author":26},"1.0.0","AlterLab","master","f483e54f3ad5f202a77d45f2e57f8d970b71195f","skills_library\u002Falterlab-geomaster",2,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills","https:\u002F\u002Fgithub.com\u002Froohe","yoou.link","2026-05-19 15:56:07",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add roohe\u002Fagentic-super-skills --skill alterlab-geomaster",{"tool":41,"command":42},"bunx","bunx skills add roohe\u002Fagentic-super-skills --skill alterlab-geomaster",{"tool":44,"command":45},"pnpm","pnpm dlx skills add roohe\u002Fagentic-super-skills --skill alterlab-geomaster","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Falterlab-geomaster\u002FSKILL.md",true,[49,55,59,63,67,71,75,79,83,87,91,95,99,103],{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"references\u002Fadvanced-gis.md","REFERENCE","参考文档",10745,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Falterlab-geomaster\u002Freferences\u002Fadvanced-gis.md",{"path":56,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Fbig-data.md",8455,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Falterlab-geomaster\u002Freferences\u002Fbig-data.md",{"path":60,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":61,"sourceHtmlUrl":62},"references\u002Fcode-examples.md",12492,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Falterlab-geomaster\u002Freferences\u002Fcode-examples.md",{"path":64,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":65,"sourceHtmlUrl":66},"references\u002Fcoordinate-systems.md",8893,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Falterlab-geomaster\u002Freferences\u002Fcoordinate-systems.md",{"path":68,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":69,"sourceHtmlUrl":70},"references\u002Fcore-libraries.md",6593,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Falterlab-geomaster\u002Freferences\u002Fcore-libraries.md",{"path":72,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Fdata-sources.md",9064,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Falterlab-geomaster\u002Freferences\u002Fdata-sources.md",{"path":76,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fgis-software.md",8915,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Falterlab-geomaster\u002Freferences\u002Fgis-software.md",{"path":80,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Findustry-applications.md",13071,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Falterlab-geomaster\u002Freferences\u002Findustry-applications.md",{"path":84,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Fmachine-learning.md",12783,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Falterlab-geomaster\u002Freferences\u002Fmachine-learning.md",{"path":88,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Fprogramming-languages.md",11024,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Falterlab-geomaster\u002Freferences\u002Fprogramming-languages.md",{"path":92,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Fremote-sensing.md",10104,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Falterlab-geomaster\u002Freferences\u002Fremote-sensing.md",{"path":96,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":97,"sourceHtmlUrl":98},"references\u002Fscientific-domains.md",10611,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Falterlab-geomaster\u002Freferences\u002Fscientific-domains.md",{"path":100,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":101,"sourceHtmlUrl":102},"references\u002Fspecialized-topics.md",10686,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Falterlab-geomaster\u002Freferences\u002Fspecialized-topics.md",{"path":104,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":105,"sourceHtmlUrl":106},"references\u002Ftroubleshooting.md",11219,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Falterlab-geomaster\u002Freferences\u002Ftroubleshooting.md",[108,115,122,129,136,143],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":18},"01M73D865CZME2FCMKA4PQM348","zarr-python","Chunked N-D arrays for cloud storage. Compressed arrays, parallel I\u002FO, S3\u002FGCS integration, NumPy\u002FDask\u002FXarray compatible, for large-scale scientific computing pipelines.","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fzarr-python\u002FSKILL.md",[],[],{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":18},"01M73D7Z64J4ABWZJD7P44XBBF","youtube-downloader","Download and process YouTube content for research. Use when: downloading competitor videos for analysis; extracting audio for podcasts; getting transcripts for content repurposing; archiving webinars; research content curation","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fyoutube-downloader\u002FSKILL.md",[],[],{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":18},"01M73D7K8778TGZV3GJFR3703D","yc-pitch-deck","Create a compelling startup pitch deck that follows the structure proven to raise billions from top investors. Master the YC and Sequoia formats that get founders funded. Use when: **Fundraising** to create investor pitch decks; **YC application** to structure your narrative; **Demo Day prep** to craft your 2-minute pitch; **Angel investors** to communicate your opportunity; **Partnership pitches** to structure compelling asks","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fyc-pitch-deck\u002FSKILL.md",[],[],{"skillNo":130,"name":131,"nameZh":6,"description":132,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":135,"publishedAt":18},"01M73D70KJSE0E8Z28YMNNRT04","x-twitter-scraper","Use when the user needs X (Twitter) data or confirmation-gated X actions through Xquik: tweet search, user lookup, follower extraction, media download, monitoring, webhooks, MCP, SDKs, posting, likes, DMs, and profile updates. Requires a Xquik API key. Never ask for X login material.","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fx-twitter-scraper\u002FSKILL.md",[],[],{"skillNo":137,"name":138,"nameZh":6,"description":139,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":140,"categories":141,"keywords":142,"publishedAt":18},"01M73D6ED01GV077R7K4NZNFZJ","write-vignette","Create R package vignettes using R Markdown or Quarto. Covers vignette setup, YAML configuration, code chunk options, building and testing, and CRAN requirements for vignettes. Use when adding a Getting Started tutorial, documenting complex workflows spanning multiple functions, creating domain-specific guides, or when CRAN submission requires user-facing documentation beyond function help pages.","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fwrite-vignette\u002FSKILL.md",[],[],{"skillNo":144,"name":145,"nameZh":6,"description":146,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":147,"categories":148,"keywords":149,"publishedAt":18},"01M73D69YJR0BK3NFHE0CYG3EF","write-validation-documentation","Write IQ\u002FOQ\u002FPQ validation documentation for computerized systems in regulated environments. Covers protocols, reports, test scripts, deviation handling, and approval workflows. Use when validating R or other software for regulated use, preparing for a regulatory audit, documenting qualification of computing environments, or creating and updating validation protocols and reports for new or re-qualified systems.","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fwrite-validation-documentation\u002FSKILL.md",[],[]]