Reference Data
ASecurityAnswer spatial questions with the Geomermaids parquetry reference datasets, queried in place with DuckDB. Use when a question needs real geographic data rather than general knowledge, such as "what is the predominant land use in Hérault", "how many buildings in Eastern Massachusetts are in the 100-year floodplain", "which substations are within 5 km of this site", "which district is this point in", "how many km of high-voltage line cross this region", "which dams are on the Colorado and its t...
- 2 stars
- 0 votes
- 0 copies
- 0 views
- Added December 5, 2026
Works with
Security analysis
100/100Pro scans all 5 files and shows the line behind each finding
npx -y skills add gsueur/parquetry-skills --skill reference-data --agent claude-codeAre you the author of Reference Data?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/gsueur-reference-data)---
name: reference-data
description: Answer spatial questions with the Geomermaids parquetry reference datasets, queried in place with DuckDB. Use when a question needs real geographic data rather than general knowledge, such as "what is the predominant land use in Hérault", "how many buildings in Eastern Massachusetts are in the 100-year floodplain", "which substations are within 5 km of this site", "which district is this point in", "how many km of high-voltage line cross this region", "which dams are on the Colorado and its tributaries", "which congressional and state legislative districts is this address in", "how much of Spain is forest", "how many people live within 5 km of my sites", "median household income by tract in Suffolk County", "which natural hazards threaten this site", "counties with the highest hurricane risk", "the ten largest cities within 200 km", "geocode this address", "which of these addresses are in the flood zone", "is this site on protected land", "share of the county under federal management", "where is Springfield", "how many people live within 10 km of this site in Kenya", "how many buildings were inside the fire perimeter", "has this site burned", "are there wetlands on this parcel", "which schools are in the flood zone", "is this site on tribal land", "what is the zoning of this Vermont parcel", "find the tax parcels of this Washington county", "how many people work within 1 km of this site", "which DEM tiles cover this county", or when drawing a map of these layers, or when tagging a list of locations with country, admin unit, flood zone, land cover or nearby infrastructure. Covers administrative units worldwide (FAO GAUL 2024), power, telecom, oil and gas and water infrastructure worldwide (GMWID), US flood zones (FEMA NFHL), European land cover (CORINE 2018), US rivers, dams, gages, watersheds and water monitoring sites (Geoconnex), US congressional and state legislative districts for the 2026 elections (Census TIGER/Line), US population, income, housing and commuting by state, county, place, tract, block group and ZIP code area (Census ACS 2020-2024), US natural hazard risk for 18 hazards by tract and county (FEMA National Risk Index), world countries, states, cities, coastlines, rivers and lakes at three scales (Natural Earth), US protected and conservation lands with manager, GAP status and public access (USGS PAD-US), 99 million US address points (USDOT National Address Database), place names to coordinates for US areas and 13 million names worldwide (Census Gazetteer, GeoNames), world population on H3 cells with age and sex (WorldPop 2025), 146 million US building footprints with modelled residents (FEMA USA Structures), US wildfire perimeters live and since 1984 (NIFC WFIGS, MTBS), US wetlands (USFWS NWI), US public, private and postsecondary schools (NCES), US tribal areas and 2020 census blocks with population (TIGER/Line), US jobs by workplace and residence block and commuting flows (LEHD LODES 2024), the statewide GIS layers of Massachusetts, Maine, New Hampshire, New York, California, Washington, Oregon and Vermont (parcels, zoning, roads, water, habitat, hazards: 2,100 layers), the USGS 3DEP and Copernicus GLO-30 elevation tiles and Annual NLCD, and OpenStreetMap buildings, roads, POIs and more for the US, Canada and Mexico.
---
# Spatial questions with the parquetry reference datasets
Two dozen open datasets sit on `https://parquetry.geomermaids.com` as GeoParquet.
You query them in place with DuckDB over HTTP range requests: no download
step, no account, no API. Most questions combine two or three of them: an
area from one, a phenomenon from another, the features to count from a
third.
Your job is to turn a plain-language question into a precise definition,
check that the data covers it, run the spatial query, and answer with the
number, the definition you used, the coverage, the data dates and the
credit.
## The datasets
| Dataset | Covers | Use it for | CRS | Layout |
|---|---|---|---|---|
| **GAUL 2024** (FAO) | World | Areas of interest: countries (L0), states and regions (L1), districts, counties, départements (L2). Point to admin unit. | CRS84 | `gaul/2024/country=<ISO3>/L0_derived,L1,L2.parquet`, or one world file per level |
| **GMWID** | World | Power lines, substations, plants, generators, towers; telecom cables and masts; pipelines, wells, platforms; water plants. | CRS84 | `gmwid/latest/<layer>.parquet`, one world file per layer |
| **FEMA NFHL** | US (50 states, PR) | Flood zones: 1% annual chance (100-year), 0.2% (500-year), floodway, base flood elevation. | **EPSG:4269** | `nfhl/latest/state=<XX>/<DFIRM_ID>.parquet`, one per county delivery, indexed by `nfhl/latest/counties.parquet` |
| **CORINE Land Cover 2018** | Europe (EEA39) | Land cover and land use composition, 44 classes, 25 ha minimum unit. Group shares on H3 cells for large areas. | **EPSG:3035** | `clc/2018/country=<ISO2>/clc_2018.parquet`, or `clc/2018/clc_2018.parquet`; `clc/2018/clc_2018_h3.parquet` |
| **Geoconnex** (Internet of Water) | US | Rivers head to outlet and their network, stream gages, dams, watersheds HU02 to HU12, aquifers, water systems; 4.6 million water monitoring sites (Water Quality Portal, USGS). | CRS84 | `geoconnex/latest/reference/<layer>.parquet`, `geoconnex/latest/providers/<source>.parquet` |
| **Census TIGER/Line 2026** | US | Election districts of November 2026: US House (120th Congress), State Senates, State Houses. The states redrawn since 2024. | **EPSG:4269** | `census/tiger/2026/legislative/cd120,sldu,sldl.parquet`, one national file each |
| **Census ACS 2020-2024** | US | Population, age, households, income, poverty, home value, rent, tenure, race and Hispanic origin, education, commuting, each with its margin of error. Join to TIGER on `GEOID`. | **EPSG:4269** | `census/acs/2024/<geo>.parquet` (table) and `<geo>_geo.parquet` (with outlines), geo = state, county, place, tract, bg, zcta520 |
| **FEMA National Risk Index 1.20** | US | Risk of 18 natural hazards: expected annual loss, social vulnerability, community resilience, composite risk. Scores and ratings per hazard. | CRS84 | `nri/v1.20/tracts,counties,states,tribal_counties.parquet`; `TRACTFIPS`, `STCOFIPS` join TIGER `GEOID` |
| **Natural Earth 5.1.2** | World | Countries, states and provinces, populated places with population, urban areas, airports, ports, time zones, coastline, land, ocean, rivers, lakes. Small-scale context and labels. | CRS84 | `natural-earth/v5.1.2/<10m, 50m, 110m>/<layer>.parquet` |
| **PAD-US 4.1** (USGS) | US | Protected and conservation lands: fee ownership, designations (wilderness, monuments), easements, marine areas, proclamation boundaries; manager, GAP status, public access. | **EPSG:4269** | `padus/v4.1/combined.parquet` (and `combined/state=<XX>/`), `fee, designation, easement, marine, proclamation.parquet` |
| **National Address Database r24** (USDOT) | US, 45 states + DC, VI | 99 million address points with a normalized `full_address` for matching. | CRS84 | `addresses/nad/r24/state=<XX>/addresses.parquet`, one file per state |
| **Gazetteer** | US, World | Names to points: Census Gazetteer 2026 (places, counties, tracts, ZCTAs... keyed by `GEOID`), GeoNames (13.5 million names, populations, feature codes). | 4269 (Census), CRS84 (GeoNames) | `gazetteer/census/2026/<layer>.parquet`, `gazetteer/geonames/latest/geonames.parquet`, `country=<CC>/`, `cities1000.parquet` |
| **WorldPop 2025** | World | People per H3 cell (about 5 km²), by age group and sex. Population near a point outside the US. | CRS84 | `worldpop/R2025A/2025/country=<ISO3>/worldpop_2025.parquet`, a world file at H3 r5 |
| **FEMA USA Structures** | US, 56 states and territories | 146 million building footprints: occupancy, height, area, ORNL's modelled residents. Buildings exposed to a hazard. | CRS84 | `structures/latest/state=<XX>/structures.parquet`, and `cells.parquet` (counts on H3) |
| **Wildfire** (NIFC WFIGS, MTBS) | US | Fires burning now, this year's perimeters and incidents, perimeters since 2020, burned areas since 1984. | CRS84 | `fire/wfigs/latest/<current, year_to_date, all_since_2016, incidents_ytd>.parquet`, `fire/mtbs/latest/mtbs_perimeters.parquet` |
| **NWI wetlands** (USFWS) | US | Wetland and deepwater polygons with their Cowardin class; mapping projects with the imagery year. | **EPSG:4269** | `wetlands/nwi/2026-10/state=<XX>/wetlands.parquet`, `projects.parquet` |
| **NCES schools** | US | Public (2024-25), private (2023-24) and postsecondary (2025-26) schools as points, with county, district and locale. | CRS84 | `schools/latest/<public, private, postsecondary>.parquet` |
| **Census TIGER/Line: tribal areas, 2020 blocks** | US | Reservations, trust lands, tribal tracts (2026); 8.2 million 2020 blocks with population and housing units. | **EPSG:4269** | `census/tiger/2026/aiarelated/<layer>.parquet`, `census/tiger/2020/block/state=<XX>/blocks.parquet` |
| **LODES 2024** (Census LEHD) | US, 50 states + DC | Jobs by workplace block (WAC) and by residence block (RAC), by age, earnings and sector; home-to-work flows (OD). Join the 2020 blocks on `GEOID20`. | **EPSG:4269** (tract and county files) | `census/lodes/2024/state=<XX>/<wac, rac, od>.parquet`; `<wac, rac>_<tract, county>.parquet` with outlines |
| **Statewide GIS layers** | MA, ME, NH, NY, CA, WA, OR, VT | The states' own layers: tax parcels, zoning, roads, address points, water rights, habitat, geologic hazards, facilities, about 2,100 in all. Find a layer by title in the theme manifests. | **the state's own** (State Plane, UTM, Albers; feet in NH, WA, OR) | `<state>/<theme>/<layer>.parquet`, listed in `<state>/<theme>/_manifest.json`; prefixes `massgis`, `maine`, `nh`, `ny`, `ca`, `wa`, `or`, `vt` |
| **Elevation tiles** (USGS 3DEP, Copernicus GLO-30) | US; World | Which DEM tiles cover an area, at 1 m, 10 m, 30 m, with each tile's URL, CRS, dates and elevation range. The pixels are read with GDAL. | CRS84 | `usgs-rasters/index/3dep-tiles.parquet`, `copernicus-dem/index/copernicus-glo30-tiles.parquet` |
| **OpenStreetMap** | US, Canada, Mexico | Buildings, roads, railways, POIs, amenities, places, land use, water, boundaries, power, public transport, updated daily. | CRS84 | `osm/latest/country=<CC>/state=<ISO 3166-2>/<theme>.parquet` |
Read `reference/datasets.md` for columns, value domains and licences
before writing a query against a dataset you have not used in this
session. Each collection also publishes an agent guide with its full
column list: `https://parquetry.geomermaids.com/<dataset>/catalog/<collection>/AGENTS.md`.
For a map, use the PMTiles archives (every dataset but NFHL, Geoconnex,
OSM and the fire incident points has them, GMWID one per layer) with
MapLibre, not the Parquet files: `reference/datasets.md`, "Maps".
Outside these footprints, say so. Do not answer a land-cover question
about Texas from CORINE, or a building count for France from OSM here.
## Setup
```sql
INSTALL spatial; LOAD spatial; INSTALL httpfs; LOAD httpfs;
SET geometry_always_xy = true; -- lon, lat order in ST_Transform, always
-- Only for globs (s3://parquetry/...): the anonymous S3 endpoint.
CREATE SECRET parquetry (TYPE s3, ENDPOINT 's3.geomermaids.com', URL_STYLE 'path',
KEY_ID '', SECRET '', REGION 'auto');
```
Use the DuckDB CLI or the `duckdb` Python package (1.5 or later). Plain
`https://` URLs need no secret. A glob needs the `s3://` form because HTTPS
cannot list files.
## Method
### 1. Pin the question down
Write the definitions before the SQL, and state them in the answer.
- **Place names become areas.** Find them in GAUL by name at the right
level: "Hérault" is an L2 unit of France, "Massachusetts" an L1 unit of
the USA. Names are in the local language with accents (`Hérault`,
`Île-de-France`, `Quebec / Québec`): search with `ILIKE` and confirm the
hit, its parent and its code.
- **Informal regions become explicit lists.** "Eastern Massachusetts",
"the Gulf Coast", "Northern Italy" have no boundary in any dataset.
Choose the member units, name them in the answer, and offer to redo it
with another definition.
- **Vague terms become column filters.** "100-year flood" is the 1% annual
chance flood: NFHL `risk = '1 percent flood zone'`, which holds FEMA's A
and V zones (A, AE, AH, AO, VE...). "Impacted building" usually means a footprint that
touches the zone: say whether you used the footprint or its centroid.
"Predominant land use" can mean the largest CORINE class or the largest
level-1 group: give both when they differ. "High-voltage" needs a
threshold: say which (for example `voltage_kv >= 100`).
### 2. Check coverage before computing
- NFHL: list the deliveries for the area from `counties.parquet` (by
`state` and `county`, or by bbox). Some US counties have no FEMA
county-wide digital delivery and are absent: report them as unmapped,
never as free of flood risk.
- CORINE: the country must be among the 48 in `clc/index.json`.
- OSM: the region must be one of the 98 in `reference/osm-regions.csv`.
OSM completeness varies: building coverage is good in most US cities,
thinner in rural areas.
- GMWID: worldwide, but it is OSM plus authoritative sources. Report
`origin` when it matters.
- Geoconnex: only some dams and gages carry the river they sit on
(`mainstem_uri`): say so when you count along a river.
- Census: US states, DC, Puerto Rico and the territories. Nebraska has no
State House: its one chamber is in the State Senate file. The 2020
blocks leave out the Island Areas (AS, GU, MP, VI).
- Structures: residents (`POP_MEDIAN`) are missing for most of DC and all
the territories; use the 2020 blocks for people there.
- Fire: WFIGS perimeters start in practice in 2020; MTBS covers 1984 on
for large fires only, a year or two late.
- Statewide layers: only the eight states, and only the layers in their
manifests. A layer can cover part of a state (New York's parcel
polygons: 38 of 62 counties); read its `features` and `bbox`.
- LODES: Alaska is 2016 and Michigan 2021 for the workplace and OD
tables; `year` says so.
### 3. Read only what the question needs
- Pick the smallest file set: a country file, a state file, the county
deliveries. A whole-world or whole-Europe file is the last resort.
- Compute the extent of the area first, then filter every big file on its
`bbox` column with that extent. Files are sorted along a Hilbert curve,
so the bbox filter skips most row groups. Never call a geometry function
on a file without a bbox filter.
- Select only the columns you need: the geometry column is most of the
bytes.
- For land cover shares over a whole country or a large region, start
from the CORINE H3 cells: seconds, where clipping the polygons can run
out of memory, and within half a point of them for the level-1 groups.
- Materialize the filtered inputs into local tables (`CREATE TABLE ... AS`)
before a spatial join. DuckDB then joins in memory with its R-tree
spatial join instead of fetching remote pages repeatedly.
- Read per file, not per feature. To test 200 hospitals against flood
zones, group them by FEMA delivery and read each delivery once, filtered
on the extent of its hospitals and on `risk`. One remote query per
feature costs a round trip each and turns minutes into a quarter hour.
### 4. Align the coordinate systems
- GAUL, GMWID, Geoconnex, OSM, WorldPop, Structures, the fire layers and
the schools are CRS84 lon/lat. NFHL, Census, PAD-US and NWI are NAD83
lon/lat (EPSG:4269). The two differ by 1 to 2 m in the US: cast
the NFHL or Census geometry with `geometry::GEOMETRY` to drop the CRS
tag and join them directly.
- The statewide layers are in the state's CRS (`reference/datasets.md`
lists them): transform the point or area into it, never the layer. NH,
WA and OR are in feet, so a `ST_DWithin` distance there is in feet.
- CORINE is EPSG:3035 (metres). Transform the area of interest into 3035
with `ST_Transform(geom, 'OGC:CRS84', 'EPSG:3035')`. Never transform the
CORINE polygons, which are many and large.
- Measure areas and distances in metres in a projected CRS: EPSG:3035 in
Europe, the local UTM zone elsewhere (`EPSG:326<zone>` north,
`EPSG:327<zone>` south, zone = floor((lon + 180) / 6) + 1), or use
`ST_Area_Spheroid` and `ST_Distance_Sphere` on lon/lat.
### 5. Compute with a tested pattern
`reference/recipes.md` holds a tested query for each pattern, including the
two worked examples below. Adapt the closest one:
| Pattern | Example question |
|---|---|
| Point to context | "Which county and flood zone is this address in?" |
| Point to election districts | "Which districts do I vote in at this address?" |
| Composition of an area | "Predominant land use in Hérault" |
| Land cover of a large area | "How much of Spain is forest?" |
| Overlay count | "Buildings in the 100-year floodplain in Eastern Massachusetts" |
| Length or area inside an area | "Km of power lines over 100 kV in Lombardy" |
| Nearest features | "Substations within 5 km of this site" |
| Tag a list of points | "Add country, district and flood zone to my 300 sites" |
| Per-unit statistics | "Wind farm capacity per French région" |
| Along a river | "Dams on the Colorado and its tributaries" |
| Water monitoring sites | "Where is water quality measured near this site?" |
| Population near a point, outside the US | "People within 10 km of this site in Nairobi" |
| Fire history at a site | "Has this site burned?" |
| Buildings and residents inside an area | "Buildings inside the Eaton fire perimeter" |
| Population inside an area, from 2020 blocks | "How many people live inside this polygon?" |
| Wetlands at a site | "Are there wetlands on or near this parcel?" |
| Schools in the flood zone | "Which schools in this county are in the 100-year floodplain?" |
| Tribal area at a point | "Is this site on tribal land?" |
| State layer at a point | "What is the zoning of this site, and which parcel is it on?" |
| Jobs near a point | "How many people work within 1 km of this site?" |
For a single location, `scripts/locate.py <lon> <lat>` returns the admin
units, flood zone, election districts, land cover class, OSM region and
nearest power infrastructure in one call:
```bash
uv run scripts/locate.py -71.0490 42.3480 --radius-km 2
```
It takes 10 to 30 s, most of it in the GMWID infrastructure search.
### 6. Answer
Give, in this order:
1. The number or the answer, with units.
2. The definitions you chose (area members, thresholds, footprint or
centroid).
3. Coverage and gaps (counties without FEMA data, the OSM completeness
caveat).
4. The data dates: the FEMA `fema_update_date` per delivery, the OSM
build date (`osm/snapshots.json`), CORINE 2018, GAUL 2024, the
Geoconnex export date (`geoconnex/latest/_source.json`), TIGER/Line
2026 (`census/_source.json`), WorldPop 2025, the NWI release
(October 2026) and the project `IMAGE_YR`, the NCES school year, the
Structures `IMAGE_DATE`, the fire perimeter date, LODES 2024 (or the
row's `year`), a state layer's `last_modified` from
`<state>/_source.json`.
5. The credit for each dataset used, from `reference/datasets.md`.
Offer the SQL you ran, so the person can rerun or adjust it.
## Pitfalls
- For one point, the GAUL world L2 file answers in about 3 s and a country
file in about 2 s. For many points across countries, find the countries
from the L0 boxes first (under 1 s, no geometry read), then read only
their files, as in the tag-points recipe.
- `ST_Transform` and `ST_Distance_Sphere` without `SET geometry_always_xy = true`
read lon/lat as lat, lon and give wrong results without an error.
- Filter on `bbox` before any spatial predicate. `ST_Intersects` alone
reads every geometry of the file: a point lookup on the NRI tracts
(494 MB) times out at 60 s without it and takes 2.5 s with it.
- Compare `bbox` with literals or `::FLOAT` values, never computed DOUBLEs:
DuckDB then casts the FLOAT column and skips no row group (10.9 s
instead of 1.7 s for the nearest-substation recipe). See
`reference/datasets.md`.
- NFHL rows are pieces of zones, cut to at most 100 vertices. Count zones
with `count(*) FILTER (WHERE piece_id = 0)`, and use `DISTINCT` when you
count features that touch pieces, since one building can touch several.
- An OSM feature that crosses a state border is in both state files. Use
`DISTINCT (osm_type, osm_id)` when you combine regions.
- CORINE codes are strings (`'221'`), and the first digit is the level-1
group: 1 artificial, 2 agricultural, 3 forest and semi-natural,
4 wetlands, 5 water.
- NFHL is not an official flood zone determination. Say so whenever you
report a flood zone for a property.
- TIGER codes `ZZ`/`ZZZ` (no district) and `98` (non-voting delegates)
are placeholders, not districts: filter them out before counting.
`00` is a real at-large district.
- A catalog extent with west > east crosses the antimeridian (Alaska,
Guam): it is not the whole world. Split it in two before using it as a
filter.
- GAUL L0 (`L0_derived`) is dissolved by Geomermaids from L1, not
published by FAO, and GAUL boundaries carry the UN disclaimer.
- ACS values are estimates. Report the `_moe` with them, and do not call a
difference smaller than the margins real. Medians (income, age, rent)
never add up across areas; counts do.
- An NRI score is a national percentile among areas of the same level,
and the rating is FEMA's own class: a tract can score 95 for wildfire
and be rated "Relatively Moderate". Quote both, and compare tracts with
tracts. States have no composite rating: use `EAL_RATNG`.
- Natural Earth `ISO_A2` is `-99` for France and Norway, among others:
join countries on `ISO_A2_EH`, `ISO_A3_EH` or `ADM0_A3`.
- PAD-US areas overlap, in the Combined layer too: a wilderness lies on
fee land, a proclamation boundary encloses both. Never sum `GIS_Acres`
or areas across rows: take the union of the geometries, or keep
`Category = 'Fee'` for ownership, and leave `Proclamation` out of area
questions. Grand County, Utah: federal rows sum to 99.8% of the county,
their union is 73.7%.
- The NAD is not complete: no rows for HI, MI, MS, NH, NV and the
territories but VI, and only some counties in others (GA 2 of 159,
FL 8 of 67, CA 18 of 58). An address not found is not an address that
does not exist: check `addresses/nad/r24/_coverage.json` first.
- Reading the NAD states through the S3 glob, pass
`hive_partitioning = false`: the `State` column already holds the value.
- Wetlands: NWI also maps lakes, rivers and bays. Leave `WETLAND_TYPE`
Lake, Riverine and Estuarine and Marine Deepwater out of a wetland
area, and never present NWI as a jurisdictional delineation.
- Structures `POP_MEDIAN` is a model: sum it for residents in a hazard
area, but quote the 2020 blocks or the ACS for a population figure.
The Eaton fire perimeter: 25,800 by Structures, 24,295 by the blocks.
- A fire perimeter, a WorldPop cell and a school point are not legal or
exact boundaries: perimeters lag the fire, cells are 2.5 km, a school
point is its geocode, not its campus. Not for evacuation decisions.
- Read the NWI and 2020 block state files with `hive_partitioning = false`
through a glob: the `state` column already holds the value.
- A statewide layer is the agency's data as published, not a legal record:
zoning is the town's ordinance map as last sent to the state, a parcel
is the assessor's sketch, not a survey. Say so, and credit the agency
the manifest names. Vermont's CC BY-SA 4.0 layers keep that licence in
anything derived from them.
- LODES counts jobs, not workers, at the employer's reporting address:
a firm can report every branch at its headquarters.
Files in this skill
- SKILL.md
- reference/datasets.md
- reference/osm-regions.csv
- reference/recipes.md
- scripts/locate.py
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.