Earth observation
Optical index and calibrated radar histories for geospatial SQL queries
- Connector software
- Free and open source
- Service credentials
- Not needed
- Query Farm hosting
- Available Β· $10/month organization minimum
Use with an agent
Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.
npx skills add Query-farm/vgi-skills --skill orchard
Copy this request into your coding agent to get started.
Use https://query.farm/products/orchard/connectors/earth-observation/index.md to help me query Earth observation with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.
Find vegetation declines in two synthetic parcels
Example output Β· captured
- Connector release
- v0.3.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
SELECT parcel_id, round(mean_index, 2), decline
FROM earth_observation.main.parcel_series((SELECT * FROM earth_observation.main.sample_parcels))
ORDER BY parcel_id, observed_at
| parcel_id | round(mean_index, 2) | decline |
|---|---|---|
| field-a | 0.6 | NULL |
| field-a | 0 | true |
| field-b | 0.6 | NULL |
| field-b | 0 | true |
Quick start
Choose where to run Earth observation, then follow the steps below.
The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.
1. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
2. Attach the connector
Attach with uvx
Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.
ATTACH 'earth_observation' AS earth_observation (
TYPE vgi,
LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-earth-observation-worker'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'earth_observation' AS earth_observation (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-earth-observation:0.3.0'
);
3. Run a query
SELECT parcel_id, round(mean_index, 2), decline
FROM earth_observation.main.parcel_series((SELECT * FROM earth_observation.main.sample_parcels))
ORDER BY parcel_id, observed_at
Run the connector on a server you manage. You operate the service and choose who can connect.
1. Deploy the connector on your server
Follow the connectorβs deployment instructions. Use its supported HTTP transport, or launch it remotely over SSH. The connection guide explains both options.
2. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach the connector
For an HTTP deployment, replace the example URL with your endpoint. Add the authentication options your deployment requires. For SSH, use the SSH connection instructions.
ATTACH 'earth_observation' AS earth_observation
(TYPE vgi, LOCATION 'https://your-connector.example.com');
4. Run a query
SELECT parcel_id, round(mean_index, 2), decline
FROM earth_observation.main.parcel_series((SELECT * FROM earth_observation.main.sample_parcels))
ORDER BY parcel_id, observed_at
Query Farm operates Earth observation for your team. Hosting has a $10 monthly minimum per organization; usage counts toward it. From $2.97 per instance-month ($10 monthly minimum).
1. Create your hosted connector
Open the console, choose your organization and deployment size, and add any service credentials there.
2. Install the vgi extension
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach your deployment
Copy the ATTACH statement from your deployment in the console and run it in DuckDB or Haybarn. Use earth_observation as the catalog alias for the query below.
4. Run a query
SELECT parcel_id, round(mean_index, 2), decline
FROM earth_observation.main.parcel_series((SELECT * FROM earth_observation.main.sample_parcels))
ORDER BY parcel_id, observed_at
Technical details
- Verified connector release
- v0.3.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
- Verified on
- December 1, 2026
Pin a version for production
When running the connector yourself, keep a specific release until youβre ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.
Attach with uvx
Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.
ATTACH 'earth_observation' AS earth_observation (
TYPE vgi,
LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-earth-observation-worker'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'earth_observation' AS earth_observation (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-earth-observation:0.3.0'
);
Overview
Satellite imagery histories for land parcels and regions from STAC catalogs: cloud-masked Sentinel-2 vegetation and water indices and calibrated Sentinel-1 radar backscatter, with change flags. Reads local STAC files or public STAC APIs; offline sample scenes are included.
GIS analysis
Build parcel vegetation or water-index histories from STAC ItemCollections or public STAC APIs. Align bands and categorical SCL masks, apply scale/offset metadata, exclude cloudy pixels, optionally form monthly pixel-median composites, and flag declines between adequately observed periods. Output parcel IDs join directly to ownership and weather tables. Synthetic offline assets ship in the wheel. Summarize prepared calibrated SAR intensity assets over polygon regions for time-series change analysis. Input region_id and geometry_wkb columns retain caller identity. Read local STAC ItemCollections or public STAC APIs, using vv/vh assets. This function accepts calibrated terrain-corrected linear power or decibel rasters, not raw radar, complex SLC, or an optical index. Convert dB pixels to linear power before spatial averaging, then report 10*log10(mean_power). Nonpositive linear power, nodata and nonfinite pixels are excluded. Pixel centres define membership. Keep platform, relative_orbit, orbit_state and polarization separate in temporal statistics. A viewing group's rasters must share CRS, resolution and pixel-grid alignment; differing extents are allowed. No resampling or additional speckle filter is performed. Missing observations are NULL, never zero. A change is not a damage probability. Coherence requires a separate phase-preserving SLC pipeline. Private asset signing is outside this function; use prepared local windows.
SQL workflow
Pass query results to the main schema functions, retaining IDs for joins. Use bundled synthetic data to try the executable examples without network access. CRS, coverage, inference limits and resource bounds are explicit function parameters.
Sources and references
- STAC specification: the SpatioTemporal Asset Catalog items and API searches this worker reads.
- Earth Search by Element 84: the public STAC API whose
sentinel-2-l2aCloud-Optimized GeoTIFFs the optical examples use. - Sentinel-2 processing (SentiWiki): Level-2A surface reflectance and the Scene Classification (SCL) codes used for cloud masking.
- Sentinel-1 RTC on Microsoft Planetary Computer: the radiometrically terrain-corrected radar collection the
sentinel-1-rtcdefault names. - Rasterio: the GDAL-based raster library used to read and align assets.
Catalog
Everything earth_observation exposes once attached β read straight from the worker's
released build.
main 1 table Β· 2 functions
Spatial functions and bundled inputs for earth observation analysis.
Schema examples (5)
List the bundled parcel IDs
SELECT parcel_id
FROM earth_observation.main.sample_parcels
ORDER BY parcel_id;
Find vegetation declines in two synthetic parcels
SELECT parcel_id, round(mean_index, 2), decline
FROM earth_observation.main.parcel_series((SELECT * FROM earth_observation.main.sample_parcels))
ORDER BY parcel_id, observed_at;
| parcel_id | round(mean_index, 2) | decline |
|---|---|---|
| field-a | 0.6 | NULL |
| field-a | 0 | true |
| field-b | 0.6 | NULL |
| field-b | 0 | true |
Per parcel, join the count of optical NDVI declines and the worst NDVI change to the VV backscatter change in dB between the first and last fully covered radar acquisitions on each orbit track
WITH optical AS (SELECT parcel_id, count(*) FILTER (WHERE decline) AS ndvi_declines, min(delta_index) AS worst_ndvi_change FROM earth_observation.main.parcel_series((SELECT parcel_id, geometry_wkb FROM earth_observation.main.sample_parcels)) GROUP BY parcel_id), radar AS (SELECT region_id, relative_orbit, orbit_state, arg_max(mean_db, observed_at) - arg_min(mean_db, observed_at) AS vv_change_db FROM earth_observation.main.radar_series((SELECT parcel_id AS region_id, geometry_wkb FROM earth_observation.main.sample_parcels), polarizations := 'vv') WHERE status = 'ok' GROUP BY region_id, relative_orbit, orbit_state) SELECT o.parcel_id, o.ndvi_declines, round(o.worst_ndvi_change, 2) AS worst_ndvi_change, r.relative_orbit, r.orbit_state, round(r.vv_change_db, 1) AS vv_change_db
FROM optical AS o
JOIN radar AS r ON r.region_id = o.parcel_id
ORDER BY o.parcel_id, r.relative_orbit, r.orbit_state;
Inspect a synthetic radar-return decrease and an explicit missing observation
SELECT observed_at::DATE AS observed_date, round(mean_db, 1), status
FROM earth_observation.main.radar_series((SELECT parcel_id AS region_id, geometry_wkb FROM earth_observation.main.sample_parcels WHERE parcel_id='field-a'), polarizations := 'vv')
ORDER BY observed_at;
1 more example
Follow up parcels flagged with an optical NDVI decline: VV minus VH backscatter in dB for each fully covered radar acquisition
WITH declined AS (SELECT DISTINCT parcel_id FROM earth_observation.main.parcel_series((SELECT parcel_id, geometry_wkb FROM earth_observation.main.sample_parcels)) WHERE decline) SELECT region_id, observed_at::DATE AS observed_date, relative_orbit, round(max(mean_db) FILTER (WHERE polarization = 'VV') - max(mean_db) FILTER (WHERE polarization = 'VH'), 1) AS vv_minus_vh_db
FROM earth_observation.main.radar_series((SELECT parcel_id AS region_id, geometry_wkb FROM earth_observation.main.sample_parcels WHERE parcel_id IN (SELECT parcel_id FROM declined)))
WHERE status = 'ok'
GROUP BY region_id, observed_at, relative_orbit
ORDER BY region_id, observed_at;
sample_parcels
Two synthetic agricultural parcels matching the bundled offline satellite scenes
List the bundled parcel IDs
SELECT parcel_id
FROM earth_observation.main.sample_parcels
ORDER BY parcel_id;
parcel_series (data TABLE, catalog := VARCHAR, clear_scl_classes := VARCHAR, collections := VARCHAR, composite := VARCHAR, decline_threshold := DOUBLE, end_date := VARCHAR, geometry_crs := VARCHAR, green_asset := VARCHAR, index_name := VARCHAR, max_change_gap_days := DOUBLE, max_cloud := DOUBLE, max_json_bytes := BIGINT, max_pages := BIGINT, max_pixels := BIGINT, max_scenes := BIGINT, max_source_pixels := BIGINT, min_coverage := DOUBLE, nir_asset := VARCHAR, offset_mode := VARCHAR, red_asset := VARCHAR, scl_asset := VARCHAR, start_date := VARCHAR, swir_asset := VARCHAR)
Cloud-mask and align satellite bands into parcel index histories and decline flags
Find vegetation declines in two synthetic parcels
SELECT parcel_id, round(mean_index, 2), decline
FROM earth_observation.main.parcel_series((SELECT * FROM earth_observation.main.sample_parcels))
ORDER BY parcel_id, observed_at;
| parcel_id | round(mean_index, 2) | decline |
|---|---|---|
| field-a | 0.6 | NULL |
| field-a | 0 | true |
| field-b | 0.6 | NULL |
| field-b | 0 | true |
Per parcel, join the count of optical NDVI declines and the worst NDVI change to the VV backscatter change in dB between the first and last fully covered radar acquisitions on each orbit track
WITH optical AS (SELECT parcel_id, count(*) FILTER (WHERE decline) AS ndvi_declines, min(delta_index) AS worst_ndvi_change FROM earth_observation.main.parcel_series((SELECT parcel_id, geometry_wkb FROM earth_observation.main.sample_parcels)) GROUP BY parcel_id), radar AS (SELECT region_id, relative_orbit, orbit_state, arg_max(mean_db, observed_at) - arg_min(mean_db, observed_at) AS vv_change_db FROM earth_observation.main.radar_series((SELECT parcel_id AS region_id, geometry_wkb FROM earth_observation.main.sample_parcels), polarizations := 'vv') WHERE status = 'ok' GROUP BY region_id, relative_orbit, orbit_state) SELECT o.parcel_id, o.ndvi_declines, round(o.worst_ndvi_change, 2) AS worst_ndvi_change, r.relative_orbit, r.orbit_state, round(r.vv_change_db, 1) AS vv_change_db
FROM optical AS o
JOIN radar AS r ON r.region_id = o.parcel_id
ORDER BY o.parcel_id, r.relative_orbit, r.orbit_state;
radar_series (regions TABLE, catalog := VARCHAR, collections := VARCHAR, end_date := VARCHAR, geometry_crs := VARCHAR, max_json_bytes := BIGINT, max_pages := BIGINT, max_pixels := BIGINT, max_scenes := BIGINT, min_coverage := DOUBLE, polarizations := VARCHAR, start_date := VARCHAR, value_unit := VARCHAR)
Summarize calibrated SAR backscatter by region, acquisition, viewing track and polarization
Inspect a synthetic radar-return decrease and an explicit missing observation
SELECT observed_at::DATE AS observed_date, round(mean_db, 1), status
FROM earth_observation.main.radar_series((SELECT parcel_id AS region_id, geometry_wkb FROM earth_observation.main.sample_parcels WHERE parcel_id='field-a'), polarizations := 'vv')
ORDER BY observed_at;
Follow up parcels flagged with an optical NDVI decline: VV minus VH backscatter in dB for each fully covered radar acquisition
WITH declined AS (SELECT DISTINCT parcel_id FROM earth_observation.main.parcel_series((SELECT parcel_id, geometry_wkb FROM earth_observation.main.sample_parcels)) WHERE decline) SELECT region_id, observed_at::DATE AS observed_date, relative_orbit, round(max(mean_db) FILTER (WHERE polarization = 'VV') - max(mean_db) FILTER (WHERE polarization = 'VH'), 1) AS vv_minus_vh_db
FROM earth_observation.main.radar_series((SELECT parcel_id AS region_id, geometry_wkb FROM earth_observation.main.sample_parcels WHERE parcel_id IN (SELECT parcel_id FROM declined)))
WHERE status = 'ok'
GROUP BY region_id, observed_at, relative_orbit
ORDER BY region_id, observed_at;
Try these queries
List the bundled parcel IDs
SELECT parcel_id
FROM earth_observation.main.sample_parcels
ORDER BY parcel_id
Uses sample_parcels
Per parcel, join the count of optical NDVI declines and the worst NDVI change to the VV backscatter change in dB between the first and last fully covered radar acquisitions on each orbit track
WITH optical AS (SELECT parcel_id, count(*) FILTER (WHERE decline) AS ndvi_declines, min(delta_index) AS worst_ndvi_change FROM earth_observation.main.parcel_series((SELECT parcel_id, geometry_wkb FROM earth_observation.main.sample_parcels)) GROUP BY parcel_id), radar AS (SELECT region_id, relative_orbit, orbit_state, arg_max(mean_db, observed_at) - arg_min(mean_db, observed_at) AS vv_change_db FROM earth_observation.main.radar_series((SELECT parcel_id AS region_id, geometry_wkb FROM earth_observation.main.sample_parcels), polarizations := 'vv') WHERE status = 'ok' GROUP BY region_id, relative_orbit, orbit_state) SELECT o.parcel_id, o.ndvi_declines, round(o.worst_ndvi_change, 2) AS worst_ndvi_change, r.relative_orbit, r.orbit_state, round(r.vv_change_db, 1) AS vv_change_db
FROM optical AS o
JOIN radar AS r ON r.region_id = o.parcel_id
ORDER BY o.parcel_id, r.relative_orbit, r.orbit_state
Inspect a synthetic radar-return decrease and an explicit missing observation
SELECT observed_at::DATE AS observed_date, round(mean_db, 1), status
FROM earth_observation.main.radar_series((SELECT parcel_id AS region_id, geometry_wkb FROM earth_observation.main.sample_parcels WHERE parcel_id='field-a'), polarizations := 'vv')
ORDER BY observed_at
Follow up parcels flagged with an optical NDVI decline: VV minus VH backscatter in dB for each fully covered radar acquisition
WITH declined AS (SELECT DISTINCT parcel_id FROM earth_observation.main.parcel_series((SELECT parcel_id, geometry_wkb FROM earth_observation.main.sample_parcels)) WHERE decline) SELECT region_id, observed_at::DATE AS observed_date, relative_orbit, round(max(mean_db) FILTER (WHERE polarization = 'VV') - max(mean_db) FILTER (WHERE polarization = 'VH'), 1) AS vv_minus_vh_db
FROM earth_observation.main.radar_series((SELECT parcel_id AS region_id, geometry_wkb FROM earth_observation.main.sample_parcels WHERE parcel_id IN (SELECT parcel_id FROM declined)))
WHERE status = 'ok'
GROUP BY region_id, observed_at, relative_orbit
ORDER BY region_id, observed_at
Questions it can answer
Plain-English questions from the worker's agent test tasks. An AI agent with this catalog attached should answer each one with SQL.
- List the bundled parcel IDs. Use the bundled synthetic inputs and return the columns and ordering shown in its catalog example.
- Find vegetation declines in two synthetic parcels. Use the bundled synthetic inputs and return the columns and ordering shown in its catalog example.
Earth observation is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.
Related workers
Hydrology
Weather, ocean & earth
Upstream catchments and land-cover summaries for monitoring stations
Buoys
Weather, ocean & earth
NOAA NDBC buoy stations, latest observations and recent station histories for marine analysis
Earthquakes
Weather, ocean & earth
Live & historical USGS earthquake catalog as SQL tables in DuckDB β runs on Cloudflare Workers