Code used:
import matplotlib.pyplot as plt
import networkx as nx
import osmnx as ox
area = ox.geocode_to_gdf("Trafaria, Portugal")
tags_substation = {'power': 'substation'}
substation = ox.geometries_from_place("Trafaria, Portugal", tags_substation)
substation.plot()
print("Retrieved", len(substation), "substation objects")
tags_power_tower = {'power': 'tower'}
power_tower = ox.geometries_from_place("Trafaria, Portugal", tags_power_tower)
power_tower.plot()
print("Retrieved", len(power_tower), "power_tower objects")
tags_power_line = {'power': 'line'}
power_line = ox.geometries_from_place("Trafaria, Portugal", tags_power_line)
power_line.plot()
print("Retrieved", len(power_line), "power_line objects")
fig, ax = plt.subplots(figsize = (12,8))
area.plot(ax=ax, facecolor = "black")
substation.plot(ax=ax, facecolor = "red", alpha = 1)
power_tower.plot(ax=ax, facecolor = "dimgray", alpha = 1, markersize = 10)
power_line.plot(ax=ax, facecolor = "green", alpha = 0.7)
Image below is when i have only the substations, power towers and the background.
This image are the power lines.
And this one is when i have everything together like the code i developed above.
I dont want this to happen, i want the power lines present but only inside "area" with the same escale as the first image, if it's out of that area/background i dont want to see it. How can i do that? I'm dealing (substation, power_tower,etc) with Dataframes variables.