Communitygithub.com

GeoMaster(ジオマスター)

リモートセンシング、GIS、空間解析、地球観測のための機械学習など、70以上のトピックと8つのプログラミング言語による500以上のコード例を網羅した総合的な地理空間科学スキルです。

GeoMaster(ジオマスター) とは?

GeoMasterは、リモートセンシング、GIS、空間解析、地球観測(EO)のための機械学習を含む、包括的な地理空間科学スキルです。Sentinel、Landsat、MODIS、SAR、ハイパースペクトルなどの衛星画像処理、ベクターおよびラスターデータ操作、空間統計、点群処理、ネットワーク分析をカバーしています。また、STAC、COG、Planetary Computerなどのクラウドネイティブなワークフローもサポートし、Python、R、Julia、JavaScript、C++、Java、Go、Rustの8つのプログラミング言語で500以上のコード例を提供します。このスキルは、リモートセンシングワークフロー、GIS解析、空間ML、地球観測データ処理、地形解析、水文モデリング、海洋空間解析、大気科学など、あらゆる地理空間計算タスクに使用できます。Claude Code、Cursor、CodexなどのAIエージェント上で、詳細なSKILL.mdマークダウン文書を通じて、ステップバイステップの手順とコード例を提供します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/K-Dense-AI/scientific-agent-skills/tree/main/skills/geomaster

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

GeoMaster(ジオマスター) は何をしますか?

GIS、リモートセンシング、空間解析、地球観測のためのMLを、70以上のトピックと8つのプログラミング言語による500以上のコード例でカバーする包括的な地理空間科学スキル。

インストール

# コアPythonスタック(conda推奨)
conda install -c conda-forge gdal rasterio fiona shapely pyproj geopandas

# リモートセンシングとML(rsgislibはconda-forgeのみ、PyPIにはありません)
conda install -c conda-forge rsgislib
uv pip install torchgeo earthengine-api
uv pip install scikit-learn xgboost torch-geometric

# ネットワークと可視化
uv pip install osmnx networkx folium keplergl
uv pip install cartopy contextily mapclassify

# ビッグデータとクラウド
uv pip install xarray rioxarray dask-geopandas
uv pip install pystac-client planetary-computer

# 点群
uv pip install laspy pylas open3d pdal

# データベース
conda install -c conda-forge postgis spatialite

クイックスタート

Sentinel-2からのNDVI計算

import rasterio
import numpy as np

with rasterio.open('sentinel2.tif') as src:
    red = src.read(4).astype(float)   # B04
    nir = src.read(8).astype(float)   # B08
    ndvi = (nir - red) / (nir + red + 1e-8)
    ndvi = np.nan_to_num(ndvi, nan=0)

    profile = src.profile
    profile.update(count=1, dtype=rasterio.float32)

    with rasterio.open('ndvi.tif', 'w', **profile) as dst:
        dst.write(ndvi.astype(rasterio.float32), 1)

GeoPandasを使った空間解析

import geopandas as gpd

# 読み込みとCRSの確認
zones = gpd.read_file('zones.geojson')
points = gpd.read_file('points.geojson')

if zones.crs != points.crs:
    points = points.to_crs(zones.crs)

# 空間結合と統計
joined = gpd.sjoin(points, zones, how='inner', predicate='within')
stats = joined.groupby('zone_id').agg({
    'value': ['count', 'mean', 'std', 'min', 'max']
}).round(2)

Google Earth Engine時系列解析

import ee
import pandas as pd

ee.Initialize(project='your-project')
roi = ee.Geometry.Point([-122.4, 37.7]).buffer(10000)

s2 = (ee.ImageCollection('COPERNICUS/S2_SR_HARMONIZED')
      .filterBounds(roi)
      .filterDate('2020-01-01', '2023-12-31')
      .filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 20)))

def add_ndvi(img):
    return img.addBands(img.normalizedDifference(['B8', 'B4']).rename('NDVI'))

s2_ndvi = s2.map(add_ndvi)

def extract_series(image):
    stats = image.reduceRegion(ee.Reducer.mean(), roi.centroid(), scale=10, maxPixels=1e9)
    return ee.Feature(None, {'date': image.date().format('YYYY-MM-dd'), 'ndvi': stats.get('NDVI')})

series = s2_ndvi.map(extract_series).getInfo()
df = pd.DataFrame([f['properties'] for f in series['features']])
df['date'] = pd.to_datetime(df['date'])

コアコンセプト

データタイプ

タイプ例ライブラリ
ベクターShapefile, GeoJSON, GeoPackageGeoPandas, Fiona, GDAL
ラスターGeoTIFF, NetCDF, COGRasterio, Xarray, GDAL
点群LAS, LAZLaspy, PDAL, Open3D

