Extract building footprints, vegetation, damage assessments, roof condition, and other AI features from Nearmap's aerial imagery using simple Python code.
Supported countries: au (Australia), us (United States), nz (New Zealand), ca (Canada)
pip install nmaipy Requires Python 3.13 or later.
export API_KEY=your_api_key_here Contact your account administrator if you don't have one.
Short-lived bearer tokens are also supported at the library level: pass bearer_token= to any API client (FeatureApi, RoofAgeApi, DamageConflationApi, or the coverage_utils functions) to authenticate with an Authorization: Bearer header instead of an API key — useful when running nmaipy in a sandboxed environment where a long-lived key can't be exposed. The token is captured at construction and never refreshed, so keep jobs shorter than its lifetime. For that reason the exporter CLIs deliberately have no --bearer-token option: exports can run for hours, longer than a short-lived token lasts.
The repository ships with a 10-property smoke-test script (run_10_test.py) that extracts building features and roof age predictions for 10 US properties. It's the fastest way to verify your setup end-to-end:
python run_10_test.py Output is written to data/outputs/quick_test/final/. Open rollup.csv, browse the rollup row per property, then have a look at README.md in the same directory — every export ships an auto-generated, customer-readable data dictionary explaining every column.
The script itself is short — read it (run_10_test.py) to see the full call signature.
Running as a script: the exporters start their worker processes with the spawn method, which re-imports your script in every worker. In a .py file, call run() under if __name__ == "__main__": (as the disaster-response examples do); notebooks and the REPL don't need it.
nmaipy doesn't only consume parcel polygons. Mesh blocks (AU), census blocks (US/CA), suburbs, statistical areas — anything you can express as polygons can be passed in as AOIs. This gives you a contiguous map of AI features you can directly merge with demographic, economic, or other reference data on the same geographic units.
Pull a representative time-window (e.g. 12 months) for the latest snapshot:
from nmaipy.exporter import NearmapAIExporter exporter = NearmapAIExporter( aoi_file='melbourne_mesh_blocks.geojson', # or census blocks, suburbs, etc. output_dir='melbourne_2025', country='au', packs=['building', 'vegetation', 'surfaces', 'solar'], since='2025-01-01', until='2025-12-31', save_features=True, # per-class GeoParquet with feature geometries include_parcel_geometry=True, # keep block boundaries for GIS joins processes=8, ) exporter.run() For change detection, repeat the same call with a different since / until window and diff the resulting rollups. Each AOI gets a survey_date and system_version so you know exactly which capture / model version produced each row — useful when comparing vintages.
Tip: if your input has a since or until column (string-typed YYYY-MM-DD), it overrides the bulk values per row, so you can mix windows in a single export.
When you want maximum 3D attribute coverage in a single unified export — without losing AOIs that only have 2D coverage in your date window — use prefer3d=True. The exporter runs the bulk request as if only3d=True, then transparently retries each AOI that returned no 3D survey with only3d=False:
exporter = NearmapAIExporter( aoi_file='properties.geojson', output_dir='unified_3d_results', country='us', packs=['building', 'building_char', 'roof_char'], prefer3d=True, save_features=True, ) exporter.run() The output rollup carries a mesh_date column — non-empty when the row used a 3D survey, empty when it fell back to 2D. Mutually exclusive with only3d. No-op for AOIs pinned to a survey_resource_id (the survey is already chosen).
Extract Roof Spotlight Index scores that automatically resolve the best RSI per roof — using the roof's own score when available, or falling back to the Building Lifecycle score when structural damage is present:
Assess wildfire vulnerability with defensible space analysis around structures — per-zone metrics and per-class risk object breakdowns (vegetation, neighbouring roofs, yard debris) across three concentric zones (0-indexed, matching the CalFire convention):
Predict roof installation dates using AI analysis of historical imagery, combined with building permits and climate data. Recommended approach — unified with the Feature API in one export:
from nmaipy.roof_age_exporter import RoofAgeExporter exporter = RoofAgeExporter( aoi_file='properties.geojson', output_dir='roof_age_results', country='us', threads=10, output_format='both', # GeoParquet and CSV ) exporter.run() Dataset selection: pass roof_age_dataset='latest' (default — pointer maintained by the Nearmap team), 'A.0', 'A.1', 'A.1Q2', or any raw resource UUID. Historical "as-of" queries: combine with since / until to ask "what was this roof like in the past?" — these drive the API's sinceAsOfDate / untilAsOfDate body parameters. Note: since / until are not supported on the A.0 dataset and are rejected client-side with a clear error.
Useful for insurance underwriting, property valuation, maintenance planning, and real-estate due diligence.
After a catastrophe (hurricane, tornado, wildfire, flood), Nearmap flies post-catastrophe (post-cat) surveys over the affected area. Three kinds of damage data come from them:
Three rules apply to both Feature API workflows:
The examples use Hurricane Isaias (event date 2026-10-09, Florida Panhandle). To find an event's id and footprint from a point inside the damage zone, see Damage Conflation.
The Feature API's damage classification is a per-survey, real-time rating: every Building lifecycle feature gets a FEMA 5-tier class — Undamaged, Affected, Minor, Major or Destroyed — with a confidence for each tier, computed from that one survey's imagery. Request the damage pack (Building lifecycle on post-cat surveys) and add include=['damage']:
Post-cat surveys get the full Nearmap AI suite, from the same processing as standard surveys. What changes is access: packs control which layers you can read from post-cat versus standard surveys, and the pack names don't make that obvious. The standard debris pack reads standard surveys only: with since set to the event date it fails with 404 no survey resources found, and without since it silently returns debris from the latest pre-event survey. To read debris, tarps, missing shingles, exposed underlayment, temporary repairs or structural damage from a post-cat survey, use the postcat pack:
postcat (29 classes) also covers roof damage (Missing Roof Tile or Shingle, Exposed Underlayment, Exposed Roof Deck, Tarpaulin/Shade Cloth, Roof with Temporary / Permanent Repair), structural damage (Structural Damage, Building with Structural Damage, Building Structural Loss, Building Damage by Tree), swimming pools and Building lifecycle. damage_classifications is a 10-class, damage-focused subset of it, and postcat_others (100+ classes) holds the long tail — Roof Debris, Yard Debris, roof objects, vegetation, surfaces and more. FeatureApi().get_feature_classes(packs=['postcat']) lists the classes your account can query.
The Damage Conflation API is the multi-date counterpart of the damage classification above: instead of one survey's rating, it returns one conflated rating per building — the highest-confidence assessment across every capture in the event's lifecycle. Queries are scoped by event id rather than by date or survey, so there is no survey to choose. Large AOIs are paged, so areas bigger than census blocks work too — up to the whole event footprint — though large AOIs take longer to return. This script goes from one point to conflated damage for the whole event, one census block at a time:
"""Pull conflated building damage for a whole catastrophe event, starting from one point.""" import geopandas as gpd from nmaipy.coverage_utils import discover_event from nmaipy.damage_conflation_exporter import DamageConflationExporter LAT, LON = 30.15465, -85.76716 # Panama City Beach, FL: inside the Hurricane Isaias (2026) damage zone # US Census 2020 blocks for Florida (TIGER/Line 2022, ~190 MB), read straight from census.gov BLOCKS_URL = "https://www2.census.gov/geo/tiger/TIGER2022/TABBLOCK20/tl_2022_12_tabblock20.zip" AOI_FILE = "isaias_blocks.parquet" def main(): # 1. Point -> the latest post-catastrophe event covering it, plus that event's footprint # (the union of its post-cat surveys). since/until bracket the event, so a later event # at the same spot can't take over. event_id, footprint = discover_event(lat=LAT, lon=LON, since="2026-10-09", until="2026-12-31") # event_id == "442c3974-5b6c-5335-a6e4-83b5b9afc8b7" (Hurricane Isaias, event date 2026-10-09) # 2. Footprint -> one AOI per census block, clipped to the surveyed area. Block boundaries # mostly run down the middle of roads; an arbitrary grid would cut through buildings and # return each one in every AOI it touches. The bbox read is in the file's CRS (NAD83), # hence the small buffer. minx, miny, maxx, maxy = footprint.bounds blocks = gpd.read_file( BLOCKS_URL, columns=["GEOID20"], bbox=(minx - 0.01, miny - 0.01, maxx + 0.01, maxy + 0.01) ).to_crs("EPSG:4326") blocks = gpd.clip(blocks, footprint, keep_geom_type=True) blocks = blocks[~blocks.is_empty].rename(columns={"GEOID20": "aoi_id"}) blocks.to_parquet(AOI_FILE) # 3. One conflated damage rating per building, fused across every capture of the event. DamageConflationExporter( aoi_file=AOI_FILE, output_dir="isaias_damage", event_id=event_id, country="us", output_format="both", # GeoParquet + CSV rollup=True, # adds a per-block rollup (n_buildings, n_major, ...) alongside the per-building rows processes=8, threads=1, # the conflation API rate-limits well below the Feature API; keep concurrency low chunk_size=100, max_retries=20, # default 10; AOIs still failing after this are listed in damage_errors.csv ).run() if __name__ == "__main__": # required: nmaipy's worker pool uses the "spawn" start method main() discover_event picks the latest post-catastrophe event covering the point and logs any others — this point also sits under Hurricane Michael (2018) and a 2024 severe-weather event — so pass since/until to pin a specific one (they also bound the captures that make up the footprint). The event id is the Coverage API's postCatEventId survey tag. The two steps are also available separately: latest_event_id_at_point(lat, lon) and event_boundary(event_id) (one tag-filtered Coverage query — include=postCatEventId: — unioned, no spatial search).
The exporter always emits per-building damage polygons (damage_event_* / damage_pre_event_* rating, confidence and rawRatings scores); rollup=True adds a per-AOI summary (rating counts + the primary building, which is most meaningful when AOIs are property-sized). Ratings use the same five tiers, except that the lowest is NoDamage (the Feature API's Undamaged). Unlike the Feature API, an AOI outside the event footprint is not an error: it succeeds with no buildings. A building that straddles two AOIs is returned for each, with the same feature_id and rating, so deduplicate on feature_id when counting across AOIs — census blocks keep this rare. The Isaias footprint covers ~14,700 blocks, so slice blocks (e.g. blocks.head(10)) for a quick first run. See Standalone Damage Conflation Export for the CLI and the files written to final/.
Packs and feature classes are not hard-coded — your account's available packs (and their classes) are returned by the API. List them programmatically:
from nmaipy.feature_api import FeatureApi api = FeatureApi() # uses API_KEY env var # Dict of pack code -> list of feature class UUIDs your account can query packs = api.get_packs() print(sorted(packs.keys())) # DataFrame of feature classes (rich metadata: description, type, perspective, etc.) classes = api.get_feature_classes() print(classes[["description", "type"]].head()) # Filter to a specific pack building_classes = api.get_feature_classes(packs=["building"]) Commonly available packs (this list is not exhaustive):
For the full catalog and access details, use the snippet above or check the Nearmap help site.
NearmapAIExporter takes either packs or classes (feature class UUIDs from get_feature_classes()), not both. The Feature API rejects a request carrying both, so the constructor raises ValueError. Pass neither and requests carry no filter, so you get every class your account can query, which can be a very large response. The CLI defaults to --packs building instead. A class id that isn't in get_feature_classes() fails the export before any AOI is requested.
Your file should contain polygons representing the areas you want to analyse — parcels, mesh blocks, census blocks, suburbs, statistical areas, custom regions, etc. An aoi_id column identifies each row; if absent, sequential IDs are generated. Optional per-row since / until (string-typed) and survey_resource_id columns override bulk values per-AOI.
The exporter writes results to {output_dir}/final/:
A {output_dir}/chunks/ directory holds intermediate per-chunk results during processing and enables resume after interruption. A chunk counts as done once its rollup file is written, which happens only after every other file for that chunk was written. If any chunk is left unfinished (a failed write, or an API that answered nothing), the export exits with an error naming those chunks instead of writing the merged outputs; re-running the same command re-processes only those chunks, reusing cached API responses. A run into an output directory that already holds chunks must use the settings that wrote them: only processes, threads, merge_read_workers, max_retries and the cache options (cache_dir, compress_cache, no_cache, overwrite_cache) may change, and the order of packs, classes and include doesn't matter. Any other change, chunk_size included, stops the exporter before it starts; use a new output directory, or delete chunks/, to export with new settings.
For column-level documentation, open final/README.md from your export — it always reflects exactly what's in the files (including any 3D / prefer3d / pack-specific columns).
Pass an s3:// URI as output_dir to write directly to Amazon S3:
Any AOI larger than 1 km² is automatically gridded — split into 0.005° (~550 m) cells, processed in parallel, then recombined and deduplicated. No configuration needed for the common case:
Every Python API option has a CLI equivalent. See python -m nmaipy.exporter --help for the full list. Highlights:
python -m nmaipy.exporter \ --aoi-file "parcels.geojson" \ --output-dir "results" \ --country us \ --packs building vegetation \ --save-features \ --roof-age Key options:
If you only need roof age data with no Feature API calls:
python -m nmaipy.roof_age_exporter \ --aoi-file "us_properties.geojson" \ --output-dir "roof_age_results" \ --country us \ --processes 4 \ --output-format both Accepts the same --roof-age-dataset, --until, --since flags as the unified exporter (with the same A.0-dataset rejection rule). See python -m nmaipy.roof_age_exporter --help for all options.
Event-scoped, building-level conflated damage for a catastrophe event (requires --event-id). Resolve the event id from a point inside the damage zone, then export your AOIs (e.g. properties) inside its footprint:
# Resolves to 442c3974-5b6c-5335-a6e4-83b5b9afc8b7 (Hurricane Isaias, event date 2026-10-09) EVENT_ID=$(python -c "from nmaipy.coverage_utils import latest_event_id_at_point; print(latest_event_id_at_point(30.15465, -85.76716, since='2026-10-09', until='2026-12-31'))") python -m nmaipy.damage_conflation_exporter \ --aoi-file "us_properties.geojson" \ --output-dir "damage_results" \ --event-id "$EVENT_ID" \ --country us \ --processes 4 \ --threads 1 \ --max-retries 20 \ --output-format both \ --rollup Outputs in final/:
The conflation API is map-style: every building intersecting an AOI is returned, including neighbours' buildings that only clip a parcel boundary. For property-sized AOIs, --parcel-mode drops buildings that barely intersect their AOI (kept when at least 50% of the building lies inside it, or its in-AOI footprint is at least 30 sqm so multi-parcel structures such as townhouse rows survive). It is a client-side approximation of the Feature API's parcelMode; nothing is clipped. Off by default.
See python -m nmaipy.damage_conflation_exporter --help for all options.
Author/Maintainer: Nearmap AI Systems
Both files in this release have provenance metadata.
aerial ai buildings geospatial gis imagery nearmap vegetation
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.
Both files in this release have been uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Nov 20, 2026 2 release files Full provenance
Nov 11, 2026 2 release files No provenance
Nov 9, 2026 2 release files No provenance
Nov 6, 2026 2 release files No provenance
Nov 5, 2026 2 release files No provenance
Nov 3, 2026 2 release files No provenance
Oct 27, 2026 2 release files No provenance
Oct 15, 2026 2 release files No provenance
Aug 1, 2026 2 release files No provenance
Jul 31, 2026 2 release files No provenance
Jul 29, 2026 2 release files No provenance
Jul 28, 2026 2 release files No provenance
Jul 17, 2026 2 release files No provenance
Jul 15, 2026 2 release files No provenance
Jul 5, 2026 2 release files No provenance
Jul 1, 2026 2 release files No provenance
Jun 29, 2026 2 release files No provenance
Jun 26, 2026 2 release files No provenance
Jun 25, 2026 2 release files No provenance
Jun 11, 2026 2 release files No provenance
Jun 10, 2026 2 release files No provenance
Jun 5, 2026 2 release files No provenance
Jun 3, 2026 2 release files No provenance
Jun 2, 2026 2 release files No provenance
Jun 1, 2026 2 release files No provenance
May 29, 2026 2 release files No provenance
May 28, 2026 2 release files No provenance
May 27, 2026 2 release files No provenance
May 26, 2026 2 release files No provenance
May 25, 2026 2 release files No provenance
May 24, 2026 2 release files No provenance
May 23, 2026 2 release files No provenance
May 22, 2026 2 release files No provenance
May 20, 2026 2 release files No provenance
May 19, 2026 2 release files No provenance
May 17, 2026 2 release files No provenance
May 15, 2026 2 release files No provenance
May 14, 2026 2 release files No provenance
May 13, 2026 2 release files No provenance
May 12, 2026 2 release files No provenance
May 11, 2026 2 release files No provenance
May 9, 2026 2 release files No provenance
May 8, 2026 2 release files No provenance
May 7, 2026 2 release files No provenance
May 3, 2026 2 release files No provenance
Apr 30, 2026 2 release files No provenance
Apr 23, 2026 2 release files No provenance
Apr 22, 2026 2 release files No provenance
Apr 20, 2026 2 release files No provenance
Apr 2, 2026 2 release files No provenance
Mar 31, 2026 2 release files No provenance
Mar 30, 2026 2 release files No provenance
Mar 29, 2026 2 release files No provenance
Mar 27, 2026 2 release files No provenance
Mar 26, 2026 2 release files No provenance
Mar 25, 2026 2 release files No provenance
Mar 24, 2026 2 release files No provenance
Mar 20, 2026 2 release files No provenance
Mar 19, 2026 2 release files No provenance
Mar 12, 2026 2 release files No provenance
Mar 9, 2026 2 release files No provenance
Mar 8, 2026 2 release files No provenance
Mar 6, 2026 2 release files No provenance
Mar 5, 2026 2 release files No provenance
Mar 4, 2026 2 release files No provenance
Mar 3, 2026 2 release files No provenance
Mar 2, 2026 2 release files No provenance
Feb 27, 2026 2 release files No provenance
Feb 24, 2026 2 release files No provenance
Feb 23, 2026 2 release files No provenance
Feb 22, 2026 2 release files No provenance
Feb 20, 2026 2 release files No provenance
Feb 19, 2026 2 release files No provenance
Feb 17, 2026 2 release files No provenance
Feb 16, 2026 2 release files No provenance
Feb 12, 2026 2 release files No provenance
Feb 3, 2026 2 release files No provenance
Feb 2, 2026 2 release files No provenance
Jan 28, 2026 2 release files No provenance
Jan 27, 2026 2 release files No provenance
Jan 26, 2026 2 release files No provenance
Jan 25, 2026 2 release files No provenance
Jan 22, 2026 2 release files No provenance
Jan 15, 2026 2 release files No provenance
Jan 14, 2026 2 release files No provenance
Jan 13, 2026 2 release files No provenance
Jan 12, 2026 2 release files No provenance
Jan 6, 2026 2 release files No provenance
Dec 19, 2025 2 release files No provenance
Dec 18, 2025 2 release files No provenance
Dec 17, 2025 2 release files No provenance
Dec 12, 2025 2 release files No provenance
Dec 11, 2025 2 release files No provenance
Nov 25, 2025 2 release files No provenance
Nov 20, 2025 2 release files No provenance
Nov 18, 2025 2 release files No provenance
Nov 8, 2025 2 release files No provenance
Nov 7, 2025 2 release files No provenance
Nov 6, 2025 2 release files No provenance
Nov 3, 2025 2 release files No provenance
Oct 30, 2025 2 release files No provenance
Oct 28, 2025 2 release files No provenance
Sep 25, 2025 2 release files No provenance
Aug 26, 2025 2 release files No provenance




