-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Open Street Map (OSM) as a source #12
Comments
Hey @danielsjf that is definitely a good idea. Some problems occurred so far as I had a first try:
A python snippet which uses your code (I changed Turkey into Luxembourg as it is smaller) import requests
overpass_url = "http://overpass-api.de/api/interpreter"
overpass_query = """
[out:json][timeout:210];
area["name"="Luxembourg"]->.boundaryarea;
(
// query part for: “power=plant”
node["power"="plant"](area.boundaryarea);
way["power"="plant"](area.boundaryarea);
relation["power"="plant"](area.boundaryarea);
node["power"="generator"](area.boundaryarea);
way["power"="generator"](area.boundaryarea);
relation["power"="generator"](area.boundaryarea);
);
out body;
"""
response = requests.get(overpass_url,
params={'data': overpass_query})
data = response.json()
df = pd.DataFrame(data['elements'])
df = pd.concat([df.drop(columns='tags'), df.tags.apply(pd.Series)], axis=1) works well. One could now loop over the countries with this snippet. Perhaps you want to give it a try? |
@FabianHofmann as mentioned, @davide-f worked on his fork on integrating OpenStreetMap data for generators. Compare here Davide's branch Basically, we retrieve the OSM and store it locally. The I think we could split Davide's fork contribution in two parts:
|
Some non EU countries are harder to find consistent data for. Could OSM be added for these countries as a source? Not all generators have names, but some do have names and capacities.
A quick example for Turkey with the Overpass-turbo API: https://overpass-turbo.eu/#
The text was updated successfully, but these errors were encountered: