diff --git a/Dockerfile.tmpl b/Dockerfile.tmpl index 963d5b1c..11205a0d 100644 --- a/Dockerfile.tmpl +++ b/Dockerfile.tmpl @@ -89,8 +89,8 @@ RUN sed -i "s/httpredir.debian.org/debian.uchicago.edu/" /etc/apt/sources.list & apt-get install -y graphviz && pip install graphviz && \ /tmp/clean-layer.sh -# b/128333086: Set PROJ_LIB to points to the proj4 cartographic library. -ENV PROJ_LIB=/opt/conda/share/proj +# b/128333086: Set PROJ_DATA to points to the proj4 cartographic library. +ENV PROJ_DATA=/opt/conda/share/proj # Install conda packages not available on pip. # When using pip in a conda environment, conda commands should be ran first and then @@ -103,6 +103,7 @@ RUN conda config --add channels nvidia && \ # Base image channel order: conda-forge (highest priority), defaults. # End state: rapidsai (highest priority), nvidia, conda-forge, defaults. mamba install -y mkl cartopy imagemagick pyproj "shapely<2" && \ + rm -rf /opt/conda/lib/python3.10/site-packages/pyproj/proj_dir/ && \ /tmp/clean-layer.sh # Install spacy diff --git a/tests/test_geopandas.py b/tests/test_geopandas.py index 62a3f418..4c0106b2 100644 --- a/tests/test_geopandas.py +++ b/tests/test_geopandas.py @@ -1,11 +1,16 @@ import unittest import geopandas -from shapely.geometry import Polygon class TestGeopandas(unittest.TestCase): - def test_GeoSeries(self): - p1 = Polygon([(0, 0), (1, 0), (1, 1)]) - p2 = Polygon([(0, 0), (1, 0), (1, 1), (0, 1)]) - p3 = Polygon([(2, 0), (3, 0), (3, 1), (2, 1)]) - g = geopandas.GeoSeries([p1, p2, p3]) \ No newline at end of file + def test_read(self): + df = geopandas.read_file(geopandas.datasets.get_path('nybb')) + self.assertTrue(df.size > 1) + + def test_spatial_join(self): + cities = geopandas.read_file(geopandas.datasets.get_path('naturalearth_cities')) + world = geopandas.read_file(geopandas.datasets.get_path('naturalearth_lowres')) + countries = world[['geometry', 'name']] + countries = countries.rename(columns={'name':'country'}) + cities_with_country = geopandas.sjoin(cities, countries, how="inner", op='intersects') + self.assertTrue(cities_with_country.size > 1)