{"slug": "osm-waterways", "name": "OpenStreetMap Waterways", "tagline": "The most detailed open river lines, updated continuously", "source": "OpenStreetMap", "category": {"slug": "rivers", "name": "Rivers", "icon": "river", "tone": "blue"}, "meta": ["Lines", "Continuously updated", "Global"], "thumb": "/static/catalog/thumbs/osm-waterways.cdf17040afd6.jpg", "bbox": [-180.0, -90.0, 180.0, 90.0], "global": true, "access": "api", "url": "/datasets/osm-waterways/", "subtitle": "Rivers, streams and canals mapped by OpenStreetMap contributors", "summary": "Waterways tagged river, stream and canal, often traced from aerial imagery at a few metres. Detail is high in Europe and much of Asia and uneven elsewhere; lines are not guaranteed to be connected or oriented downstream, so check the network before routing. Keep Overpass requests to small areas; use a Geofabrik country extract (its shapefile has a waterways layer) for large ones.", "categories": [{"slug": "rivers", "name": "Rivers", "icon": "river", "tone": "blue"}], "sources": [{"slug": "osm", "name": "OpenStreetMap contributors", "label": "OpenStreetMap", "url": "https://www.openstreetmap.org/", "page": "/sources/osm/"}], "facts": [["Source", "OpenStreetMap"], ["Resolution", "Lines (mapped at local detail)"], ["Time span", "Continuously updated"], ["Temporal", "Live"], ["Access type", "API (external)"], ["Formats", "JSON (Overpass), Shapefile and PBF (Geofabrik extracts)"], ["Coverage", "Global (completeness varies by country)"]], "access_note": "Overpass for small areas (send a user agent), Geofabrik extracts for countries", "coverage": "Global (completeness varies by country)", "license": {"name": "Open Database License (ODbL)", "url": "https://www.openstreetmap.org/copyright"}, "citation": "", "doi": "", "landing_url": "https://wiki.openstreetmap.org/wiki/Key:waterway", "provider_url": "https://download.geofabrik.de/", "methods": [{"type": "api", "label": "Rivers, streams and canals in the box, in Overpass Turbo (map view, export to GeoJSON or KML)"}, {"type": "link", "label": "Country and region extracts (Geofabrik, shapefile layer gis_osm_waterways)"}], "preview": {"type": "layer", "layer": "rivers", "label": "Rivers (Natural Earth)"}, "thumb_credit": "Rivers (Natural Earth) over Blue Marble (NASA GIBS)", "selection": [-75.0, -20.0, -50.0, 5.0], "selection_text": "-75,-20,-50,5", "snippets": {"curl": "# Overpass wants a user agent that identifies you; keep the box small\ncurl -A \"your-project (you@example.org)\" -G \"https://overpass-api.de/api/interpreter\" \\\n  --data-urlencode 'data=[out:json][timeout:90];way[\"waterway\"~\"^(river|stream|canal)$\"](-20,-75,5,-50);out geom;' \\\n  -o waterways.json", "python": "import requests\n\nquery = \"\"\"[out:json][timeout:90];\nway[\"waterway\"~\"^(river|stream|canal)$\"](-20,-75,5,-50);\nout geom;\"\"\"\nr = requests.post(\"https://overpass-api.de/api/interpreter\", data={\"data\": query},\n                  headers={\"User-Agent\": \"your-project (you@example.org)\"})\nways = r.json()[\"elements\"]\nlines = [[(p[\"lon\"], p[\"lat\"]) for p in w[\"geometry\"]] for w in ways]\nprint(len(lines), \"waterways\")", "javascript": "const query = `[out:json][timeout:90];\nway[\"waterway\"~\"^(river|stream|canal)$\"](-20,-75,5,-50);\nout geom;`;\nconst res = await fetch(\"https://overpass-api.de/api/interpreter\", {\n  method: \"POST\",\n  body: new URLSearchParams({ data: query }),\n});\nconst { elements } = await res.json();\nconsole.log(elements.length, \"waterways\");"}, "api": {"links": "/api/v1/datasets/osm-waterways/links?bbox=-75,-20,-50,5", "manifest": "/api/v1/datasets/osm-waterways/manifest?bbox=-75,-20,-50,5"}}