GeoAI in Action Across GIS Platforms: ArcGIS, Open-Source Python, Earth Engine and QGIS
This post runs one kind of job, getting buildings and land cover out of imagery, on four platforms: ArcGIS Pro with the ArcGIS API for Python, open-source Python (TorchGeo and segment-geospatial), Google Earth Engine, and QGIS. You get code for each, an honest note on what each one is good at, a sourced list of the AI assistants these platforms ship today, and a comparison table.
The pipeline is the same everywhere
Every platform runs the same four stages; what differs is who supplies the model and where it runs.
The stages are: get imagery, choose a model, run inference to get a raster of classes or object masks, then turn that raster into clean vectors. Quality is mostly decided at the two ends: imagery that matches the model's training data, and post-processing that removes slivers and squares off buildings.
Resolution decides which task is realistic. Building footprints need sub-metre imagery: aerial orthophotos or very high resolution satellite data. Earth Engine's free catalogue is mostly 10 to 30 metre data (Sentinel-2, Landsat), where a single pixel is bigger than a house. So the Earth Engine example below does 10 metre land-cover classification, which is what it does well, while the others work on high-resolution imagery.
ArcGIS: pretrained models and arcgis.learn
Pretrained model, no training
ArcGIS Living Atlas hosts pretrained deep learning packages (.dlpk). The Extract Features Using AI Models tool (GeoAI toolbox, arcpy.geoai.ExtractFeaturesUsingAIModels) runs one or more of them on a raster and then post-processes the result, for example regularising building outlines to right angles. Its pretrained models are named strings and need an internet connection:
import arcpy
# Needs ArcGIS Pro Advanced + Image Analyst (postprocessing also uses
# 3D Analyst, Spatial Analyst and Topographic Mapping), the deep learning
# frameworks for Pro, a GPU, and internet access to fetch the Living Atlas model.
arcpy.CheckOutExtension("ImageAnalyst")
arcpy.env.processorType = "GPU"
arcpy.geoai.ExtractFeaturesUsingAIModels(
in_raster=r"C:\gis\imagery\ortho_2025.tif",
mode="Infer and Postprocess",
out_location=r"C:\gis\geoai\results.gdb",
out_prefix="bldg",
pretrained_models="'Building Footprint Extraction - USA'",
confidence_threshold=0.6,
regularization_method="Right Angles",
poly_tolerance="1 Meters",
)
Check the licensing before you plan around this tool. The current tool page lists Basic: No, Standard: No, Advanced: Requires Image Analyst. It adds that 3D Analyst, Spatial Analyst and Topographic Mapping licenses are needed for post-processing. It also needs a GPU and the deep learning frameworks installed into Pro's Python environment. The lower-level tools, Detect Objects Using Deep Learning (arcpy.ia.DetectObjectsUsingDeepLearning) and Classify Pixels Using Deep Learning, need Image Analyst at any license level. They give you the raw model output without the post-processing.
Training your own model
When no pretrained model fits, you label samples in Pro, export image chips, and train with arcgis.learn, the deep learning module of the ArcGIS API for Python. In Pro you add its dependencies with Esri's Deep Learning Frameworks installer, or into a cloned environment with conda install -c esri deep-learning-essentials.
import arcpy
from arcgis.learn import UnetClassifier, prepare_data
arcpy.CheckOutExtension("ImageAnalyst")
CHIPS = r"C:\gis\geoai\chips_landcover"
# 1. Label polygons with an integer class field -> image chips + label chips
arcpy.ia.ExportTrainingDataForDeepLearning(
in_raster=r"C:\gis\imagery\ortho_2025.tif",
out_folder=CHIPS,
in_class_data=r"C:\gis\geoai\labels.gdb\landcover_samples",
image_chip_format="TIFF",
tile_size_x=256,
tile_size_y=256,
stride_x=128,
stride_y=128,
metadata_format="Classified_Tiles",
class_value_field="ClassValue",
)
# 2. Train a U-Net pixel classifier with arcgis.learn
data = prepare_data(CHIPS, batch_size=8)
model = UnetClassifier(data)
lr = model.lr_find()
model.fit(20, lr=lr)
model.save("landcover_unet") # .dlpk under CHIPS\models\landcover_unet
# 3. Run the trained model over the full image with the Pro tool
out = arcpy.ia.ClassifyPixelsUsingDeepLearning(
in_raster=r"C:\gis\imagery\ortho_2025.tif",
in_model_definition=CHIPS + r"\models\landcover_unet\landcover_unet.dlpk",
arguments="padding 64;batch_size 8",
)
out.save(r"C:\gis\geoai\landcover_unet.tif")
Classified_Tiles is the export format for pixel classification. Object detection uses formats such as PASCAL_VOC_rectangles or RCNN_Masks instead. lr_find suggests a learning rate, and save writes the model under a models folder inside the training data folder, including a .dlpk. Check the exact path it prints. The Pro inference tools consume that package. Export Training Data For Deep Learning needs Image Analyst or Spatial Analyst.
ArcGIS Pro 3.8 also added a few embedding-based tools to the GeoAI toolbox, including Find Features By Description and Detect Changes Using Embeddings, according to its What's new page.
Open-source Python: TorchGeo and SAM
TorchGeo
TorchGeo (MIT license) is a PyTorch library of geospatial datasets, samplers, pretrained weights and Lightning training tasks. In version 0.10.1 the tasks live in torchgeo.tasks. The older torchgeo.trainers names such as SemanticSegmentationTask are kept only as deprecated aliases. This trains a U-Net on LandCover.ai, an aerial RGB dataset with background, building, woodland, water and road classes, and then classifies a GeoTIFF:
import numpy as np
import rasterio
import torch
from lightning.pytorch import Trainer
from torchgeo.datamodules import LandCoverAIDataModule
from torchgeo.tasks import SemanticSegmentation # torchgeo.trainers is the old, deprecated name
# LandCover.ai: aerial RGB tiles, classes Background, Building, Woodland, Water, Road
dm = LandCoverAIDataModule(root="data/landcoverai", download=True, batch_size=16, num_workers=4)
task = SemanticSegmentation(
model="unet",
backbone="resnet50",
weights=True, # ImageNet encoder weights
in_channels=3,
num_classes=5,
loss="ce",
lr=1e-3,
)
trainer = Trainer(accelerator="auto", max_epochs=20)
trainer.fit(task, datamodule=dm)
trainer.test(task, datamodule=dm)
# Inference on your own GeoTIFF (RGB, similar resolution to the training data)
task.eval()
with rasterio.open("ortho_tile.tif") as src:
rgb = src.read([1, 2, 3]).astype("float32") / 255.0 # same scaling as the datamodule
profile = src.profile
h, w = rgb.shape[1:]
ph, pw = (-h) % 32, (-w) % 32 # U-Net needs sizes divisible by 32
x = torch.from_numpy(np.pad(rgb, ((0, 0), (0, ph), (0, pw)), mode="reflect"))[None]
with torch.no_grad():
classes = task(x).argmax(dim=1)[0, :h, :w].numpy().astype("uint8")
profile.pop("photometric", None) # a JPEG/YCbCr source setting breaks a 1-band write
profile.update(count=1, dtype="uint8", nodata=None, compress="deflate")
with rasterio.open("landcover_torchgeo.tif", "w", **profile) as dst:
dst.write(classes, 1)
The datamodule downloads the dataset on first run and divides pixels by 255, so the inference code does the same. weights=True starts the encoder from ImageNet weights. For multispectral data, pass a sensor weight enum such as ResNet50_Weights.SENTINEL2_ALL_MOCO and set in_channels. Large rasters need tiling, for which TorchGeo has samplers. If your imagery is in a different CRS from your other layers, reproject it first (see the GDAL reprojection post).
segment-geospatial (samgeo)
segment-geospatial (MIT license, package segment-geospatial, version 1.6.0 at the time of writing) wraps Meta's Segment Anything models for GeoTIFFs. SamGeo3 uses SAM 3, which accepts a text prompt, so you can ask for "building" without training anything:
from samgeo import SamGeo3
from samgeo.common import raster_to_vector
IMAGE = "ortho_tile.tif" # RGB GeoTIFF; for more bands pass bands=[...] to set_image
# SAM 3 weights are gated on Hugging Face: request access to facebook/sam3,
# then authenticate once with huggingface_hub.login()
sam = SamGeo3(backend="meta")
sam.set_image(IMAGE)
sam.generate_masks(prompt="building")
# uint8 with unique IDs runs out after 255 objects, so use a wider type
sam.save_masks(output="building_masks.tif", unique=True, dtype="uint32")
# One polygon per mask ID; tolerance is in the raster's CRS units
raster_to_vector("building_masks.tif", "buildings_sam3.gpkg", simplify_tolerance=0.5)
Two practical notes from the samgeo source and docs. First, the SAM 3 weights on Hugging Face are gated: you request access to facebook/sam3 and log in before the first run. Read the model's own license terms, which are separate from samgeo's MIT license. Second, save_masks defaults to dtype="uint8", which cannot hold more than 255 unique object IDs, so a wider type is set here before vectorising. Install with pip install "segment-geospatial[samgeo3]". Expect to filter the resulting polygons by size and shape.
Google Earth Engine: random forest on embeddings
Earth Engine runs the computation on Google's servers next to its data catalogue, so you need no GPU and no download. The Python client is earthengine-api. ee.Initialize takes the Cloud project the work runs under. This example trains ee.Classifier.smileRandomForest on the Satellite Embedding dataset. That is an annual, 10 metre, 64-band embedding produced by Google DeepMind's AlphaEarth Foundations model. Labels are sampled from ESA WorldCover:
import ee
ee.Authenticate() # once per machine
ee.Initialize(project="my-gee-project") # a Cloud project registered for Earth Engine
aoi = ee.Geometry.Rectangle([-95.6, 29.6, -95.2, 29.9])
# Labels: ESA WorldCover 2020 remapped to consecutive integers from 0,
# which is what Earth Engine classifiers expect
wc_classes = [10, 20, 30, 40, 50, 60, 70, 80, 90, 95, 100]
labels = (
ee.Image("ESA/WorldCover/v100/2020")
.remap(wc_classes, ee.List.sequence(0, 10))
.rename("lc")
.toByte()
)
# Features: the 64-band (A00..A63) annual Satellite Embedding, 10 m
emb = (
ee.ImageCollection("GOOGLE/SATELLITE_EMBEDDING/V1/ANNUAL")
.filterDate("2020-01-01", "2021-01-01")
.filterBounds(aoi)
.mosaic()
)
bands = emb.bandNames()
samples = emb.addBands(labels).stratifiedSample(
numPoints=300, classBand="lc", region=aoi, scale=10, seed=42, geometries=False
).randomColumn("rand", 7)
train = samples.filter(ee.Filter.lt("rand", 0.8))
test = samples.filter(ee.Filter.gte("rand", 0.8))
rf = ee.Classifier.smileRandomForest(numberOfTrees=100).train(
features=train, classProperty="lc", inputProperties=bands
)
matrix = test.classify(rf).errorMatrix("lc", "classification")
print("Validation accuracy:", matrix.accuracy().getInfo())
print("Kappa:", matrix.kappa().getInfo())
classified = emb.classify(rf).clip(aoi)
task = ee.batch.Export.image.toDrive(
image=classified.toByte(), description="lc_rf", region=aoi, scale=10, maxPixels=1e10
)
task.start()
Earth Engine classifiers expect class labels to be consecutive integers starting at 0, hence the remap. stratifiedSample draws the same number of points per class, errorMatrix on the held-out 20% gives accuracy and kappa, and the export runs as a batch task. The embeddings are meant to be used as all 64 bands together, and the dataset's license (CC-BY 4.0) requires an attribution line. Training on WorldCover labels mostly reproduces WorldCover; use your own reference points in real work.
QGIS: post-processing and plugins
QGIS core does not ship deep learning models. Where it is strong is the last stage: turning a class raster from any of the tools above into clean vectors, through Processing algorithms you can script from the Python console:
# Run in the QGIS Python console (Plugins > Python Console)
from qgis import processing
from qgis.core import QgsProject, QgsVectorLayer
MASK = r"C:/gis/geoai/landcover_torchgeo.tif" # any class raster from the steps above
BUILDING = 1 # class value to keep
poly = processing.run("gdal:polygonize", {
"INPUT": MASK,
"BAND": 1,
"FIELD": "DN",
"EIGHT_CONNECTEDNESS": False,
"OUTPUT": "TEMPORARY_OUTPUT",
})["OUTPUT"]
# Keep one class; area($geometry) is planar, in the layer CRS units squared
kept = processing.run("native:extractbyexpression", {
"INPUT": poly,
"EXPRESSION": f'"DN" = {BUILDING} AND area($geometry) >= 20',
"OUTPUT": r"C:/gis/geoai/buildings_qgis.gpkg",
})["OUTPUT"]
layer = QgsVectorLayer(kept, "buildings", "ogr")
QgsProject.instance().addMapLayer(layer)
print(layer.featureCount(), "building polygons")
gdal:polygonize and native:extractbyexpression are standard Processing algorithms, and the parameter names here come from the QGIS 3.44 documentation. For inference inside QGIS, the Deepness plugin runs ONNX segmentation, detection and regression models. Its plugin page lists version 0.6.5 (December 2024) with a QGIS range of 3.22 to 3.99. QGIS 4.0 shipped on 6 March 2026, so check whether a 4.x-compatible release exists before relying on the plugin there.
AI assistants in these platforms
This lists only what official documentation confirms; statuses change often.
- ArcGIS. The AI in ArcGIS Online reference lists assistants including the ArcGIS Pro assistant (beta), ArcGIS Arcade assistant (beta), ArcGIS Notebooks assistant (beta), the Survey123 and StoryMaps assistants, and a Documentation assistant. An organisation administrator has to enable AI. Beta assistants also need the "Block Esri apps and capabilities while they are in beta" setting turned off.
- Google Earth Engine. The Code Editor AI assistant is an "Ask" panel that uses Gemini models to write, explain and debug scripts. You supply your own Gemini API key from Google AI Studio, and Google's guide notes that a paid-tier key incurs charges.
- QGIS and the open-source libraries. I found no assistant in QGIS core or in the TorchGeo or samgeo documentation, so I make no claim about them here.
Comparison
| Platform | Licensing and cost | Hardware | Strengths |
|---|---|---|---|
| ArcGIS Pro + arcgis.learn | Commercial. Deep learning tools need Image Analyst; Extract Features Using AI Models lists Advanced + Image Analyst, plus other extensions for post-processing. | GPU required by Extract Features Using AI Models; ArcGIS Pro runs on Windows. | Pretrained Living Atlas models, labelling and post-processing in one GUI, .dlpk packages that run on Image Server. |
| TorchGeo | MIT, free. | Your own GPU or cloud GPU. | Full control over training, many benchmark datasets and sensor-specific pretrained weights. |
| segment-geospatial (SAM) | MIT library; SAM 3 weights gated on Hugging Face under Meta's own terms. | GPU strongly advised. | Text- or box-prompted segmentation with no training data. |
| Google Earth Engine | Unpaid access for verified noncommercial projects; commercial use is billed through Google Cloud. | None locally; runs on Google's servers. | Petabyte catalogue, time series and large-area classification at 10 to 30 m, embeddings dataset. |
| QGIS | GPL, free. | Any desktop; GPU only if a plugin needs it. | Scriptable Processing for post-processing and cartography; ONNX inference through plugins. |
How to choose
- On ArcGIS with Image Analyst, and a Living Atlas model fits your imagery: start there.
- No model exists for your sensor or classes: train one in TorchGeo or
arcgis.learn, depending on where it must run. - A quick first pass without labels: SAM 3 with a text prompt, then filter.
- Land cover over a region or a decade at 10 m: Earth Engine.
- Finishing any class raster cheaply: QGIS Processing or GDAL.
Summary
- Same pipeline everywhere: imagery, model, inference, vectorise. Match the task to the resolution.
- ArcGIS:
arcpy.geoai.ExtractFeaturesUsingAIModelsfor pretrained Living Atlas models, andarcgis.learnplusarcpy.iatools for your own. Check the Image Analyst and other license requirements. - Open source:
torchgeo.tasks.SemanticSegmentationfor training, andsamgeo.SamGeo3for prompt-based segmentation without labels. - Earth Engine:
ee.Classifier.smileRandomForeston the Satellite Embedding dataset for large-area land cover, with no local hardware. - QGIS: Processing for post-processing; Deepness for ONNX inference (check QGIS 4 support).
- AI assistants: ArcGIS has several, many in beta and admin-controlled; Earth Engine's Code Editor has a Gemini-based panel.
Comments