v1

latestOpenAPI 3.1.02026-07-1771114.6 KB
Maps

Upload file as layer

Uploads spatial data, processes it, and adds it as a layer to the specified map.

Supported formats:

  • Vector: Shapefile (as .zip), GeoJSON, GeoPackage, FlatGeobuf
  • Raster: GeoTIFF, DEM
  • Point cloud: LAZ, LAS

Once uploaded, Mundi transforms, reprojects, styles, and creates optimized formats for display in the browser. Vector data is converted to PMTiles while raster data is converted to cloud-optimized GeoTIFFs. Point cloud data is compressed to LAZ 1.3.

Returns the new layer details including its unique layer ID. The layer can optionally not be added to the map, but will be faster to add to an existing map later.

with open("brazil_watersheds.gpkg", "rb") as f:
    # project ID is PGJSkB1zj7fT, previous map ID is M4NzE8rk4FZS
    result = httpx.post(
        f"https://app.mundi.ai/api/maps/M4NzE8rk4FZS/layers",
        files={"file": ("brazil_watersheds.gpkg", f, "application/octet-stream")},
        data={"layer_name": "Amazon Basin Watersheds", "add_layer_to_map": True},
        headers={"Authorization": f"Bearer {os.environ['MUNDI_API_KEY']}"}
    ).json()

assert result["name"] == "Amazon Basin Watersheds"
assert result["dag_child_map_id"] == "M4NzE8rk4FZS"
# use result["dag_child_map_id"] as the new map id, and view this new uploaded layer
# by navigating to https://app.mundi.ai/project/PGJSkB1zj7fT/M4NzE8rk4FZS
subprocess.run(["open", "https://app.mundi.ai/project/PGJSkB1zj7fT/M4NzE8rk4FZS"])
post/api/maps/{original_map_id}/layers

Path parameters

original_map_idstring required

Response

Successful Response

dag_child_map_idstring required

The ID of the new map created that contains the changes. Use this ID for further operations on the modified map.

dag_parent_map_idstring required

The ID of the original map which was copied to create the new map.

idstring required

Unique identifier for the newly uploaded layer

namestring required

Display name of the layer as it appears in the map

typestring required

Layer type (vector, raster, or point_cloud)

urlstring required

Direct URL to access the layer data (PMTiles for vector, COG for raster)

messagestring

Status message confirming successful upload