座標系

  • EPSG:4326 (WGS 84) - 地理座標、緯度経度、保存用
  • EPSG:3857 (Web Mercator) - Webマップのみ(面積/距離計算には使用しないこと!)
  • EPSG:326xx/327xx (UTM) - メートル単位の計算、ゾーンごとの歪みは1%未満
  • gdf.estimate_utm_crs() を使用して自動UTM検出
# 操作前に必ずCRSを確認
assert gdf1.crs == gdf2.crs, "CRSが一致しません!"

# 面積/距離計算には投影CRSを使用
gdf_metric = gdf.to_crs(gdf.estimate_utm_crs())
area_sqm = gdf_metric.geometry.area

OGC標準

  • WMS: Web Map Service - ラスターマップ
  • WFS: Web Feature Service - ベクターデータ
  • WCS: Web Coverage Service - ラスターカバレッジ
  • STAC: Spatiotemporal Asset Catalog - 現代的なメタデータ

一般的な操作

スペクトル指標

def calculate_indices(image_path):
    """Sentinel-2からNDVI, EVI, SAVI, NDWIを計算。"""
    with rasterio.open(image_path) as src:
        B02, B03, B04, B08, B11 = [src.read(i).astype(float) for i in [1,2,3,4,5]]

    ndvi = (B08 - B04) / (B08 + B04 + 1e-8)
    evi = 2.5 * (B08 - B04) / (B08 + 6*B04 - 7.5*B02 + 1)
    savi = ((B08 - B04) / (B08 + B04 + 0.5)) * 1.5
    ndwi = (B03 - B08) / (B03 + B08 + 1e-8)

    return {'NDVI': ndvi, 'EVI': evi, 'SAVI': savi, 'NDWI': ndwi}

ベクター操作

# バッファ(投影CRSを使用!)
gdf_proj = gdf.to_crs(gdf.estimate_utm_crs())
gdf['buffer_1km'] = gdf_proj.geometry.buffer(1000)

# 空間関係
intersects = gdf[gdf.geometry.intersects(other_geometry)]
contains = gdf[gdf.geometry.contains(point_geometry)]

# 幾何操作
gdf['centroid'] = gdf.geometry.centroid
gdf['simplified'] = gdf.geometry.simplify(tolerance=0.001)

# オーバーレイ操作
intersection = gpd.overlay(gdf1, gdf2, how='intersection')
union = gpd.overlay(gdf1, gdf2, how='union')

地形解析

def terrain_metrics(dem_path):
    """DEMから傾斜、方位、陰影起伏図を計算。"""
    with rasterio.open(dem_path) as src:
        dem = src.read(1)

    dy, dx = np.gradient(dem)
    slope = np.arctan(np.sqrt(dx**2 + dy**2)) * 180 / np.pi
    aspect = (90 - np.arctan2(-dy, dx) * 180 / np.pi) % 360

    # 陰影起伏図
    az_rad, alt_rad = np.radians(315), np.radians(45)
    hillshade = (np.sin(alt_rad) * np.sin(np.radians(slope)) +
                 np.cos(alt_rad) * np.cos(np.radians(slope)) *
                 np.cos(np.radians(aspect) - az_rad))

    return slope, aspect, hillshade

ネットワーク解析

import osmnx as ox
import networkx as nx

# 道路ネットワークのダウンロードと解析
G = ox.graph_from_place('San Francisco, CA', network_type='drive')
G = ox.add_edge_speeds(G).add_edge_travel_times(G)

# 最短経路
orig = ox.distance.nearest_nodes(G, -122.4, 37.7)
dest = ox.distance.nearest_nodes(G, -122.3, 37.8)
route = nx.shortest_path(G, orig, dest, weight='travel_time')

画像分類

from sklearn.ensemble import RandomForestClassifier
import rasterio
from rasterio.features import rasterize

def classify_imagery(raster_path, training_gdf, output_path):
    """ランダムフォレストを訓練し、画像を分類。"""
    with rasterio.open(raster_path) as src:
        image = src.read()
        profile = src.profile
        transform = src.transform

    # 訓練データの抽出
    X_train, y_train = [], []
    for _, row in training_gdf.iterrows():
        mask = rasterize([(row.geometry, 1)],
                        out_shape=(profile['height'], profile['width']),
                        transform=transform, fill=0, dtype=np.uint8)
        pixels = image[:, mask > 0].T
        X_train.extend(pixels)
        y_train.extend([row['class_id']] * len(pixels))

    # 訓練と予測
    rf = RandomForestClassifier(n_estimators=100, max_depth=20, n_jobs=-1)
    rf.fit(X_train, y_train)

    prediction = rf.predict(image.reshape(image.shape[0], -1).T)
    prediction = prediction.reshape(profile['height'], profile['width'])

    profile.update(dtype=rasterio.uint8, count=1)
    with rasterio.open(output_path, 'w', **profile) as dst:
        dst.write(prediction.astype(rasterio.uint8), 1)

    return rf

