--- id: torchgeo version: "0.10.0" license: MIT license_treatment: permissive maintenance: active --- # torchgeo — TorchGeo: datasets, samplers, transforms, and pre-trained models for geospatial data License: permissive · Maintenance: active · Downloads: 79.2K/mo ## What it is and what it does TorchGeo is a domain library built on PyTorch that bridges machine learning and geospatial data science. It provides curated datasets for satellite imagery (Landsat, Sentinel, and others), samplers that intelligently extract patches from large geographic regions, and pre-trained models adapted for multispectral remote sensing tasks. The library automatically handles the complexity of geospatial work—reprojecting data into matching coordinate reference systems, aligning different satellite sources with different spectral bands, and composing datasets through set operations (union and intersection) based on geographic coverage. The package targets two audiences: ML practitioners who want to work with satellite and earth observation data without wrestling with geospatial coordinate systems, and remote sensing experts exploring deep learning solutions. It includes both large-scale geospatial datasets (where you sample patches from continental-scale imagery) and benchmark datasets with pre-labeled examples for tasks like object detection, semantic segmentation, and change detection. All datasets integrate seamlessly with PyTorch data loaders and Lightning training pipelines. Use it for: - Train semantic segmentation models on Landsat or Sentinel satellite imagery with automatic CRS alignment and band selection. - Build object detection systems on high-resolution aerial imagery using the VHR-10 benchmark dataset. - Combine multispectral satellite data from different sensors (e.g., Landsat 7 and 8) into a single training dataset. - Sample random geographic patches from continental-scale raster data like the Cropland Data Layer for efficient batch training. - Transfer-learn from pre-trained models adapted for multispectral channels beyond standard RGB imagery. - Prototype change detection or land-use classification pipelines on real remote sensing data with minimal data wrangling. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. TorchGeo provides PyTorch datasets, samplers, transforms, and pre-trained models for geospatial and remote sensing data, handling multispectral satellite imagery with automatic coordinate reference system alignment. Yes, if you are working with satellite or geospatial imagery in a PyTorch workflow. The library solves real problems—automatic CRS reprojection, multispectral band alignment, and intelligent patch sampling from large rasters—that would otherwise require substantial custom code. Active maintenance, MIT license, and integration with Lightning make it a solid foundation. The 22 runtime dependencies are heavy but standard for this domain; install time and disk footprint are expected costs. Not necessary if your geospatial work is small-scale or already handled by other tools. ## Install pip install torchgeo uv add torchgeo poetry add torchgeo ## Installing torchgeo Before you install: Low friction installation with a pure Python wheel. The 22 runtime dependencies include heavy ML stacks (torch, torchvision, lightning, kornia, segmentation-models-pytorch) that will pull in substantial compiled code; installation time and disk footprint are non-trivial but standard for PyTorch-based geospatial work. Actively maintained as of 2026-08-14. License in practice: MIT license is permissive; you can use, modify, and distribute TorchGeo with minimal restrictions, including in commercial projects, provided you retain the license notice. Quickstart: pip install torchgeo from torchgeo.datasets import Landsat8, CDL from torchgeo.samplers import RandomPatchSampler from torch.utils.data import DataLoader landsat = Landsat8(paths='...') cdl = CDL(paths='...', download=True) dataset = landsat & cdl sampler = RandomPatchSampler(dataset, size=256, length=10000) loader = DataLoader(dataset, batch_size=128, sampler=sampler) Requires PyTorch and torchvision to be installed; torch and torchvision are heavy compiled dependencies that may take time to download and build on some systems. Verify before relying: - Whether pre-trained model weights for multispectral channels are included in the package or must be downloaded separately. - Performance characteristics when working with very large geospatial datasets (e.g., continental-scale imagery). - Specific remote sensing data formats and coordinate reference systems supported beyond the examples in the description. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 79.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags geospatial deep learning pytorch, satellite imagery machine learning, remote sensing datasets pytorch, multispectral image processing, earth observation deep learning, landsat sentinel data pytorch, geospatial data loader, geospatial-ml, satellite-imagery, remote-sensing [View on SkillFed](https://skillfed.io/packages/torchgeo) · [View on PyPI](https://pypi.org/project/torchgeo/)