Skip to content

Instantly share code, notes, and snippets.

@ShijianXu
Created November 4, 2023 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShijianXu/3946383266c30dccb88ef90b6eccb924 to your computer and use it in GitHub Desktop.
Save ShijianXu/3946383266c30dccb88ef90b6eccb924 to your computer and use it in GitHub Desktop.
Generate Customed City Maps with OSMnx
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