Recently, the GEOGLOWS streamflow service was upgraded from v1 to v2. GEOGLOWS provides global river discharge forecast for 7 million river reaches for the next 10 days in 3-hour intervals. GEOGLOWS is a comprehensive service for the water resources and disaster response communities, but as it was developed globally, it does not include local river names. As part of the recent upgrade, the GEOGLOWS service in Living Atlas now displays river names from OpenStreetMap (OSM).
The river names from OSM are obtained dynamically, meaning that GEOGLOWS will always display the latest information available. If missing river names in OSM are added, those will show up in the GEOGLOWS service. In this blog, I’ll show you how information from OSM can be included in any layers using ArcGIS Arcade expressions such as in GEOGLOWS.
Pop-up Configuration
In the map viewer, we (1) select the GEOGLOWS layer, (2) open the pop-up panel, (3) make sure pop-ups are enabled, and (4) create a custom attribute expression. This attribute expression can be used within the (5) pop-up text.
Attribute Expression
We configure a custom attribute expression that can be added into the pop-up. The attribute expression includes three general steps: (1) intersect the GEOGLOWS river segments with the OSM Waterways, (2) filter the intersected river segments, and (3) select the river name and handle nulls.
1. Intersect GEOGLOWS river segments & OSM Waterways
To get the OSM river name in the pop-up, we intersect the GEOGLOWS feature Geometry($feature)
with the OSM waterways layer OSM_waterways_lyr
:
var rivers_intersect = Intersects(Geometry($feature), OSM_waterways_lyr);
In which the OSM_waterways_lyr
can be obtained with the FeatureSetByPortalItem function and the OSM Waterways item ID:
var OSM_waterways_lyr = FeatureSetByPortalItem(Portal("https://www.arcgis.com"),
OSM_Waterways_id, 0, ["name", "name_en"], true);
The additional parameters specify the layer ID number (0
), the required fields (["name", "name_en"]
), and if the geometry is returned (true
).
The OpenStreetMap (OSM) Waterways are divided into items per continents due the size of the geodatabse. The specific IDs for each continent are:
- North America “7a7d92cef2c442c1a352d902e1f2f577”
- Central America “af162bf02efc4296878637a408f560df”
- South America “22783d44a7b0441c806c2977ff2800f3”
- Africa “82232d0415c04e7086414dff7eb1310f”
- Europe “7bf80080749e4806b936c2b39e73b62e”
- Asia “3b89b8d6cb2f4183b8a45defc06dc66b”
- Australia & Oceania “76659f9ea5bf4761b263ffe55f976d1a”
Note: The OSM waterways item ID is obtained dynamically in the final expression with an additional intersection between the feature geometry and the OSM Regions layer (i.e. continents).
2. Filter Features
Then, we filter the river_intersect
object, selecting features with valid names and features that describe a river such as stream, river, creek, dryriver, wadi, or drystream, this will prevent getting an erroneous name from other hydraulic structures such as dams or canals.
var rivers = Filter(rivers_intersect, "(name IS NOT NULL OR name_en IS NOT NULL) AND
(waterway IN ('stream', 'river', 'creek', 'dryriver', 'wadi', 'drystream'))");
3. Select River Name
Finally, we (1) handle empty responses (!IsEmpty(rivers)
) , (2) discard null names using a When statement (When(!IsEmpty(river.name_en), river.name_en, !IsEmpty(river.name), river.name, "Name not available")
), and (3) select the first feature (!First(rivers)
) on the list.
Live Expression
See the complete attribute expression in the GEOGLOWS item.
Missing River Names in OSM
OpenStreetMap is an extensive dataset. Nevertheless, there are a few areas that are missing stream names. Those streams will display “Name not available” in GEOGLOWS.
We can take this opportunity to become an OpenStreetMap contributor. River names contributions to OSM will sync to the Live OpenStreetMap layers in Living Atlas within minutes.
We can contribute to OSM, for example using the Rapid editor.
In the course of time, the OSM river name contributions are shown in GEOGLOWS.
Summary
The GEOGLOWS streamflow service in Living Atlas includes river names from OpenStreetMap (OSM). The river names are displayed in the pop-up and retrieved on the fly using ArcGIS Arcade expressions. The OSM river names in GEOGLOWS display the latest data using the Live OpenStreetMap (OSM) hosted layers in Living Atlas.
More Information
Visit the official GEOGLOWS service webpage or the OpenStreetMap landing page.
Interested in water resources and GIS? visit the Esri Water Resources industry page or join the Esri Community and ask questions to our experts.
Article Discussion: