By default, the rf-engine uses the public OpenTopoData API, which is rate-limited. For unlimited local queries and better performance, you can self-host the OpenTopoData service using the included Docker configuration.
The service is already configured in docker-compose.yml, but it requires you to manually download the elevation data files for your region.
Ensure the following directory exists in your project root:
data/opentopodata/(The Docker service maps this folder to /app/data inside the container)
meshRF is configured to use the NED 10m dataset (high resolution for US) by default.
-
Find your grid: Portland, Oregon is located at approximately N45 W122.
-
Download the file: You need the
.hgtor.tiffiles for this region.- Source: USGS National Map or via OpenTopography.
- Direct Download (NED 10m): Look for files named like
n45w123.hgtor similar 1-arc-second data.
For this example, download the 1-arc-second SRTM or NED file for N45W123.
-
Place the file: Move the downloaded
.hgt(or.tif) file intodata/opentopodata/.meshrf/ ├── data/ │ └── opentopodata/ │ └── n45w123.hgt <-- Place file here
If you would like to download larger datasets to support an entire region we have created a tool for batch processing with guides on batch downloads from USGS meshRF Datasets Tool
The service requires a config.yaml file to define the datasets. Only the config.yaml is tracked by git; the data files are ignored.
Create or edit data/opentopodata/config.yaml:
Example:
datasets:
- name: ned10m
path: /app/data/ned10m/
filename_epsg: 4269
filename_tile_size: 1
wgs84_bounds:
left: -125
right: -115
bottom: 41
top: 50If you downloaded a different dataset type (e.g., SRTM 30m instead of NED 10m), update the ELEVATION_DATASET environment variable in docker-compose.yml:
rf-engine:
environment:
- ELEVATION_API_URL=http://opentopodata:5000
- ELEVATION_DATASET=srtm30m # Change to match your data (srtm30m, srtm90m, ned10m, etc.)Restart the services to pick up the new data:
docker-compose restart rf-engineThe service scans the data folder on startup. If successful, http://localhost:5000/v1/ned10m?locations=45.5,-122.6 should return valid elevation data.