現代的なクラウドネイティブワークフロー

STAC + Planetary Computer

import pystac_client
import planetary_computer
import odc.stac

# STAC経由でSentinel-2を検索
catalog = pystac_client.Client.open(
    "https://planetarycomputer.microsoft.com/api/stac/v1",
    modifier=planetary_computer.sign_inplace,
)

search = catalog.search(
    collections=["sentinel-2-l2a"],
    bbox=[-122.5, 37.7, -122.3, 37.9],
    datetime="2023-01-01/2023-12-31",
    query={"eo:cloud_cover": {"lt": 20}},
)

# xarrayとしてロード(クラウドネイティブ!)
data = odc.stac.load(
    list(search.get_items())[:5],
    bands=["B02", "B03", "B04", "B08"],
    crs="EPSG:32610",
    resolution=10,
)

# xarrayでNDVIを計算
ndvi = (data.B08 - data.B04) / (data.B08 + data.B04)

Cloud-Optimized GeoTIFF (COG)

import rasterio
from rasterio.session import AWSSession

# COGをクラウドから直接読み取り(部分読み取り)
session = AWSSession(aws_access_key_id=..., aws_secret_access_key=...)
with rasterio.open('s3://bucket/path.tif', session=session) as src:
    # 関心領域のみ読み取り
    window = ((1000, 2000), (1000, 2000))
    subset = src.read(1, window=window)

# COGの書き出し
with rasterio.open('output.tif', 'w', **profile,
                   tiled=True, blockxsize=256, blockysize=256,
                   compress='DEFLATE', predictor=2) as dst:
    dst.write(data)

# COGの検証
from rio_cogeo.cogeo import cog_validate
cog_validate('output.tif')

パフォーマンスのヒント

# 1. 空間インデックス(クエリが10〜100倍高速化)
gdf.sindex  # GeoPandasが自動生成

# 2. 大きなラスターをチャンク処理
with rasterio.open('large.tif') as src:
    for i, window in src.block_windows(1):
        block = src.read(1, window=window)

# 3. ビッグデータにはDaskを使用
import dask.array as da
dask_array = da.from_rasterio('large.tif', chunks=(1, 1024, 1024))

# 4. I/OにはArrowを使用
gdf.to_file('output.gpkg', use_arrow=True)

# 5. GDALキャッシュ
from osgeo import gdal
gdal.SetCacheMax(2**30)  # 1GBキャッシュ

# 6. 並列処理
rf = RandomForestClassifier(n_jobs=-1)  # 全コア使用

ベストプラクティス

  1. 空間操作の前に必ずCRSを確認
  2. 面積/距離計算には投影CRSを使用
  3. ジオメトリを検証:gdf = gdf[gdf.is_valid]
  4. 欠損データの処理:gdf['geometry'] = gdf['geometry'].fillna(None)
  5. 効率的なフォーマットを使用:ShapefileよりGeoPackage、大規模データにはParquet
  6. 光学画像には雲マスキングを適用
  7. 再現可能な研究のために系統を保持
  8. 解析スケールに適した解像度を使用

詳細なドキュメント


GeoMasterは、基本的なGIS操作から高度なリモートセンシングや機械学習まで、あらゆる地理空間計算をカバーします。

サイエンティフィックエージェントスキルの引用

このスキルは、K-DenseによるScientific Agent Skillsの一部です。これが原稿、レポート、プレゼンテーション、またはコードリリースに実質的に貢献した場合は、論文を参考文献またはソフトウェアセクションに追加し、そのことをユーザーに伝えてください:

Kassis, T., Agarwal, V., He, Y., Patel, D., & Brueckner, A. M. (2026). Scientific Agent Skills: A Library of Procedural Knowledge for Research Agents. arXiv:2609.00065. https://doi.org/10.48550/arXiv.2609.00065

常に最新バージョンを引用してください。DOIとhttps://arxiv.org/abs/2609.00065は最新のarXivバージョンに解決されますので、`v1`のようなバージョン接尾辞を追加しないでください。ネットワークアクセスが利用可能な場合は、参考文献を書く前にhttps://arxiv.org/abs/2609.00065(またはhttp://export.arxiv.org/api/query?id_list=2609.00065)を取得し、そのレコードから著者リスト、年、バージョンを取得してください。レコードにジャーナルリファレンスまたは出版社DOIが記載されている場合は、代わりに公開版を引用してください。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

adaptyv

