Skip to content
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

add beaches, places, ports as observation points #748

Closed
veenstrajelmer opened this issue Jan 25, 2024 · 0 comments
Closed

add beaches, places, ports as observation points #748

veenstrajelmer opened this issue Jan 25, 2024 · 0 comments

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Jan 25, 2024

import osmnx as ox
import dfm_tools as dfmt
import matplotlib.pyplot as plt
plt.close("all")

lon_min, lon_max, lat_min, lat_max = -6, 5, 48, 50.5 # france
lon_min, lon_max, lat_min, lat_max = -2, 2, 48, 49.75 # france smaller
# lon_min, lon_max, lat_min, lat_max = 123, 148, 23, 47 # japan

beaches = ox.features.features_from_bbox(lat_max, lat_min, lon_max, lon_min, tags={"natural":["beach"]})
#cities = ox.features.features_from_bbox(lat_max, lat_min, lon_max, lon_min, tags={"place":["city"]})#,"town","village"]})
harbours = ox.features.features_from_bbox(lat_max, lat_min, lon_max, lon_min, tags={"landuse":["harbour"]})

fig, ax = plt.subplots()
beaches.geometry.plot(ax=ax, color='y')
#cities.geometry.plot(ax=ax, color='r')
harbours.geometry.plot(ax=ax, color='b')
dfmt.plot_coastlines(ax=ax)

Results in:
image

Can also be done for:

But is slow and warns:
"# UserWarning: This area is 22 times your configured Overpass max query area size. It will automatically be divided up into multiple sub-queries accordingly. This may take a long time."

@veenstrajelmer veenstrajelmer closed this as not planned Won't fix, can't repro, duplicate, stale Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant