Select to view content in your preferred language

Hydro-Quebec open data

179
2
a week ago
Jean-RenéGuérin
New Contributor

Hi! I need help to integrate data from Hydro-Quebec in ArcGIS Pro. I would like to create a layer of ongoing outages that will be updated every 15 minutes.Can someone help me out please?I don't know where to start.

Ongoing outages and planned service interruptions | Hydro-Québec

Tanks in advance 🙂

0 Kudos
2 Replies
MobiusSnake
MVP Regular Contributor

I'm not familiar with this data but at a glance, it appears to be KMZs published at intervals, using filenames that aren't predictable (but can be determined using an API).  I don't know of a straightforward way to add this to Pro as a layer, I believe you're going to need to write some code to do this.

The most straightforward approach to me would be to write some code that runs at a regular interval, and updates a data source that ArcGIS Pro can handle easily.  For example, you could create a feature layer in ArcGIS Online, and use a scheduled notebook in ArcGIS Online to query the H-Q layer every 15 minutes, delete all current features in your layer, then reload the features from the downloaded KMZ file.

The notebook could consist of six steps:

  • Use something like requests or urllib to connect to "BIS Version" JSON file, and capture the timestamp there.  (This is the first step described on the page you posted.)
  • Construct a URL as described in the third step from that page to download the KMZ to a temporary folder.
  • Convert the KMZ records to a feature class using the "KML to Layer" geoprocessing tool.
  • Delete all the records currently in your feature layer.
  • Copy the converted feature class' records into your feature layer.
  • Delete the temporary files.

A single-user alternative that would avoid using ArcGIS Online credits would be to use a local feature class rather than an ArcGIS Online feature layer, and have the script running locally on your machine at regular intervals.

A more manual (but code-free) approach would be something like this:

  • Get the "BIS Version" JSON file's value using a browser.
  • Use the value from that file to stitch together a URL to the latest KMZ file.
  • Add that KMZ file's URL to Pro using "Add to Data" > "Data from Path".

This won't automatically update, however, you'll need to re-fetch the BIS version and re-add the KMZ every time you want to refresh.

Jean-RenéGuérin
New Contributor

Big thanks! I will have a look 🙂

0 Kudos