01Overview
This guide covers the mechanics of loading data into the pipeline — which commands to run, where to place files, and how the system discovers and processes them. For detailed instructions on how to format and prepare your data in Rhino or ArcGIS Pro (geometry types, attribute coding, coordinate systems, export settings), see the Data Formatting Guide: Rhino & ArcGIS Pro.
The flood alignment pipeline accepts data through five distinct pathways, each suited to a different stage of the design workflow. Data flows from source formats into pipeline-ready GeoJSON, then into the FloodAdapt database for SFINCS hydrodynamic simulation and FIAT damage assessment.
Two categories of features can be loaded: protection measures (barriers, stormwater infrastructure, building-level adaptations) and building assets (exposure data for damage calculation).
02Loading Pathways
Rhino .3dm Files
Native Rhino files with full User Text attribute support. Best for design teams working in Rhino/Grasshopper.
DXF / DWG Files
AutoCAD interchange. Limited attribute support via extended data (xdata). DWG has partial support.
Direct GeoJSON
Drop GeoJSON files into protection_measures/ subdirectories. Fully manual but most flexible.
HATS WFS Source
Fetch city-published alignments from the HATS ArcGIS service. Auto-generates tie-in extensions to high ground.
YAML Configuration
Declare measures in config/*.yaml with references to preset geometries or external files.
NYC Open Data
Automatic building footprint download + PLUTO enrichment for exposure data. No manual input needed.
Rhino .3dm Files
The ingest_cad.py script reads native Rhino .3dm files using the
rhino3dm Python library. This is the recommended pathway for design teams
because it preserves per-object attributes set via Rhino's SetUserText command.
# Basic usage (defaults to UTM 18N source CRS) python scripts/ingest_cad.py my_design.3dm # Specify source CRS (e.g., NY State Plane) python scripts/ingest_cad.py my_design.3dm --source-crs EPSG:2263 # Custom layer mapping + output directory python scripts/ingest_cad.py my_design.3dm --layer-config layers.yaml --output-dir ./pipeline # Dry run (preview without writing) python scripts/ingest_cad.py my_design.3dm --dry-run
Use --dry-run first to verify layer mapping before writing files.
The script prints a summary showing how many objects per layer and where they'll be written.
Layer names in the Rhino file are normalized to lowercase with underscores. The script maps each layer to a pipeline target directory and applies default properties (which can be overridden per-object via User Text).
DXF / DWG Files
DXF files are read using ezdxf. The same ingest_cad.py script
handles DXF input with identical layer mapping. Per-object attributes are extracted from
extended data (xdata) tags in key=value format.
DWG support is partial and may not read all entity types. If your source is AutoCAD, export to DXF (or open in Rhino and save as .3dm) for best results. DXF xdata attribute support is more limited than Rhino User Text.
Supported DXF entity types:
POINT→ Point geometry (pump stations, markers)LINE→ LineString (simple barriers)LWPOLYLINE/POLYLINE→ LineString or Polygon (if closed)CIRCLE→ Polygon (buffered point)ARC→ LineString (sampled along arc)SPLINE→ LineString or Polygon (flattened)ELLIPSE→ Polygon (flattened)HATCH→ Polygon / MultiPolygon (from boundary paths)
Direct GeoJSON
The most direct method: create or export GeoJSON files and place them in the appropriate
subdirectory. The AlignmentLibrary auto-discovers all .geojson files
under protection_measures/ at runtime.
protection_measures/ ├── barriers/ │ ├── frontline_seawall.geojson # levees, gates, walls │ └── my_custom_barrier.geojson ├── stormwater/ │ ├── pump_stations.geojson # pumps, retention, green infra │ └── bioswale_network.geojson └── building/ └── floodproofing_zone.geojson # building-level measures custom_buildings/ └── my_buildings.geojson # custom building footprints
GeoJSON files must be in WGS84 (EPSG:4326). The pipeline handles reprojection to the study area CRS internally. See the GeoJSON schema section for required properties.
HATS WFS Source
The fetch_hats_alignments.py script downloads published flood protection
alignments from NYC's HATS (Harbor and Tributaries Study) ArcGIS WFS service.
These are city-engineered alignment scenarios with defined crest elevations and feature types.
Key HATS features loaded:
- Seawalls — continuous shoreline barriers
- Floodwalls (large / medium) — inland flood barriers
- Levees (large / small) — earthen embankments
- Deployable flood barriers — vehicle gates, pedestrian gates
The pipeline automatically extends barrier endpoints to nearby high ground using the DEM.
It searches for terrain cells at or above the barrier's crest elevation and draws connecting
LineStrings. These are styled as dashed lines and marked is_tie_in: true.
YAML Configuration
Measures can be declared in the study area config file under protection_alignments.
This supports referencing preset geometries, external GeoJSON files, or GeoPackage files.
protection_alignments: - name: "harlem_river_frontline" measures: # Reference a preset geometry generator - type: "levee" geometry: "auto:harlem_frontline" crest_elevation_m: 5.33 # Reference an external GeoJSON file - type: "levee" geometry: "my_barrier.geojson" crest_elevation_m: 4.5 width_m: 2.0 # Green infrastructure preset - type: "green_infra" geometry: "auto:university_ave_corridor" # Building-level measures (no geometry needed) - type: "elevate_properties" elevation_increase_ft: 2.0 selection_type: "all"
Available Preset Geometries
| Preset ID | Type | Description |
|---|---|---|
| auto:harlem_frontline | levee | Harlem River frontline barrier alignment |
| auto:harlem_setback_75m | levee | 75m setback alignment from shoreline |
| auto:macombs_dam_basin | retention | Macombs Dam retention basin |
| auto:university_ave_corridor | green_infra | University Ave green infrastructure network |
| auto:mcclellan_pump_station | pump | McClellan St pump station |
03Protection Measure Types
The pipeline supports three categories of protection measures: barrier (spatial flood barriers), stormwater (drainage infrastructure), and building-level (per-property adaptations). Each has a distinct geometry type and required properties.
Barrier Measures (Spatial)
Barrier measures are LineString geometries that modify the SFINCS model terrain. During simulation, levee crest elevations are rasterized onto the DEM grid, blocking water flow across the barrier alignment.
| Measure Type | Geometry | Key Properties | Effect on Model |
|---|---|---|---|
| levee | LineString | crest_elevation_m, width_m |
Raises DEM cells along alignment to crest elevation |
| seawall | LineString | crest_elevation_m, width_m |
Same as levee (treated identically in SFINCS) |
| gate | LineString | crest_elevation_m |
Deployable barrier; raises DEM when closed |
Barrier Properties Reference
| Property | Type | Description |
|---|---|---|
| measure_type | string required | levee, seawall, or gate |
| measure_name | string required | Human-readable identifier (e.g., "East Harlem — Seawall") |
| crest_elevation_m | float required | Top-of-barrier elevation in metres NAVD88 |
| width_m | float optional | Structural width for DEM rasterization (default: 2.0m) |
| scenario | string optional | Alignment scenario identifier |
| scenario_label | string optional | Human-readable scenario name |
| capacity_m3 | float optional | Storage capacity (null for barriers) |
| hats_objectid | int optional | HATS database record ID (for traceability) |
| hats_feature | string optional | HATS feature class (Seawall, Floodwall, Levee, etc.) |
| hats_feature_type | string optional | Specific HATS sub-type |
| hats_project | string optional | HATS project area (East Harlem, Inwood, Bronx, etc.) |
| hats_iff_rrr_sbm | string optional | HATS classification: SBM (Storm Surge Barrier), IFF (Interior Flood Front) |
| is_tie_in | bool optional | Auto-generated tie-in to high ground (styled as dashed line) |
Stormwater Measures
| Measure Type | Geometry | Key Properties | Effect on Model |
|---|---|---|---|
| pump | Point | capacity_cms |
Removes water at flow rate (m³/s) from model cells |
| retention | Polygon | capacity_m3, infiltration_rate_mm_hr |
Stores and infiltrates stormwater within footprint |
| green_infra | Polygon | retention_pct |
Retains percentage of rainfall within network area |
Stormwater Properties Reference
| Property | Type | Description |
|---|---|---|
| measure_type | string required | pump, retention, or green_infra |
| measure_name | string required | Identifier |
| capacity_cms | float | Pump flow rate in m³/s (pump only, default: 5.0) |
| capacity_m3 | float | Storage volume in m³ (retention only, default: 10,000) |
| infiltration_rate_mm_hr | float | Soil infiltration rate (retention, default: 5.0) |
| retention_pct | float | Fraction of rainfall retained (green_infra, default: 0.25) |
Building-Level Measures
These measures modify the damage calculation rather than the hydrodynamic model.
They don't require spatial geometry and are applied to buildings matching a selection criteria.
Defined via YAML config or the building_prot layer in Rhino.
| Measure Type | Effect | Key Properties |
|---|---|---|
| elevate_properties | Raises first-floor height, reducing depth above FFE in damage curves | elevation_increase_ft (default: 1.0), selection_type |
| buyout_properties | Removes buildings from damage calculation entirely (acquisition/demolition) | selection_type (polygon for area-based, all) |
| floodproof_properties | Reduces damage below a depth threshold (dry/wet floodproofing) | floodproof_depth_ft (default: 1.0), selection_type |
all — applies to every building in the study area.
polygon — applies to buildings whose footprint intersects a selection polygon (set geometry in Rhino as a closed curve on the building_prot layer).
04Building Assets
Automatic: NYC Open Data Pipeline
The DataProcessor in preprocessing.py automatically downloads
and enriches building data from NYC Open Data. This is the default for any study area
within NYC.
The pipeline performs these enrichment steps:
- Downloads footprints from the
5zhs-2juedataset (WGS84) - Joins with PLUTO tax-lot data by BBL to get assessed values and land use codes
- Maps NYC building class codes to standardized use categories
- Computes first-floor elevation (FFE) by use category
Default First-Floor Heights
| Use Category | FFE Above Grade | Rationale |
|---|---|---|
| single_family | 0.46 m (18") | Typical raised foundation |
| multi_family | 0.30 m (12") | Lower entry, often at grade |
| commercial | 0.00 m | Slab on grade |
| industrial | 0.00 m | Slab on grade |
Custom Buildings (from Rhino or GeoJSON)
For buildings not in the NYC database (proposed developments, hypothetical scenarios),
place GeoJSON files in custom_buildings/ or use the buildings
layer in a Rhino file.
Custom Building Properties
| Property | Type | Description |
|---|---|---|
| use_category | string required | single_family, multi_family, commercial, industrial, miscellaneous |
| height_m | float optional | Building height in metres |
| replacement_value_usd | float optional | Full replacement cost for damage calculation |
| ground_elevation_m | float optional | Ground elevation (NAVD88); sampled from DEM if omitted |
| first_floor_height_m | float optional | Height of first floor above grade; uses default by use_category if omitted |
Custom buildings should have Polygon geometry (closed curves in Rhino).
The damage model samples flood depth at the polygon centroid and applies HAZUS
depth-damage curves based on the use_category.
05GeoJSON Schemas
All GeoJSON files in the pipeline use the same FeatureCollection wrapper with additional metadata fields at the collection level.
{ "type": "FeatureCollection", "name": "frontline_seawall", // machine identifier "label": "Frontline Seawall", // display name "description": "Seawall along...", // optional description "category": "barriers", // barriers | stormwater | building "features": [ { "type": "Feature", "geometry": { "type": "LineString", "coordinates": [[-73.935, 40.836], [-73.934, 40.839]] }, "properties": { "measure_type": "levee", "measure_name": "East Harlem — Seawall", "crest_elevation_m": 5.33, "width_m": 2.5 } } ] }
{ "type": "FeatureCollection", "name": "proposed_development", "label": "Proposed Development", "features": [ { "type": "Feature", "geometry": { "type": "Polygon", "coordinates": [[[-73.914, 40.862], ...]] }, "properties": { "use_category": "multi_family", "height_m": 15.5, "replacement_value_usd": 500000, "first_floor_height_m": 0.46 } } ] }
06Rhino Layer Setup
Layer Name → Pipeline Target Mapping
Name your Rhino layers using these conventions. Layer names are case-insensitive and spaces are converted to underscores. Any unmapped layer is skipped with a warning.
Default Properties per Layer
Each layer has defaults that apply unless overridden by Rhino User Text on individual objects:
| Layer | measure_type | Defaults |
|---|---|---|
| barriers | levee | crest_elevation_m: 3.5 |
| levee | levee | crest_elevation_m: 3.5 |
| seawall | seawall | crest_elevation_m: 3.5 |
| gate | gate | crest_elevation_m: 3.5 |
| platform | levee | crest_elevation_m: 4.064 (13'4"), width_m: 0 |
| pump | pump | capacity_cms: 5.0 |
| retention | retention | capacity_m3: 10,000 |
| green_infra | green_infra | retention_pct: 0.25 |
| stormwater | retention | (generic stormwater catch-all) |
| building_prot | floodproof | (building-level protection) |
| buildings | — | use_category: miscellaneous |
Per-Object Attributes via User Text
In Rhino, select an object and use SetUserText to attach key-value pairs.
These override layer defaults for that specific object.
// Select a barrier curve, then: SetUserText crest_elevation_m 5.33 SetUserText width_m 2.5 SetUserText measure_name "East Harlem Seawall Section A" // For a building polygon: SetUserText use_category multi_family SetUserText replacement_value_usd 1200000 SetUserText first_floor_height_m 0.46 // For a pump station point: SetUserText capacity_cms 12.5 SetUserText measure_name "West 225th St Pump"
Numeric values are automatically parsed. "5.0" becomes 5.0 (float)
and "100" becomes 100 (int). String values are kept as-is.
Object names (set via Properties panel) become the _name property
and are used as the measure_name fallback.
Rhino Geometry → GeoJSON Conversion
| Rhino Type | GeoJSON Output | Notes |
|---|---|---|
| Point | Point | X, Y only (Z discarded). Use for pump stations. |
| Line / Polyline | LineString | Vertices extracted directly. Use for barriers. |
| Closed Curve | Polygon | Auto-detected from IsClosed. Use for buildings, retention basins. |
| NurbsCurve / ArcCurve | LineString | Sampled along parameter domain (0.5m intervals, max 500 pts). |
| PolyCurve | LineString | Composite curves sampled as single geometry. |
| Extrusion | Polygon | Base profile wireframe extracted, convex hull computed. |
| Brep | Polygon | Meshed, then convex hull of mesh vertices. |
| Mesh | Polygon | Convex hull of mesh vertices (2D projection). |
All geometry is projected to 2D (X, Y only). Z coordinates are discarded.
Elevation data should be set via User Text (crest_elevation_m, ground_elevation_m)
rather than relying on Z values in the geometry. This ensures consistency with the NAVD88 vertical datum.
07Coordinate Reference Systems
The pipeline uses a two-CRS workflow: GeoJSON storage in WGS84 and analysis in a projected CRS.
| Stage | CRS | EPSG | Units |
|---|---|---|---|
| Rhino source (default) | UTM Zone 18N | 32618 | metres |
| GeoJSON storage | WGS84 | 4326 | degrees |
| SFINCS model grid | UTM Zone 18N | 32618 | metres |
| DEM (USGS 3DEP) | WGS84 or UTM 18N | 4326 / 32618 | metres (vertical) |
| Webapp display | Web Mercator | 3857 | metres (via Leaflet) |
Override the source CRS for Rhino/DXF files with --source-crs.
Common alternatives for NYC:
EPSG:2263— NY State Plane Long Island (US feet)EPSG:6539— NY State Plane Long Island (metres, NAD83 2011)EPSG:32618— UTM Zone 18N (metres) — default
Vertical Datum
All elevations are in NAVD88 (metres). The pipeline defines offsets for other datums:
| Datum | Offset from NAVD88 |
|---|---|
| NAVD88 | 0.00 m (reference) |
| MHHW | +0.67 m |
| MSL | +0.20 m |
| MLW | −0.50 m |
08FloodAdapt Database
All loaded data ultimately feeds into the FloodAdapt database, which orchestrates
SFINCS flood simulations and FIAT damage assessments. The database is built by
build_floodadapt_db.py using the DatabaseBuilder API.
floodadapt_db/university_heights/ ├── static/ │ ├── templates/ │ │ └── overland/ # SFINCS model template │ ├── config/ │ │ └── site.toml # Site configuration │ └── fiat/ │ └── geoms/ # Building footprints (exposure) ├── input/ │ ├── events/ # Flood scenarios (storm params) │ └── measures/ # Protection measures │ └── fw_Inwood___Large_Levee/ │ └── fw_*.geojson # Measure geometry in WGS84 └── output/ └── scenarios/ # Simulation results └── fa_10yr_surge/ ├── Flooding/ │ └── max_water_level_map.tif └── Impacts/ └── fiat_model/ └── results.gpkg
Protection measures placed in protection_measures/ are automatically
discovered by the AlignmentLibrary, which builds scenario combinations
and registers them with FloodAdapt. The database supports running any combination of:
- Events — 10yr, 25yr, 50yr, 100yr, 500yr storm surges with optional rainfall
- Climate scenarios — current, 2050, 2080, 2100 sea-level rise adjustments
- Protection scenarios — no protection (baseline), individual measures, or comprehensive (all combined)
09Format Comparison
IsClosedclosed flag_namerhino3dmezdxf
Design phase: Work in Rhino with named layers and User Text attributes.
Run ingest_cad.py --dry-run to preview, then ingest to produce GeoJSON files.
Analysis phase: GeoJSON files auto-discovered by the pipeline. Adjust
scenarios in YAML config. Run FloodAdapt simulations.
Iteration: Re-run ingest_cad.py after design changes —
output files are overwritten in place.