Skip to content

Commit

Permalink
Merge pull request #40 from chrieke/upgrade_dependencies
Browse files Browse the repository at this point in the history
Upgrade dependencies
  • Loading branch information
chrieke authored Aug 25, 2023
2 parents 79be1c9 + 2f5000f commit 8812792
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions prettymapp/osm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from osmnx.geometries import geometries_from_polygon
from osmnx.features import features_from_polygon
from osmnx import settings
from geopandas import clip, GeoDataFrame
from shapely.geometry import Polygon
Expand All @@ -19,7 +19,7 @@ def get_osm_geometries(aoi: Polygon) -> GeoDataFrame:
except TypeError: # e.g. "building": True
tags[k] = v

df = geometries_from_polygon(polygon=aoi, tags=tags)
df = features_from_polygon(polygon=aoi, tags=tags)
df = df.droplevel(level=0)
df = df[~df.geometry.geom_type.isin(["Point", "MultiPoint"])]

Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pandas==1.5.2 #osmnx subdependecies are partially unpinned
numpy==1.23.5
matplotlib==3.6.2
osmnx==1.2.3
pandas==2.0.3 #osmnx subdependecies are partially unpinned
numpy==1.25.2
osmnx==1.6.0
matplotlib==3.7.2
2 changes: 1 addition & 1 deletion streamlit-prettymapp/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
streamlit==1.25.0
streamlit==1.26.0
streamlit-image-select==0.6.0
-e ../prettymapp
4 changes: 3 additions & 1 deletion streamlit-prettymapp/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@
import re
from typing import Any
import io
import json

from matplotlib.pyplot import figure
import streamlit as st
from geopandas import GeoDataFrame
from shapely.geometry import Polygon

from prettymapp.plotting import Plot
from prettymapp.osm import get_osm_geometries
from prettymapp.settings import STYLES


@st.cache_data(show_spinner=False)
@st.cache_data(show_spinner=False, hash_funcs={Polygon: lambda x: json.dumps(x.__geo_interface__)})
def st_get_osm_geometries(aoi):
"""Wrapper to enable streamlit caching for package function"""
df = get_osm_geometries(aoi=aoi)
Expand Down

0 comments on commit 8812792

Please sign in to comment.