Created
November 4, 2023 13:27
-
-
Save ShijianXu/3946383266c30dccb88ef90b6eccb924 to your computer and use it in GitHub Desktop.
Generate Customed City Maps with OSMnx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import osmnx as ox | |
center_point = (46.521863, 6.633105) | |
tags = {"building": True} | |
gdf = ox.features_from_point(center_point, tags, dist=5000) | |
fig, ax = ox.plot_footprints(gdf, figsize=(27, 40), | |
color="#72b1b1", | |
bgcolor="#061529", | |
dpi=600) | |
fig.tight_layout(pad=0) | |
fig.savefig("Paris_Buildings.pdf", | |
dpi=600, | |
bbox_inches='tight', | |
format="pdf", | |
facecolor=fig.get_facecolor(), | |
transparent=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment