{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rijwind-com/json-schema/rijwind-com-signed-tile-url-schema.json",
  "title": "SignedTileUrl",
  "description": "Short-lived signed URL pointing at the basemap on `cdn.rijwind.com`. The signature is bound to the requester's IP and expires after a short TTL — refresh it within a tile session rather than re-signing on a fixed schedule (the `@rijwind/sdk` tile-session helper does this for you).",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rijwind-com-openapi.json#/components/schemas/SignedTileUrl",
  "properties": {
    "buildings": {
      "$ref": "#/$defs/BuildingsAccess",
      "description": "Access descriptor for the 3D-buildings tilesets. Always included —\nrendering 3D buildings is part of the same tile session, so it adds\nno quota cost. Compose the per-country tileset URL as\n`{baseUrl}/{CC}/tileset.json?{query}` and append the same query to\nevery tile it references. Refresh together with the tile URLs."
    },
    "expiresAt": {
      "description": "Unix timestamp (seconds) when the signature expires.",
      "format": "int64",
      "type": "integer"
    },
    "imagery": {
      "description": "Every satellite / aerial imagery archive available to this session,\nbottom → top: draw them in this order (later entries above earlier\nones — country aerials, highest resolution last). The named\n`satellite…Url` fields above point at the same archives and stay for\nexisting integrations; new countries only appear here. Empty when no\nimagery is available. Same session, no extra quota cost.",
      "items": {
        "$ref": "#/$defs/ImageryLayer"
      },
      "type": "array"
    },
    "satelliteBaseUrl": {
      "description": "Signed URL for the global base imagery archive (raster, z0–7) — ocean\nbathymetry and polar ice. Layer it BELOW the satellite source: the\nsatellite mosaic covers land only, so this is what fills open water\nand the poles. Same session, no extra quota cost.",
      "type": [
        "string",
        "null"
      ]
    },
    "satelliteBesUrl": {
      "description": "Signed URL for the Caribbean Netherlands aerial archive (raster,\nz13–21). A separate source from the mainland one — it reaches a deeper\nzoom — layered the same way. Same session, no extra quota cost.",
      "type": [
        "string",
        "null"
      ]
    },
    "satelliteNlUrl": {
      "description": "Signed URL for the high-resolution Netherlands aerial archive\n(raster, z13–18) — layer it above the global satellite source.\nSame session, no extra quota cost. Kept for existing integrations;\n`imagery` lists this archive and every other covered country.",
      "type": [
        "string",
        "null"
      ]
    },
    "satelliteOceanUrl": {
      "description": "Signed URL for the water-only overlay (raster, z0–7). Draw it ABOVE the\nsatellite source and fade it out past ~z9: the satellite mosaic covers\nwater poorly, so this renders the sea instead. Same session, no extra\nquota cost.",
      "type": [
        "string",
        "null"
      ]
    },
    "satelliteUrl": {
      "description": "Signed URL for the global satellite imagery archive (raster, z0–13).\nFeed it to a MapLibre `raster` source for the Satellite / Hybrid\nstyles. Present once satellite imagery is available on the account's\nregion; rendering it is part of the same tile session, so it adds no\nquota cost. Refresh together with the tile URLs.",
      "type": [
        "string",
        "null"
      ]
    },
    "terrainUrl": {
      "description": "Signed URL for the optional terrain (elevation) archive — feed it to a\nMapLibre `raster-dem` source with `encoding: \"terrarium\"` for hillshade\nor 3D terrain. Shares this session's expiry; refresh both together.\nRendering terrain is part of the same tile session, so it adds no quota\ncost.",
      "type": "string"
    },
    "traffic": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/TrafficAccess",
          "description": "Present when the request opted into the live traffic layer via\n`?traffic=`. Compose artifact URLs as `{baseUrl}/{path}?{query}` —\nthe signed query validates for every traffic artifact, so the\nrotating live-state filenames need no re-signing. Refresh together\nwith the tile URLs."
        }
      ]
    },
    "url": {
      "description": "Signed URL ready to feed to MapLibre's `pmtiles://` protocol handler.",
      "type": "string"
    }
  },
  "required": [
    "url",
    "expiresAt",
    "terrainUrl",
    "imagery",
    "buildings"
  ],
  "type": "object",
  "$defs": {
    "BuildingsAccess": {
      "description": "Access descriptor for the 3D-buildings tilesets (OGC 3D Tiles, real roof shapes): a CDN base URL plus a signed query string that validates for every tileset artifact beneath it. The `@rijwind/sdk` `Map` consumes this automatically when 3D buildings are shown.",
      "properties": {
        "baseUrl": {
          "description": "Buildings CDN origin to prepend to tileset paths.",
          "type": "string"
        },
        "countries": {
          "description": "Countries with 3D-building coverage (ISO 3166-1 alpha-2). The\ntileset for a country lives at `{baseUrl}/{CC}/tileset.json`.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "coverage": {
          "additionalProperties": {
            "items": {
              "format": "double",
              "type": "number"
            },
            "type": "array"
          },
          "description": "Bounding box `[west, south, east, north]` (WGS84) per covered country —\nuse it to load a country's tileset only when the viewport reaches it.",
          "propertyNames": {
            "type": "string"
          },
          "type": "object"
        },
        "expiresAt": {
          "description": "Unix timestamp (seconds) when the signature expires.",
          "format": "int64",
          "type": "integer"
        },
        "query": {
          "description": "Signed query string — append after `?` on any tileset artifact URL.",
          "type": "string"
        }
      },
      "required": [
        "baseUrl",
        "query",
        "expiresAt",
        "countries",
        "coverage"
      ],
      "type": "object"
    },
    "ImageryLayer": {
      "description": "One satellite or aerial imagery archive (raster PMTiles) in the session. Feed `url` to a MapLibre `raster` source through the `pmtiles://` protocol.",
      "properties": {
        "attribution": {
          "description": "Required credit as an HTML snippet — put it in the source's\n`attribution` so it shows in the map's attribution control. `null`\nwhen the source needs none.",
          "type": [
            "string",
            "null"
          ]
        },
        "bounds": {
          "description": "`[west, south, east, north]` (WGS84); `null` = global.",
          "items": {
            "format": "double",
            "type": "number"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "country": {
          "description": "Country the archive covers (ISO 3166-1 alpha-2); `null` = global.",
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "description": "Stable identifier of the archive (also a good MapLibre source id).",
          "type": "string"
        },
        "maxzoom": {
          "description": "Deepest zoom with tiles; beyond it the layer is overzoomed.",
          "format": "int32",
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "minzoom": {
          "description": "Lowest zoom with tiles (cross-fade an `aerial` layer in over the\nhalf zoom level above it).",
          "format": "int32",
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "region": {
          "description": "Optional part of the country, e.g. `Caribisch Nederland`.",
          "type": [
            "string",
            "null"
          ]
        },
        "role": {
          "description": "Where it sits in the stack: `base` (fills open ocean and the poles),\n`mosaic` (global satellite), `ocean` (water overlay — fade it out\npast ~z9), `aerial` (high-resolution country imagery).",
          "type": [
            "string",
            "null"
          ]
        },
        "url": {
          "description": "Signed archive URL; refresh together with the tile URLs.",
          "type": "string"
        }
      },
      "required": [
        "id",
        "url"
      ],
      "type": "object"
    },
    "TrafficAccess": {
      "description": "Access descriptor for the live traffic layer: a CDN base URL plus a signed query string that validates for every traffic artifact (geometry tiles, live state, incidents) beneath it.",
      "properties": {
        "baseUrl": {
          "description": "Traffic CDN origin to prepend to artifact paths.",
          "type": "string"
        },
        "countries": {
          "description": "Countries included in this grant (ISO 3166-1 alpha-2).",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "expiresAt": {
          "description": "Unix timestamp (seconds) when the signature expires.",
          "format": "int64",
          "type": "integer"
        },
        "query": {
          "description": "Signed query string — append after `?` on any artifact URL.",
          "type": "string"
        }
      },
      "required": [
        "baseUrl",
        "query",
        "expiresAt",
        "countries"
      ],
      "type": "object"
    }
  }
}