Skip to main content

Layer Endpoints

Create and manage both map and weather layers using the unified API with type discrimination.

GET /layers

Retrieves all layers (both map and weather) for the authenticated user.
# List all layers
layers = client.layers.list_layers()

GET /layers/

Retrieves a specific layer by ID.
# Get a specific layer by ID string
layer = client.layers.get_layer("layer_123")

# Or if you have a layer object
layer = client.layers.get_layer(layer.id)

POST /layers

Creates a new layer using the discriminator pattern. The type field determines required parameters.
# Create a weather layer
weather_layer = client.layers.create_layer(
    name="Wind Speed at 100m",
    type="wl:RasterLayer",
    weather_model_id="ECMWF_IFS",
    variable="WindSpeed",
    altitude=100,
    run_hour=12,
    run_day="2025-01-15",
    deckgl_props={...}
)

# Create a map layer
map_layer = client.layers.create_layer(
    name="Wind Turbines",
    type="ScatterPlotLayer",
    dataset_id="dataset_123",
    deckgl_props={...}
)

PUT /layers/

Updates an existing layer. All layer fields (name, type, and type-specific fields) are required.
# Update a layer by ID string
updated_layer = client.layers.update_layer(
    "layer_123",
    name="Updated Wind Speed Layer",
    type="wl:RasterLayer",
    weather_model_id="ECMWF_IFS",
    variable="WindSpeed",
    altitude=100,
    run_hour=18,
    run_day="2025-01-15",
    deckgl_props={...}
)

# Or if you have a layer object
updated_layer = client.layers.update_layer(
    layer.id,
    name="Updated Wind Speed Layer",
    type="wl:RasterLayer",
    weather_model_id="ECMWF_IFS",
    variable="WindSpeed",
    altitude=100,
    run_hour=18,
    run_day="2025-01-15",
    deckgl_props={...}
)

DELETE /layers/

Permanently deletes a layer by ID.
# Delete a layer by ID string
client.layers.delete_layer("layer_123")

# Or if you have a layer object
client.layers.delete_layer(layer.id)

Layer Types

Weather Layer Types

  • wl:RasterLayer - Raster weather data visualization
  • wl:ParticleLayer - Particle-based weather visualization
  • wl:IsolineLayer - Contour/isoline weather visualization

Map Layer Types

  • ScatterPlotLayer - Point-based geospatial data
  • GeoJsonLayer - GeoJSON polygon/line data

Required Parameters

Weather Layers

  • Common: name, type, weather_model_id, variable, altitude
  • Forecast Models: run_hour, run_day (YYYY-MM-DD format)
  • Historical Models (ERA5): No run parameters needed

Map Layers

  • Common: name, type, dataset_id
  • Optional: deckgl_props, ui_config