electricitymaps-contrib icon indicating copy to clipboard operation
electricitymaps-contrib copied to clipboard

Update Pacificorp West & Bonneville Power Administration polygons

Open tonypls opened this issue 2 years ago • 8 comments

Describe the bug Our polygons need updating! Pacficorp has released a more accurate outline of the zone boundaries for Pacificorp West (PW).

We should update our map to reflect this. It looks like (PW) will shrink and Bonneville Power Administration (BPA) will grow but further investigation is required to confirm this.

To Reproduce

  1. Compare electricity maps app to this arcgis layer

Expected behavior Our map should reflect the accurate borders for PW

Screenshots image image

tonypls avatar Jun 01 '23 09:06 tonypls

Found another map for California that points out a few mistakes on our map - might be worth looking into at the same time :) https://www.arcgis.com/apps/mapviewer/index.html?layers=147c83114a3f4ff8a82225e3d6c24857

madsnedergaard avatar Jun 01 '23 21:06 madsnedergaard

I planned on taking a look at the other geometry issues we have open the coming days or next week and I can take a look at this as well, but man these geometries are a pain to edit...

At least there is no new zones 😅

VIKTORVAV99 avatar Jun 01 '23 21:06 VIKTORVAV99

On the topic of U.S. zones, any news on getting useful exchange data? Unfortunately the carbon intensity isn't terribly accurate without the exchanges

jarek avatar Jun 02 '23 02:06 jarek

On the topic of U.S. zones, any news on getting useful exchange data? Unfortunately the carbon intensity isn't terribly accurate without the exchanges

I brought it up at the team meeting today and we have some ideas on how we can improve things from our side at least.

Nothing to share yet but it's definitely on our radar and we agree it's a problem.

VIKTORVAV99 avatar Jun 02 '23 10:06 VIKTORVAV99

@tonypls said:

Our polygons need updating! Pacficorp has released a more accurate outline of the zone boundaries for Pacificorp West (PW). We should update our map to reflect this.

@VIKTORVAV99 said:

I planned on taking a look at the other geometry issues we have open the coming days or next week and I can take a look at this as well, but man these geometries are a pain to edit...

I was thinking about these geometries being a pain to edit and wondering whether there might be any way to make the process any easier, which brought a question to mind. Please don't feel obliged to answer if you haven't the time.

The polygons shown in the PacifiCorp Service Territory map linked by @tonypls are much more complex than the polygons for US-NW-PACW in the EM world.geojson file. I assume that the EM zone polygons are intentionally simplified for reasons of rendering speed and visual clarity (and also perhaps for easier upkeep/editing)? If that's correct, do you mind if I ask how it's decided how much simplification to use when creating and/or modifying the EM zones?

(Incidentally, in reading the Edit world geometries page, I noticed the instruction: "when modifying borders, make sure to also modify the neighboring polygons to ensure that there are no overlaps or gaps between them". Although this may already be known to editors, there is a setting in QGIS called 'Topological Editing' which, when enabled, allows QGIS to determine shared boundaries between different features (polygons in our case) and automatically update the geometries of all relevant features when a vertex shared by multiple features is moved. Wanted to mention that, just in case, since it can save a fair bit of time when adjusting shared boundaries.)

Cheers!

sporadicus avatar Jun 05 '23 07:06 sporadicus

Wow that Topological editing mode sure made things easier (although it's taking almost as long because it hangs a lot 😅).

I have begun taking care of some of the other existing geo issues and will leave the US zones mostly alone right now until we have found better map coverage for more zones and can make sure they don't overlap (because some of the ISO regions do overlap at our resolution).

And that brings me to the last point, yes the polygons or shapes are intentionally simplified to keep the map size down and performance up, for example right now we round all coordinates to 4 decimals and we hope to bring this down to 3 if possible.

VIKTORVAV99 avatar Jun 05 '23 08:06 VIKTORVAV99

(Incidentally, in reading the Edit world geometries page, I noticed the instruction: "when modifying borders, make sure to also modify the neighboring polygons to ensure that there are no overlaps or gaps between them". Although this may already be known to editors, there is a setting in QGIS called 'Topological Editing' which, when enabled, allows QGIS to determine shared boundaries between different features (polygons in our case) and automatically update the geometries of all relevant features when a vertex shared by multiple features is moved. Wanted to mention that, just in case, since it can save a fair bit of time when adjusting shared boundaries.)

Cheers!

That is really cool, didn't know about it either - I have updated the wiki to include information about this setting :)

madsnedergaard avatar Jun 05 '23 21:06 madsnedergaard

I'm glad it was useful info! I'd like to mention one other process in case it's of any use in the future (and assuming that it isn't something you already know). Apologies, as always, for any undue length... 😴😅

Some GISes (like the Pacificorp West map linked above) publish only what is basically a rendered image of their features, but other GISes (like the one linked in @madsnedergaard's comment) also publish more robust data, like the geometry values of their features . In these latter cases, we can easily incorporate the geometry values into places like EM's world.geojson file.

As we've noted above, the biggest problem with doing that is that these published feature data are much too complex for EM's particular needs (visual clarity, among other reasons). But there is a relatively easy algorithm that could be used to drastically simplify the feature:

  1. Open world.geojson in a text editor and replace an existing zone's list of vertices with the new, much-too-complex list of vertices. (Let's call this zone the "updated feature".)
  2. Open the modified world.geojson file in QGIS and run 'Simplify Feature' on the updated feature, adjusting to the desired number of vertices.
  3. With topological editing enabled and set to disallow overlap, edit the relevant vertices of the updated feature and/or its adjacent features. (This mostly consists of eliminating gaps by pulling a neighboring polygon's vertex over the edge of and inside of the updated feature—because overlap is disallowed, the moved vertex will instead be placed on the boundary between the two features.)
  4. Once all gaps have been eliminated and any overlaps remedied, save the changes to the layer.
  5. At this point, world.geojson is ready for EM's use and should pass its validation checks.

As a quick example, if we wanted EM's US-CAL-TIDC zone to adopt a shape more like the one from @madsnedergaard's map: Screenshot 2023-06-07 at 1 35 19 AM

the resulting change might look something like this: Screenshot 2023-06-07 at 1 31 39 AM

This change took me about 15 minutes to do, but I think that, after doing one or two of these to get the hang of it, each such change would take only 5-10 minutes.

I have no idea whether this method would be useful now or in the future. And although this comment is already quite long, I did leave some points a bit vague in order to keep it shorter. But, I'm happy to offer more detail on any of the particulars should anyone want them—just let me know!

sporadicus avatar Jun 07 '23 08:06 sporadicus