diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6309c78..314cbaf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,7 +30,7 @@ jobs: with: cache-downloads: true cache-environment: true - environment-file: tests/environment-tests.yml + environment-file: environment.yml post-cleanup: none - name: Lint notebooks diff --git a/environment.yml b/environment.yml index ea18f6a..384e06c 100644 --- a/environment.yml +++ b/environment.yml @@ -3,7 +3,8 @@ channels: - conda-forge dependencies: - jupyterlab - - osmnx=1.5.1 + - osmnx=1.6.0 - pillow + - pre-commit - python=3.11.* - python-igraph diff --git a/notebooks/03-graph-place-queries.ipynb b/notebooks/03-graph-place-queries.ipynb index 6237125..c9f09e4 100644 --- a/notebooks/03-graph-place-queries.ipynb +++ b/notebooks/03-graph-place-queries.ipynb @@ -79,20 +79,10 @@ "metadata": {}, "outputs": [], "source": [ - "# you can also buffer the place boundaries (0.5 km in this example)\n", - "gdf = ox.geocode_to_gdf(\"Piedmont, California, USA\", buffer_dist=500)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# you can get multiple places in a single query\n", + "# you can get multiple countries in a single query\n", "gdf = ox.geocode_to_gdf([\"United Kingdom\", \"Ireland\"])\n", "\n", - "# or optionally buffer them\n", + "# or multiple cities\n", "places = [\n", " \"Berkeley, California, USA\",\n", " \"Oakland, California, USA\",\n", @@ -100,7 +90,7 @@ " \"Emeryville, California, USA\",\n", " \"Alameda, Alameda County, CA, USA\",\n", "]\n", - "gdf = ox.geocode_to_gdf(places, buffer_dist=500)" + "gdf = ox.geocode_to_gdf(places)" ] }, { @@ -246,8 +236,11 @@ "metadata": {}, "outputs": [], "source": [ - "# you can also get a network with a buffer distance (meters) around the place\n", - "G = ox.graph_from_place(\"Piedmont, California, USA\", network_type=\"walk\", buffer_dist=200)" + "# or get the walking network within a 500 meter buffer of piedmont\n", + "polygon = ox.geocode_to_gdf(\"Piedmont, California, USA\").loc[0, \"geometry\"]\n", + "poly_proj, crs_proj = ox.projection.project_geometry(polygon)\n", + "polygon, _ = ox.projection.project_geometry(poly_proj.buffer(500), crs=crs_proj, to_latlong=True)\n", + "G = ox.graph_from_polygon(polygon, network_type=\"walk\")" ] }, { diff --git a/tests/environment-tests.yml b/tests/environment-tests.yml deleted file mode 100644 index 1c91a2c..0000000 --- a/tests/environment-tests.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: osmnx-examples -channels: - - conda-forge -dependencies: - - jupyter - - osmnx=1.5.1 - - pillow - - pre-commit - - python=3.11.* - - python-igraph