sample_elevations
Sample ground elevations from a bundled 10m DEM for WGS84 points or network nodes, returning interpolated meters per location to support EPANET model creation.
Instructions
Sample real ground elevations from the bundled IFSAR 10 m DEM (Philippines) for WGS84 points, or for the nodes of a loaded network whose x/y coordinates are WGS84 (or UTM with a zone). Pure read — nothing is modified. Returns elevation in meters per point, bilinearly interpolated from the 2x2 pixel neighborhood; points outside the tile grid or over nodata come back with elevation null. The bundled DEM is the default elevation source for create_network (elevationSource), so this is the first call in the GIS workflow: sample, then build or set_node_elevation. Configure the data folder with EPANET_DEM_DIR (defaults to the repo's apps/app/public/dem/ifsar-10m).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| points | No | WGS84 points to sample. Provide exactly one of points or networkId. | |
| source | No | Elevation source; defaults to the bundled IFSAR 10 m DEM. | |
| nodeIds | No | When sampling a network, restrict to these node ids; omit for all nodes with coordinates. | |
| networkId | No | Sample the loaded network's node coordinates instead of explicit points. Provide exactly one of points or networkId. | |
| coordinates | No | How the network's stored x/y coordinates map to WGS84 (defaults to wgs84). |