# Find parcels intersecting a polygon

> Search parcel boundaries within a drawn area, check what the search returns, then screen the matched sites with Invariant Earth.

Source: https://docs.invariant-ai.com/find-parcels-intersecting-a-polygon

To find parcels that intersect a drawn area, search the parcel geometries with a spatial intersection. Use the resulting assessor parcel numbers and boundaries to verify the candidate sites. Use Invariant Earth’s point and parcel fields to screen those sites individually.

## Choose the spatial relationship

Select **intersection** when a parcel should qualify if part of it falls inside the area. Some spatial APIs also return boundaries that touch the area along an edge or at a point. Check for positive intersection area when you need actual land inside the search boundary. A centroid search answers whether the center of a parcel falls inside the area. A full-containment search requires the entire parcel to fit.

Start with the local assessor or planning layer for a known county. A multi-county provider can supply a common query format. [Regrid](https://support.regrid.com/docs/api-endpoint-overview) documents search by GeoJSON geometry, and [GetParcelData](https://getparceldata.com/api) documents searches by WKT polygon. Ask whether each endpoint includes edge touches, how it pages results and which source edition it used. Count and compare the returned records using the same spatial rule.

## Test a rectangle in San Francisco

We queried the [active DataSF parcels](https://data.sf.gov/d/acdm-wktn) on November 24, 2026, and found the same matches in [San Francisco Planning’s MapBlockLot layer](https://sfplanninggis.org/arcgiswa/rest/services/PlanningData/MapServer/24). A narrow rectangle near Larkin Street intersected the two parcels below. Neither centroid fell inside it.

| Parcel number | City address | Area inside the rectangle | Centroid inside |
| --- | --- | --- | --- |
| `0353001` | 200 Larkin Street | 1,209.6 m² | No |
| `0354001` | 100 Larkin Street | 832.3 m² | No |

We confirmed the count with the city’s count query and computed intersection areas in NAD83 / UTM zone 10N. The [downloadable reference](https://docs.invariant-ai.com/examples/sf-civic-center-parcel-rectangle.json) contains both city queries, the rectangle in GeoJSON and WKT, and two requests for the Earth API. The example uses a drawn search area. The city map and recorded descriptions are separate evidence for the actual property.

Save the download as `sf-civic-center-parcel-rectangle.json`. With `curl` and `jq`, run the public city query and print the sorted parcel identifiers.

```bash
city_query=$(jq -er '.source.geometry_query' sf-civic-center-parcel-rectangle.json)
curl --fail-with-body --max-time 30 -sS "$city_query" |
  jq -er '[.[].mapblklot] | sort[]'
```

## Add Earth fields to the verified sites

Use [Fetch](https://docs.invariant-ai.com/api/fetch) for the location you want to screen. For each parcel, choose a verified address point or another point inside the geometry. The first request in the fixture uses the city’s address point at 200 Larkin Street. Set `INVARIANT_API_KEY` to your [API key](https://docs.invariant-ai.com/get-api-key).

```bash
jq -c '.sites[0].fetch_body' sf-civic-center-parcel-rectangle.json |
  curl --fail-with-body --max-time 75 -sS 'https://api.invariant-ai.com/v1/fetch' \
    -H "X-API-Key: $INVARIANT_API_KEY" \
    -H 'Content-Type: application/json' \
    --data-binary @-
```

Use [`parcel_apn`](https://docs.invariant-ai.com/fields/parcel_apn), [`parcel_match_type`](https://docs.invariant-ai.com/fields/parcel_match_type) and [`parcel_boundary_geojson`](https://docs.invariant-ai.com/fields/parcel_boundary_geojson) to verify the match. Keep the identifier as text, including leading zeros, and pair it with the county. If the Earth response reports a nearby parcel, or the identifier or geometry differs from the search result, keep both records and resolve the difference before joining fields.

The example also asks for [`slope_degrees`](https://docs.invariant-ai.com/fields/slope_degrees) and [`within_floodplain_polygon`](https://docs.invariant-ai.com/fields/within_floodplain_polygon) at the requested point. To measure conditions across the lot, choose a parcel-scale field or intersect the verified boundary with the source layer. See [point and parcel flood checks](https://docs.invariant-ai.com/check-flood-zone-by-address). Save the query geometry, spatial rule, source edition and retrieval date with the result so future reruns can trace changes.