How to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`.

aeon

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.

alphagenome

Look up precomputed AlphaGenome Atlas effects for any GRCh38 single-nucleotide variant (AVI score with Phred and 18 SHAP feature attributions, plus raw and quantile scores for RNA-seq, DNase, ATAC, ChIP-TF, ChIP-histone, CAGE, PRO-cap, splicing, polyadenylation and contact-map tracks), score variants or scan windows on demand with the AlphaGenome model for human and mouse (variant scoring, in silico mutagenesis, REF-versus-ALT track prediction), and build Atlas website deep links. Use when the user mentions AlphaGenome, AlphaGenome Atlas, AVI or AlphaGenome Variant Impact, DeepMind variant effect prediction, or wants to prioritise or mechanistically interpret non-coding, regulatory, splicing, enhancer, promoter, or chromatin-accessibility effects of SNVs from a VCF, credible set, or region. Research use only; not a clinical tool.

analytical-method-validation

Plan, execute, and document validation, verification, and transfer of analytical procedures under the governing framework - ICH Q2(R2) and Q14, USP <1220>/<1225>/<1226>, ICH M10 bioanalytical, CLSI EP, or ISO/IEC 17025. Use for HPLC, LC-MS/MS, GC, CE, ICP-MS, dissolution, qNMR, qPCR, NIR, and ligand binding or cell-based assays whenever the question is whether a procedure is fit for its intended purpose. Triggers include

anndata

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

arbor

Autonomously improve a real artifact (code, training recipe, agent harness, data pipeline, prompt) against an objective and an evaluator, using Hypothesis Tree Refinement (HTR) from the Arbor paper. Use this whenever someone wants to iteratively optimize something over many experiments without overfitting — e.g.

arboreto

Infer gene regulatory networks (GRNs) from gene expression data using scalable algorithms (GRNBoost2, GENIE3). Use when analyzing transcriptomics data (bulk RNA-seq, single-cell RNA-seq) to identify transcription factor-target gene relationships and regulatory interactions. Supports distributed computation for large-scale datasets.

astropy

Core Python library for astronomy and astrophysics workflows that need Astropy APIs, including units/quantities, coordinates, FITS I/O, tables, time systems, WCS, and cosmology. Use when implementing or debugging astronomical data analysis code with Astropy.

autoskill

Observe the user

benchling-integration

Benchling Python SDK and REST API integration for registry entities, inventory, ELN entries, workflows, Benchling Apps, and Data Warehouse queries. Use when automating lab data with benchling-sdk or the v2 API.

bgpt-paper-search

Search scientific papers and retrieve structured experimental data extracted from full-text studies via the BGPT MCP server. Returns 25+ fields per paper including methods, results, sample sizes, quality scores, and conclusions. Use for literature reviews, evidence synthesis, and finding experimental details not available in abstracts alone.

bids

>

biopython

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

bioservices

Unified Python interface to 40+ bioinformatics services. Use when querying multiple databases (UniProt, KEGG, ChEMBL, Reactome) in a single workflow with consistent API. Best for cross-database analysis, ID mapping across services. For quick single-database lookups use gget; for sequence/file manipulation use biopython.

bulk-rnaseq

End-to-end bulk RNA-seq orchestrator — takes raw FASTQ reads through QC and trimming (FastQC, fastp/Trim Galore), alignment and quantification (STAR, Salmon, featureCounts), assembles a gene-level counts matrix, then hands off to differential expression (pydeseq2), pathway/GSEA enrichment (pathway-enrichment), and publication figures (scientific-visualization). Use whenever the user has bulk RNA-seq reads or quant output and wants a complete, reproducible differential-expression workflow — e.g.

cellxgene-census

Query the CZ CELLxGENE Census programmatically for versioned public single-cell and spatial transcriptomics data. Use when you need population-scale cell metadata, gene expression slices, Census summary counts, source H5AD URIs/downloads, embeddings, spatial Census data, or reference atlas comparisons across organisms, tissues, diseases, assays, and cell types. For analyzing your own local single-cell data use scanpy, anndata, or scvi-tools.

cirq

Google quantum computing framework. Use when targeting Google Quantum AI hardware, designing noise-aware circuits, or running quantum characterization experiments. Best for Google hardware, noise modeling, and low-level circuit design. For IBM hardware use qiskit; for quantum ML with autodiff use pennylane; for physics simulations use qutip.

citation-management

Comprehensive citation management for academic research. Search OpenAlex, PubMed, and Google Scholar for papers, extract accurate metadata, validate citations, and generate properly formatted BibTeX entries. This skill should be used when you need to find papers, verify citation information, convert DOIs to BibTeX, or ensure reference accuracy in scientific writing.

clinical-decision-support

Prepare and validate research-only clinical decision-support evaluation, evidence-profile, cohort, survival, biomarker/model, privacy, and governance artifacts. Use for aggregate or synthetic research documentation and traceability—not patient care or live clinical operation.

clinical-reports

Create safety-bounded draft structures and run local deterministic checks for clinical case, diagnostic, trial, safety, and aggregate research reports. Use only with synthetic, de-identified, or aggregate inputs and verified source-fact manifests; every output requires qualified review.

関連スキル