[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CYB125XFHTKT0111RZ6DF9":3,"skill-same:01M7CYB125XFHTKT0111RZ6DF9":109},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":14,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7CYB125XFHTKT0111RZ6DF9","geomaster",null,"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.","Marvin-LiJunZan\u002Fskills-mcp","Marvin-LiJunZan","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F125227190?v=4","01M7CX941DQ6NV1MXY88ZDKVFM","lijunzan","01M7CX9421GJQ55X6W4259Y8V6",0,"MIT","https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fgeomaster\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: geomaster\ndescription: 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: K-Dense Inc.\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":24,"metadata":25,"description":7},"MIT License",{"skill-author":26},"K-Dense Inc.","main","2b5bc01df8cc5820e97283a614d9873a8ac70ea1","skills\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fgeomaster","https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp","https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan","2026-10-17 16:33:48",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Marvin-LiJunZan\u002Fskills-mcp --skill geomaster",{"tool":39,"command":40},"bunx","bunx skills add Marvin-LiJunZan\u002Fskills-mcp --skill geomaster",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Marvin-LiJunZan\u002Fskills-mcp --skill geomaster","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fgeomaster\u002FSKILL.md",true,[47,53,57,61,65,69,73,77,81,85,89,93,97,101,105],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"README.md","REFERENCE","参考文档",3218,"https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fgeomaster\u002FREADME.md",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"references\u002Fadvanced-gis.md",10745,"https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fgeomaster\u002Freferences\u002Fadvanced-gis.md",{"path":58,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":59,"sourceHtmlUrl":60},"references\u002Fbig-data.md",8455,"https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fgeomaster\u002Freferences\u002Fbig-data.md",{"path":62,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":63,"sourceHtmlUrl":64},"references\u002Fcode-examples.md",12492,"https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fgeomaster\u002Freferences\u002Fcode-examples.md",{"path":66,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":67,"sourceHtmlUrl":68},"references\u002Fcoordinate-systems.md",8893,"https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fgeomaster\u002Freferences\u002Fcoordinate-systems.md",{"path":70,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":71,"sourceHtmlUrl":72},"references\u002Fcore-libraries.md",6593,"https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fgeomaster\u002Freferences\u002Fcore-libraries.md",{"path":74,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Fdata-sources.md",9001,"https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fgeomaster\u002Freferences\u002Fdata-sources.md",{"path":78,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":79,"sourceHtmlUrl":80},"references\u002Fgis-software.md",8915,"https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fgeomaster\u002Freferences\u002Fgis-software.md",{"path":82,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Findustry-applications.md",13071,"https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fgeomaster\u002Freferences\u002Findustry-applications.md",{"path":86,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fmachine-learning.md",12783,"https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fgeomaster\u002Freferences\u002Fmachine-learning.md",{"path":90,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":91,"sourceHtmlUrl":92},"references\u002Fprogramming-languages.md",11024,"https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fgeomaster\u002Freferences\u002Fprogramming-languages.md",{"path":94,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":95,"sourceHtmlUrl":96},"references\u002Fremote-sensing.md",10104,"https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fgeomaster\u002Freferences\u002Fremote-sensing.md",{"path":98,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":99,"sourceHtmlUrl":100},"references\u002Fscientific-domains.md",10611,"https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fgeomaster\u002Freferences\u002Fscientific-domains.md",{"path":102,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":103,"sourceHtmlUrl":104},"references\u002Fspecialized-topics.md",10686,"https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fgeomaster\u002Freferences\u002Fspecialized-topics.md",{"path":106,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":107,"sourceHtmlUrl":108},"references\u002Ftroubleshooting.md",11219,"https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fgeomaster\u002Freferences\u002Ftroubleshooting.md",[110,118,125,132,139,146],{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":114,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":19},"01M7CZ8DB1NGKBK8AC6BKFHYFK","vibe-research-workflow","Guides AI-assisted research across three sub-flows, Vibe Coding, Vibe Figure, and Vibe Writing, with behavioural rules that keep the user in charge of academic judgment while delegating mechanical work to AI. Recommends the right tool (Cursor, Claude Code, Codex, Figma, Gemini) for the current stage. Use when the user asks 'how to use AI for research', 'Vibe Coding tips', 'AI-assisted writing workflow', 'which AI tool for this', or starts an AI-assisted work session.","CC-BY-4.0","https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fsupervisor-skills\u002Fvibe-research-workflow\u002FSKILL.md",[],[],{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":114,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":19},"01M7CZ87M3Q1RGTAGMB61SJ18Q","tech-paper-template","Structures a technical paper's full logical skeleton using a thinking-template table (research background, limitations, key idea or goal, challenges, methodology modules, contributions), positions the paper as Technique or New Problem\u002FSetting, and runs a four-point self-consistency check. Use when the user is brainstorming a paper, discussing progress with an advisor, or planning the paper before drafting. Also use for 'paper skeleton', 'paper logic chain', 'thinking template', 'paper-structure planning'.","https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fsupervisor-skills\u002Ftech-paper-template\u002FSKILL.md",[],[],{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":114,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":19},"01M7CZ7ZZPBQ5C6G6YPBS2C87Q","pre-submission-reviewer","Runs a pre-submission review of a technical paper across five dimensions: macro logic, writing details, English grammar, LaTeX formatting, and figure quality. Uses a reviewer-style severity taxonomy (CRITICAL \u002F MAJOR \u002F MINOR) and flags banned AI-tone vocabulary and em-dash misuse. Use when the user asks to 'review this paper', 'audit before submission', 'check the draft', 'find issues', 'proofread', or within one week of a submission deadline.","https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fsupervisor-skills\u002Fpre-submission-reviewer\u002FSKILL.md",[],[],{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":114,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":138,"publishedAt":19},"01M7CZ7RMCTTP08V2C7WVWZM0A","intro-drafter","Drafts a 6-paragraph Introduction outline for a technical paper from a structured Flowchart: background and running example, existing limitations, problem essence and goal, key challenges, solution overview, contributions. Positions the paper as Technique or New Problem\u002FSetting and aligns contributions with challenges. Use when the user asks to 'draft the Introduction', 'outline the Introduction', 'intro logic needs clarifying', 'help structure the paper story', or before writing any Introduction prose.","https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fsupervisor-skills\u002Fintro-drafter\u002FSKILL.md",[],[],{"skillNo":140,"name":141,"nameZh":6,"description":142,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":114,"licenseFileUrl":6,"sourceHtmlUrl":143,"categories":144,"keywords":145,"publishedAt":19},"01M7CZ7K5X92VSRM6WTHX91CDA","idea-evaluator","Evaluates a preliminary research idea against a five-dimension framework (Higher, Faster, Stronger, Cheaper, Broader) plus idea-lifecycle and student-capability matching, paradigm-shift probing, and a fatal-flaws audit. Returns a reviewer-style verdict. Use when the user has a draft research idea and asks whether it is worth pursuing, asks to 'evaluate this idea', 'score this idea', 'assess feasibility', 'novelty check', 'is this a good research direction', or before committing to a paper scope.","https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fsupervisor-skills\u002Fidea-evaluator\u002FSKILL.md",[],[],{"skillNo":147,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":114,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":152,"publishedAt":19},"01M7CZ7D29XX445SD75ZT5E8FW","figure-designer","Advises on the design of the three core figures in a technical paper: the Motivated Example (Figure 1), the Solution Overview (Methodology), and the Experimental Results figures. Recommends the right design paradigm, layout, labelling, and tool for each figure type, then runs a quality-control audit. Use when the user asks to 'design a figure', 'draw Figure 1', 'plot experiment results', 'choose the right chart type', 'which figure tool to use', or 'figure looks unprofessional'.","https:\u002F\u002Fgithub.com\u002FMarvin-LiJunZan\u002Fskills-mcp\u002Fblob\u002Fmain\u002Fskills\u002Fsupervisor-skills\u002Ffigure-designer\u002FSKILL.md",[],[]]