Flood Alignment Pipeline — Reference

Data Loading Guide:
Assets & Protection Measures

Every pathway for bringing Rhino geometry, GeoJSON features, HATS alignments, and building assets into the FloodAdapt analysis system. For how to format your data before loading, see the Data Formatting Guide.

v2.1 · March 2026

01Overview

Companion Guide

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.

Rhino / DXF / GeoJSON ingest_cad.py protection_measures/ AlignmentLibrary FloodAdapt DB

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.

Terminal
# 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
Tip

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.

Limitation

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:

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.

Directory Structure
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.

HATS ArcGIS WFS fetch_hats_alignments.py hats_source.geojson AlignmentLibrary Barrier measures + tie-ins

Key HATS features loaded:

Tie-in Extensions

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.

config/university_heights.yaml
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 IDTypeDescription
auto:harlem_frontlineleveeHarlem River frontline barrier alignment
auto:harlem_setback_75mlevee75m setback alignment from shoreline
auto:macombs_dam_basinretentionMacombs Dam retention basin
auto:university_ave_corridorgreen_infraUniversity Ave green infrastructure network
auto:mcclellan_pump_stationpumpMcClellan 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 TypeGeometryKey PropertiesEffect 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

PropertyTypeDescription
measure_typestring requiredlevee, seawall, or gate
measure_namestring requiredHuman-readable identifier (e.g., "East Harlem — Seawall")
crest_elevation_mfloat requiredTop-of-barrier elevation in metres NAVD88
width_mfloat optionalStructural width for DEM rasterization (default: 2.0m)
scenariostring optionalAlignment scenario identifier
scenario_labelstring optionalHuman-readable scenario name
capacity_m3float optionalStorage capacity (null for barriers)
hats_objectidint optionalHATS database record ID (for traceability)
hats_featurestring optionalHATS feature class (Seawall, Floodwall, Levee, etc.)
hats_feature_typestring optionalSpecific HATS sub-type
hats_projectstring optionalHATS project area (East Harlem, Inwood, Bronx, etc.)
hats_iff_rrr_sbmstring optionalHATS classification: SBM (Storm Surge Barrier), IFF (Interior Flood Front)
is_tie_inbool optionalAuto-generated tie-in to high ground (styled as dashed line)

Stormwater Measures

Measure TypeGeometryKey PropertiesEffect 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

PropertyTypeDescription
measure_typestring requiredpump, retention, or green_infra
measure_namestring requiredIdentifier
capacity_cmsfloatPump flow rate in m³/s (pump only, default: 5.0)
capacity_m3floatStorage volume in m³ (retention only, default: 10,000)
infiltration_rate_mm_hrfloatSoil infiltration rate (retention, default: 5.0)
retention_pctfloatFraction 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 TypeEffectKey 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
Selection Types

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.

NYC Building Footprints + PLUTO enrichment + FFE computation buildings_processed.gpkg

The pipeline performs these enrichment steps:

  1. Downloads footprints from the 5zhs-2jue dataset (WGS84)
  2. Joins with PLUTO tax-lot data by BBL to get assessed values and land use codes
  3. Maps NYC building class codes to standardized use categories
  4. Computes first-floor elevation (FFE) by use category

Default First-Floor Heights

Use CategoryFFE Above GradeRationale
single_family0.46 m (18")Typical raised foundation
multi_family0.30 m (12")Lower entry, often at grade
commercial0.00 mSlab on grade
industrial0.00 mSlab 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

PropertyTypeDescription
use_categorystring requiredsingle_family, multi_family, commercial, industrial, miscellaneous
height_mfloat optionalBuilding height in metres
replacement_value_usdfloat optionalFull replacement cost for damage calculation
ground_elevation_mfloat optionalGround elevation (NAVD88); sampled from DEM if omitted
first_floor_height_mfloat optionalHeight 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.

Protection Measure GeoJSON
{
  "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
      }
    }
  ]
}
Custom Buildings GeoJSON
{
  "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.

buildings custom_buildings/ barriers protection_measures/barriers/ levee protection_measures/barriers/ seawall protection_measures/barriers/ gate protection_measures/barriers/ platform protection_measures/barriers/ pump protection_measures/stormwater/ retention protection_measures/stormwater/ green_infra protection_measures/stormwater/ stormwater protection_measures/stormwater/ building_prot protection_measures/building/

Default Properties per Layer

Each layer has defaults that apply unless overridden by Rhino User Text on individual objects:

Layermeasure_typeDefaults
barriersleveecrest_elevation_m: 3.5
leveeleveecrest_elevation_m: 3.5
seawallseawallcrest_elevation_m: 3.5
gategatecrest_elevation_m: 3.5
platformleveecrest_elevation_m: 4.064 (13'4"), width_m: 0
pumppumpcapacity_cms: 5.0
retentionretentioncapacity_m3: 10,000
green_infragreen_infraretention_pct: 0.25
stormwaterretention(generic stormwater catch-all)
building_protfloodproof(building-level protection)
buildingsuse_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.

Rhino Command Line
// 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"
Tip

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 TypeGeoJSON OutputNotes
PointPointX, Y only (Z discarded). Use for pump stations.
Line / PolylineLineStringVertices extracted directly. Use for barriers.
Closed CurvePolygonAuto-detected from IsClosed. Use for buildings, retention basins.
NurbsCurve / ArcCurveLineStringSampled along parameter domain (0.5m intervals, max 500 pts).
PolyCurveLineStringComposite curves sampled as single geometry.
ExtrusionPolygonBase profile wireframe extracted, convex hull computed.
BrepPolygonMeshed, then convex hull of mesh vertices.
MeshPolygonConvex hull of mesh vertices (2D projection).
3D → 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.

StageCRSEPSGUnits
Rhino source (default)UTM Zone 18N32618metres
GeoJSON storageWGS844326degrees
SFINCS model gridUTM Zone 18N32618metres
DEM (USGS 3DEP)WGS84 or UTM 18N4326 / 32618metres (vertical)
Webapp displayWeb Mercator3857metres (via Leaflet)

Override the source CRS for Rhino/DXF files with --source-crs. Common alternatives for NYC:

Vertical Datum

All elevations are in NAVD88 (metres). The pipeline defines offsets for other datums:

DatumOffset from NAVD88
NAVD880.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.

Database Structure
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:

09Format Comparison

Feature
Rhino .3dm
DXF
Per-object attributes
Full (User Text)
Limited (xdata)
Curve accuracy
Native NURBS
Spline support
Closed polygon detection
IsClosed
closed flag
3D solid → 2D footprint
Brep, Mesh, Extrusion
Not supported
Object naming
Object Name → _name
Not extracted
Python dependency
rhino3dm
ezdxf
Feature
Direct GeoJSON
YAML Config
Geometry source
Embedded coordinates
File reference or preset
Attribute flexibility
Unlimited properties
Config-defined
CRS requirement
Must be WGS84
Inherited from file
Building-level measures
Spatial only
All measure types
Auto-discovery
Drop into directory
Must list in config
Best for
GIS teams, scripted export
Reproducible scenarios
Recommended Workflow

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.