Open Infrastructure Map is based on OSM Data. Let's use it to create own map / dataset. In below example I'm using R and mainly osmdata
together with sf
packages.
Let's download the boundary of Sweden, which will be used as a clipping area.
sw <- osmdata::getbb("Sweden", featuretype = "country", format_out = "matrix") |>
osmdata::opq(timeout = 60) |>
osmdata::add_osm_feature(key = "boundary", value = "administrative") |>
osmdata::add_osm_feature(key = "admin_level", value = "2") |>
osmdata::osmdata_sf()
boundary <- sw$osm_multipolygons |>
subset(name.en == "Sweden") |>
sf::st_geometry()
boundary |>
plot(col = "grey90")
Let's download all features with power
key (for details, see https://wiki.openstreetmap.org/wiki/Key:power):
p <- osmdata::getbb("Sweden", featuretype = "country", format_out = "matrix") |>
osmdata::opq(timeout = 600) |>
osmdata::add_osm_feature(key = "power") |>
osmdata::osmdata_sf()
Now, we will extract only power lines, which spatially belong to Sweden. They are in osm_lines
data:
grid <- p$osm_lines |>
subset(apply(sf::st_intersects(p$osm_lines, boundary, sparse = TRUE), 1, any)) |>
subset(power == "line") |>
subset(select = c("osm_id", "voltage")) |>
tidyr::separate_rows(voltage) |>
dplyr::distinct(.keep_all = TRUE) |>
dplyr::mutate(voltage = as.numeric(voltage))
And let's add them to the plot:
plot(grid["voltage"], add = TRUE)
Let's extract the substations form osm_polygon
and osm_multipolygon
data, bind them together and add to plot as well:
subst <- p$osm_polygons |>
subset(apply(sf::st_intersects(p$osm_polygons, boundary, sparse = TRUE), 1, any)) |>
subset(power == "substation") |>
subset(select = c("osm_id", "name"))
subst <- p$osm_multipolygons |>
subset(apply(sf::st_intersects(p$osm_multipolygons, boundary, sparse = TRUE), 1, any)) |>
subset(power == "substation") |>
subset(select = c("osm_id", "name")) |>
rbind(subst)
subst |>
sf::st_geometry() |>
plot(col = "grey90", add = TRUE)

The downloaded data can be saved on disc for further use with st_write()
function from sf
package. Then you can open it in QGIS and style it properly.
Created on 2022-10-01 with reprex v2.0.2