Skip to content

Threedimodels💡

The threedimodels endpoint shows various details about your threedimodels.

Threedimodels available for simulating

Only models which have inp_success=True and disabled=False can be started as simulations.

Read💡

List available threedimodels for the organisations you are a member of.

GET /threedimodels/

Warning

By default threedimodels with the following attributes are excluded from the results

- inactive_inpy_versions=True
- disabled=True
- inp_success=False

If you want to disable any of these filters you have to include the fields query string parameter explicitly in the request, e.g ?inactive_inpy_versions=True

Ordering options

Fields that can be used to order the results

  • created [default]: Time of creation, newest first.
  • name: name of the simulation resource
  • id: numerical identifier

see ordering for general ordering options.

Gridadmin💡

Each threedimodel for which you can start a simulation has a gridadmin.h5 file available. The gridadmin.h5 file stores the grid administration of your 3Di model. It can be used in combination with threedigrid for detailed analysis on the threedimodel and simulation results.

Download the gridadmin file of a specific threedimodel.

GET /threedimodels/{id}/gridadmin/download/

import requests
from threedi_api_client.api import ThreediApi
from threedi_api_client.versions import V3Api

with ThreediApi() as api_client:
    api_client: V3Api

    download_url = api_client.threedimodels_gridadmin_download("<threedimodel-id>")

    file_path = "./gridadmin.h5"
    r = requests.get(download_url.get_url)
    with open(file_path, "wb") as f:
        for chunk in r.iter_content(chunk_size=8192):
            f.write(chunk)

Geojson💡

Under the endpoint /threedimodels/{id}/geojson/<category>/ you can find the geojson of a threedimodel, stored as a geojson FeatureCollection. Several different categories are available:

  • all
  • breaches
  • cells
  • channels
  • culverts
  • levees
  • manholes
  • orifices
  • pipes
  • pumps
  • weirs

Geojson ALL

The geojson category 'all' is a FeatureCollection of all above mentioned categories except cells.

The request will respond with a JSON object containing a get_url, etag and size. Make a GET request to the get_url to download the actual geojson file:

{
    "get_url": "url",
    "etag": "string",
    "size": "int"
}

Missing features

When a model does not contain any features of a category, the endpoint will respond with a "400: geojson file not found"

Rasters💡

List all available rasters of your 3Di model, such as the DEM, initial waterlevels, infiltration rate, etc.

GET /threedimodels/{id}/rasters/

Saved States💡

List all saved states that have been created for this 3Di model.

GET /threedimodels/{threedimodel_pk}/saved_states/

Saved states allow you to start a simulation in a specified state, defined in a previous simulation of the same threedimodel.

POST /simulations/{simulation_pk}/initial/saved_state/

A saved states become available for a threedimodel when a you run a simulation on that model with the events:

  • /simulations/{simulation_pk}/create-saved-states/stable-threshold/
  • /simulations/{simulation_pk}/create-saved-states/timed/

For more information on how to create a saved-states, see create-saved_states.

Expiry

Saved states expire 7 days after creation

Ordering options

Fields that can be used to order the results

  • created [default]: Time of creation, newest first.
  • name: name of the simulation resource
  • id: numerical identifier

see ordering for general ordering options.