v1
latestOpenAPI 3.1.02026-07-1771114.6 KBMaps
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