Skip to content

Commit

Permalink
example notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
chrieke committed Apr 23, 2024
1 parent 8d97f7a commit 68e2b66
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ dmypy.json
# Pyre type checker
.pyre/

<_io.BytesIO*
.vscode/*
.idea/
cache/
prettybasicmaps/cache
Expand Down
74 changes: 74 additions & 0 deletions prettymapp/example_notebook.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "770d1893-70b9-4c65-8651-903346f355a9",
"metadata": {},
"outputs": [],
"source": [
"from prettymapp.geo import get_aoi\n",
"from prettymapp.osm import get_osm_geometries\n",
"from prettymapp.plotting import Plot\n",
"from prettymapp.settings import STYLES\n",
"\n",
"aoi = get_aoi(address=\"Praça Ferreira do Amaral, Macau\", radius=1100, rectangular=False)\n",
"df = get_osm_geometries(aoi=aoi)\n",
"\n",
"fig = Plot(\n",
" df=df,\n",
" aoi_bounds=aoi.bounds,\n",
" draw_settings=STYLES[\"Peach\"]\n",
").plot_all()\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1321e1fb-82d9-4d15-a4a3-696422063ecc",
"metadata": {},
"outputs": [],
"source": [
"from prettymapp.osm import get_osm_geometries_from_xml\n",
"\n",
"df = get_osm_geometries_from_xml(filepath=\"./tests/mock_data/osm_xml_file.osm\")\n",
"aoi_bounds = df.total_bounds\n",
"\n",
"fig = Plot(\n",
" df=df,\n",
" aoi_bounds=aoi_bounds,\n",
" draw_settings=STYLES[\"Peach\"]\n",
").plot_all()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "787f0a25-0eb4-45de-8889-2db572c09c26",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "prettymapp",
"language": "python",
"name": "prettymapp"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

0 comments on commit 68e2b66

Please sign in to comment.