Skip to content

Commit 1513933

Browse files
authored
fix geopandas again (#1418)
This should fix the failing learn tools test.
1 parent ba786ed commit 1513933

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

Dockerfile.tmpl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ RUN sed -i "s/httpredir.debian.org/debian.uchicago.edu/" /etc/apt/sources.list &
8989
apt-get install -y graphviz && pip install graphviz && \
9090
/tmp/clean-layer.sh
9191

92-
# b/128333086: Set PROJ_LIB to points to the proj4 cartographic library.
93-
ENV PROJ_LIB=/opt/conda/share/proj
92+
# b/128333086: Set PROJ_DATA to points to the proj4 cartographic library.
93+
ENV PROJ_DATA=/opt/conda/share/proj
9494

9595
# Install conda packages not available on pip.
9696
# 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 && \
103103
# Base image channel order: conda-forge (highest priority), defaults.
104104
# End state: rapidsai (highest priority), nvidia, conda-forge, defaults.
105105
mamba install -y mkl cartopy imagemagick pyproj "shapely<2" && \
106+
rm -rf /opt/conda/lib/python3.10/site-packages/pyproj/proj_dir/ && \
106107
/tmp/clean-layer.sh
107108

108109
# Install spacy

tests/test_geopandas.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import unittest
22

33
import geopandas
4-
from shapely.geometry import Polygon
54

65
class TestGeopandas(unittest.TestCase):
7-
def test_GeoSeries(self):
8-
p1 = Polygon([(0, 0), (1, 0), (1, 1)])
9-
p2 = Polygon([(0, 0), (1, 0), (1, 1), (0, 1)])
10-
p3 = Polygon([(2, 0), (3, 0), (3, 1), (2, 1)])
11-
g = geopandas.GeoSeries([p1, p2, p3])
6+
def test_read(self):
7+
df = geopandas.read_file(geopandas.datasets.get_path('nybb'))
8+
self.assertTrue(df.size > 1)
9+
10+
def test_spatial_join(self):
11+
cities = geopandas.read_file(geopandas.datasets.get_path('naturalearth_cities'))
12+
world = geopandas.read_file(geopandas.datasets.get_path('naturalearth_lowres'))
13+
countries = world[['geometry', 'name']]
14+
countries = countries.rename(columns={'name':'country'})
15+
cities_with_country = geopandas.sjoin(cities, countries, how="inner", op='intersects')
16+
self.assertTrue(cities_with_country.size > 1)

0 commit comments

Comments
 (0)