Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeWarning: overflow encountered in distance #404

Closed
martinfleis opened this issue Oct 4, 2021 · 16 comments
Closed

RuntimeWarning: overflow encountered in distance #404

martinfleis opened this issue Oct 4, 2021 · 16 comments

Comments

@martinfleis
Copy link
Contributor

I am getting RuntimeWarning: overflow encountered in distance, sometimes followed by RuntimeWarning: invalid value encountered in distance when doing distance on some real-life geometries. MRE below:

>>> x, y = 1, 6
>>> g1 = pygeos.box(x, y, x+1, y+1)
>>> g2 = pygeos.box(x-1, y-1, x-1, y-1)

>>> pygeos.distance(g1, g2)

/opt/miniconda3/envs/stable/lib/python3.9/site-packages/pygeos/measurement.py:70: RuntimeWarning: overflow encountered in distance
  return lib.distance(a, b, **kwargs)
/opt/miniconda3/envs/stable/lib/python3.9/site-packages/pygeos/measurement.py:70: RuntimeWarning: invalid value encountered in distance
  return lib.distance(a, b, **kwargs)
1.4142135623730951

The result is correct but the errors are confusing and tend to spam the feed. I see the same on macOS and Ubuntu (details below).

macOS environemnt:

SYSTEM INFO
-----------
python     : 3.9.6 | packaged by conda-forge | (default, Jul 11 2021, 03:36:15)  [Clang 11.1.0 ]
executable : /opt/miniconda3/envs/stable/bin/python
machine    : macOS-11.6-x86_64-i386-64bit

GEOS, GDAL, PROJ INFO
---------------------
GEOS       : 3.9.1
GEOS lib   : /opt/miniconda3/envs/stable/lib/libgeos_c.dylib
GDAL       : 3.3.1
GDAL data dir: /opt/miniconda3/envs/stable/share/gdal
PROJ       : 8.0.1
PROJ data dir: /opt/miniconda3/envs/stable/share/proj

PYTHON DEPENDENCIES
-------------------
geopandas  : 0.10.0
pandas     : 1.3.2
fiona      : 1.8.20
numpy      : 1.21.2
shapely    : 1.7.1
rtree      : 0.9.7
pyproj     : 3.1.0
matplotlib : 3.4.3
mapclassify: 2.4.3
geopy      : None
psycopg2   : None
geoalchemy2: None
pyarrow    : None
pygeos     : 0.10.2
# packages in environment at /opt/miniconda3/envs/stable:
#
# Name                    Version                   Build  Channel
access                    1.1.3              pyhd8ed1ab_0    conda-forge
affine                    2.3.0                      py_0    conda-forge
alabaster                 0.7.12                     py_0    conda-forge
amply                     0.1.4                      py_0    conda-forge
anyio                     3.3.0            py39h6e9494a_0    conda-forge
appnope                   0.1.2            py39h6e9494a_1    conda-forge
argon2-cffi               20.1.0           py39h89e85a6_2    conda-forge
async_generator           1.10                       py_0    conda-forge
attrs                     20.3.0             pyhd3deb0d_0    conda-forge
babel                     2.9.1              pyh44b312d_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
beautifulsoup4            4.9.3              pyhb0f4dca_0    conda-forge
bleach                    4.0.0              pyhd8ed1ab_0    conda-forge
blosc                     1.21.0               he49afe7_0    conda-forge
bokeh                     2.3.3            py39h6e9494a_0    conda-forge
boost-cpp                 1.74.0               hff03dee_4    conda-forge
branca                    0.4.2              pyhd8ed1ab_0    conda-forge
brotlipy                  0.7.0           py39h89e85a6_1001    conda-forge
bs4                       4.9.3                         0    conda-forge
bzip2                     1.0.8                h0d85af4_4    conda-forge
c-ares                    1.17.2               h0d85af4_0    conda-forge
ca-certificates           2021.5.30            h033912b_0    conda-forge
cairo                     1.16.0            he43a7df_1008    conda-forge
certifi                   2021.5.30        py39h6e9494a_0    conda-forge
cffi                      1.14.6           py39hb71fe58_0    conda-forge
cfitsio                   3.470                h01dc385_7    conda-forge
chardet                   4.0.0            py39h6e9494a_1    conda-forge
charset-normalizer        2.0.0              pyhd8ed1ab_0    conda-forge
click                     7.1.2              pyh9f0ad1d_0    conda-forge
click-completion          0.5.2            py39h6e9494a_2    conda-forge
click-log                 0.3.2              pyh9f0ad1d_0    conda-forge
click-plugins             1.1.1                      py_0    conda-forge
cligj                     0.7.2              pyhd8ed1ab_0    conda-forge
cloudpickle               1.6.0                      py_0    conda-forge
coincbc                   2.10.5               h35dd71c_1    conda-forge
colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
conda                     4.10.3           py39h6e9494a_0    conda-forge
conda-package-handling    1.7.3            py39h89e85a6_0    conda-forge
coverage                  5.5              py39h89e85a6_0    conda-forge
cryptography              3.4.7            py39ha2c9959_0    conda-forge
curl                      7.78.0               hb861fe1_0    conda-forge
cycler                    0.10.0                     py_2    conda-forge
cytoolz                   0.11.0           py39h89e85a6_3    conda-forge
dask                      2021.8.0           pyhd8ed1ab_0    conda-forge
dask-core                 2021.8.0           pyhd8ed1ab_0    conda-forge
dataclasses               0.8                pyhc8e2a94_3    conda-forge
dbus                      1.13.6               ha13b53f_2    conda-forge
debugpy                   1.4.1            py39h9fcab8e_0    conda-forge
decorator                 4.4.2                      py_0    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
deprecation               2.1.0              pyh9f0ad1d_0    conda-forge
descartes                 1.1.0                      py_4    conda-forge
distributed               2021.8.0         py39h6e9494a_0    conda-forge
docutils                  0.16             py39h6e9494a_3    conda-forge
entrypoints               0.3             py39hde42818_1002    conda-forge
esda                      2.4.1              pyhd8ed1ab_0    conda-forge
expat                     2.4.1                he49afe7_0    conda-forge
fiona                     1.8.20           py39h10412eb_1    conda-forge
folium                    0.12.0             pyhd8ed1ab_1    conda-forge
fontconfig                2.13.1            h10f422b_1005    conda-forge
freetype                  2.10.4               h4cff582_1    conda-forge
freexl                    1.0.6                h0d85af4_0    conda-forge
fsspec                    2021.7.0           pyhd8ed1ab_0    conda-forge
gdal                      3.3.1            py39h0530131_1    conda-forge
geopandas                 0.10.0             pyhd8ed1ab_0    conda-forge
geopandas-base            0.10.0             pyha770c72_0    conda-forge
geos                      3.9.1                he49afe7_2    conda-forge
geotiff                   1.6.0                h26421ea_6    conda-forge
gettext                   0.19.8.1          h7937167_1005    conda-forge
giddy                     2.3.3                      py_0    conda-forge
giflib                    5.2.1                hbcb3906_2    conda-forge
gitdb                     4.0.7              pyhd8ed1ab_0    conda-forge
gitpython                 3.1.18             pyhd8ed1ab_0    conda-forge
glib                      2.68.4               he49afe7_0    conda-forge
glib-tools                2.68.4               he49afe7_0    conda-forge
gmp                       6.2.1                h2e338ed_0    conda-forge
gmpy2                     2.1.0b5          py39hab8a6df_0    conda-forge
hdf4                      4.2.15               hefd3b78_3    conda-forge
hdf5                      1.10.6          nompi_hc5d9132_1114    conda-forge
heapdict                  1.0.1                      py_0    conda-forge
icu                       68.1                 h74dc148_0    conda-forge
idna                      3.1                pyhd3deb0d_0    conda-forge
imagesize                 1.2.0                      py_0    conda-forge
importlib-metadata        4.6.4            py39h6e9494a_0    conda-forge
importlib_resources       3.3.1            py39h6e9494a_0    conda-forge
inequality                1.0.0                      py_0    conda-forge
iniconfig                 1.1.1              pyh9f0ad1d_0    conda-forge
ipykernel                 6.2.0            py39h71a6800_0    conda-forge
ipython                   7.26.0           py39h71a6800_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
ipywidgets                7.6.3              pyhd3deb0d_0    conda-forge
jbig                      2.1               h0d85af4_2003    conda-forge
jedi                      0.18.0           py39h6e9494a_2    conda-forge
jinja2                    3.0.1              pyhd8ed1ab_0    conda-forge
joblib                    1.0.1              pyhd8ed1ab_0    conda-forge
jpeg                      9d                   hbcb3906_0    conda-forge
json-c                    0.15                 hcb556a6_0    conda-forge
jsonschema                3.2.0              pyhd8ed1ab_3    conda-forge
jupyter                   1.0.0            py39h6e9494a_6    conda-forge
jupyter-book              0.11.3             pyhd8ed1ab_0    conda-forge
jupyter-cache             0.4.3              pyhd8ed1ab_0    conda-forge
jupyter-server-mathjax    0.2.3              pyhd8ed1ab_0    conda-forge
jupyter-sphinx            0.3.2                      py_0    conda-forge
jupyter_client            6.1.12             pyhd8ed1ab_0    conda-forge
jupyter_console           6.4.0              pyhd8ed1ab_0    conda-forge
jupyter_core              4.7.1            py39h6e9494a_0    conda-forge
jupyter_server            1.10.2             pyhd8ed1ab_0    conda-forge
jupyterlab_pygments       0.1.2              pyh9f0ad1d_0    conda-forge
jupyterlab_widgets        1.0.0              pyhd8ed1ab_1    conda-forge
jupytext                  1.10.3             pyh44b312d_0    conda-forge
kealib                    1.4.14               h31dd65d_2    conda-forge
kiwisolver                1.3.1            py39hf018cea_1    conda-forge
krb5                      1.19.2               hcfbf3a7_0    conda-forge
latexcodec                2.0.1              pyh9f0ad1d_0    conda-forge
lcms2                     2.12                 h577c468_0    conda-forge
lerc                      2.2.1                h046ec9c_0    conda-forge
libarchive                3.5.1                h2b60450_2    conda-forge
libblas                   3.9.0           11_osx64_openblas    conda-forge
libcblas                  3.9.0           11_osx64_openblas    conda-forge
libclang                  11.1.0          default_he082bbe_1    conda-forge
libcurl                   7.78.0               hf45b732_0    conda-forge
libcxx                    12.0.1               habf9029_0    conda-forge
libdap4                   3.20.6               h3e144a0_2    conda-forge
libdeflate                1.8                  h0d85af4_0    conda-forge
libedit                   3.1.20191231         h0678c8f_2    conda-forge
libev                     4.33                 haf1e3a3_1    conda-forge
libffi                    3.3                  h046ec9c_2    conda-forge
libgdal                   3.3.1                hd51e85c_1    conda-forge
libgfortran               5.0.0           9_3_0_h6c81a4c_23    conda-forge
libgfortran5              9.3.0               h6c81a4c_23    conda-forge
libglib                   2.68.4               hd556434_0    conda-forge
libiconv                  1.16                 haf1e3a3_0    conda-forge
libkml                    1.3.0             h8fd9edb_1014    conda-forge
liblapack                 3.9.0           11_osx64_openblas    conda-forge
libllvm10                 10.0.1               h009f743_3    conda-forge
libllvm11                 11.1.0               hd011deb_2    conda-forge
libnetcdf                 4.8.0           nompi_hb4d10b0_103    conda-forge
libnghttp2                1.43.0               h07e645a_0    conda-forge
libopenblas               0.3.17          openmp_h3351f45_1    conda-forge
libpng                    1.6.37               h7cec526_2    conda-forge
libpq                     13.3                 hea3049e_0    conda-forge
libpysal                  4.5.1              pyhd8ed1ab_0    conda-forge
librttopo                 1.1.0                h5413771_6    conda-forge
libsodium                 1.0.18               hbcb3906_1    conda-forge
libsolv                   0.7.19               hcf210ce_5    conda-forge
libspatialindex           1.9.3                he49afe7_4    conda-forge
libspatialite             5.0.1                h035f608_5    conda-forge
libssh2                   1.9.0                h52ee1ee_6    conda-forge
libtiff                   4.3.0                h1167814_0    conda-forge
libwebp-base              1.2.1                h0d85af4_0    conda-forge
libxml2                   2.9.12               h93ec3fd_0    conda-forge
libzip                    1.8.0                h8b0c345_0    conda-forge
linkify-it-py             1.0.1              pyhd8ed1ab_0    conda-forge
llvm-openmp               12.0.1               hda6cdc1_1    conda-forge
llvmlite                  0.36.0           py39h798a4f4_0    conda-forge
locket                    0.2.0                      py_2    conda-forge
lz4-c                     1.9.3                he49afe7_1    conda-forge
lzo                       2.10              haf1e3a3_1000    conda-forge
mamba                     0.15.3           py39hb671511_0    conda-forge
mapclassify               2.4.3              pyhd8ed1ab_0    conda-forge
markdown-it-py            0.6.2              pyhd8ed1ab_0    conda-forge
markupsafe                2.0.1            py39h89e85a6_0    conda-forge
matplotlib-base           3.4.3            py39hb07454d_0    conda-forge
matplotlib-inline         0.1.2              pyhd8ed1ab_2    conda-forge
mdit-py-plugins           0.2.6              pyhd8ed1ab_0    conda-forge
mgwr                      2.1.2                      py_0    conda-forge
mistune                   0.8.4           py39h89e85a6_1004    conda-forge
mock                      4.0.3            py39h6e9494a_1    conda-forge
momepy                    0.5.0              pyhd8ed1ab_1    conda-forge
more-itertools            8.8.0              pyhd8ed1ab_0    conda-forge
mpc                       1.1.0             ha57cd0f_1009    conda-forge
mpfr                      4.1.0                h0f52abe_0    conda-forge
mpmath                    1.2.1              pyhd8ed1ab_0    conda-forge
msgpack-python            1.0.2            py39hf018cea_1    conda-forge
munch                     2.5.0                      py_0    conda-forge
mysql-common              8.0.25               h694c41f_2    conda-forge
mysql-libs                8.0.25               h115446f_2    conda-forge
myst-nb                   0.12.3             pyhd8ed1ab_0    conda-forge
myst-parser               0.13.7             pyhd8ed1ab_0    conda-forge
nbclient                  0.5.4              pyhd8ed1ab_0    conda-forge
nbconvert                 5.6.0                      py_0    conda-forge
nbdime                    3.1.0              pyhd8ed1ab_0    conda-forge
nbformat                  5.1.3              pyhd8ed1ab_0    conda-forge
ncurses                   6.2                  h2e338ed_4    conda-forge
nest-asyncio              1.5.1              pyhd8ed1ab_0    conda-forge
networkx                  2.6.2              pyhd8ed1ab_0    conda-forge
nose                      1.3.7                   py_1006    conda-forge
notebook                  6.4.3              pyha770c72_0    conda-forge
nspr                      4.30                 hcd9eead_0    conda-forge
nss                       3.69                 h31e2bf1_0    conda-forge
numba                     0.53.1           py39h32e38f5_1    conda-forge
numexpr                   2.7.3            py39h4d6be9b_0    conda-forge
numpy                     1.21.2           py39h7eed0ac_0    conda-forge
olefile                   0.46               pyh9f0ad1d_1    conda-forge
openjpeg                  2.4.0                h6e7aa92_1    conda-forge
openssl                   1.1.1l               h0d85af4_0    conda-forge
packaging                 21.0               pyhd8ed1ab_0    conda-forge
pandas                    1.3.2            py39h4d6be9b_0    conda-forge
pandoc                    2.14.1               h0d85af4_0    conda-forge
pandocfilters             1.4.2                      py_1    conda-forge
parso                     0.8.2              pyhd8ed1ab_0    conda-forge
partd                     1.2.0              pyhd8ed1ab_0    conda-forge
patsy                     0.5.1                      py_0    conda-forge
pcre                      8.45                 he49afe7_0    conda-forge
pexpect                   4.8.0              pyh9f0ad1d_2    conda-forge
pickleshare               0.7.5           py39hde42818_1002    conda-forge
pillow                    8.3.1            py39he9bb72f_0    conda-forge
pip                       21.2.4             pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               hbcb3906_0    conda-forge
pluggy                    0.13.1           py39h6e9494a_4    conda-forge
pointpats                 2.2.0                      py_0    conda-forge
poppler                   21.03.0              h640f9a4_0    conda-forge
poppler-data              0.4.10                        0    conda-forge
postgresql                13.3                 he8fe76e_0    conda-forge
proj                      8.0.1                h1512c50_0    conda-forge
prometheus_client         0.11.0             pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.19             pyha770c72_0    conda-forge
prompt_toolkit            3.0.19               hd8ed1ab_0    conda-forge
psutil                    5.8.0            py39h89e85a6_1    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pulp                      2.5.0            py39h6e9494a_0    conda-forge
py                        1.10.0             pyhd3deb0d_0    conda-forge
pybtex                    0.24.0           py39h6e9494a_0    conda-forge
pybtex-docutils           1.0.1            py39h6e9494a_0    conda-forge
pycosat                   0.6.3           py39h89e85a6_1006    conda-forge
pycparser                 2.20               pyh9f0ad1d_2    conda-forge
pydata-sphinx-theme       0.6.3              pyhd8ed1ab_0    conda-forge
pygeos                    0.10.2a2                  dev_0    <develop>
pygments                  2.10.0             pyhd8ed1ab_0    conda-forge
pyopenssl                 20.0.1             pyhd8ed1ab_0    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pypdf2                    1.26.0                     py_2    conda-forge
pyproj                    3.1.0            py39h7b8b08e_4    conda-forge
pyqt                      5.12.3           py39h6e9494a_7    conda-forge
pyqt-impl                 5.12.3           py39hef7122c_7    conda-forge
pyqt5-sip                 4.19.18          py39hd8f94c5_7    conda-forge
pyqtchart                 5.12             py39hef7122c_7    conda-forge
pyqtwebengine             5.12.1           py39hef7122c_7    conda-forge
pyrsistent                0.17.3           py39h89e85a6_2    conda-forge
pysal                     2.5.0              pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1            py39h6e9494a_3    conda-forge
pytables                  3.6.1            py39hd07922a_3    conda-forge
pytest                    6.2.4            py39h6e9494a_0    conda-forge
pytest-cov                2.12.1             pyhd8ed1ab_0    conda-forge
python                    3.9.6           hd187cdc_1_cpython    conda-forge
python-dateutil           2.8.0                      py_0    conda-forge
python_abi                3.9                      2_cp39    conda-forge
pytz                      2021.1             pyhd8ed1ab_0    conda-forge
pyyaml                    5.4.1            py39h89e85a6_1    conda-forge
pyzmq                     22.2.1           py39h7fec2f1_0    conda-forge
qt                        5.12.9               h126340a_4    conda-forge
qtconsole                 5.1.1              pyhd8ed1ab_0    conda-forge
qtpy                      1.10.0             pyhd8ed1ab_0    conda-forge
quantecon                 0.5.1            py39h6e9494a_0    conda-forge
rasterio                  1.2.6            py39h906574e_2    conda-forge
rasterstats               0.15.0             pyhd8ed1ab_0    conda-forge
readline                  8.1                  h05e3726_0    conda-forge
reproc                    14.2.1               hbcb3906_0    conda-forge
reproc-cpp                14.2.1               h2e338ed_0    conda-forge
requests                  2.26.0             pyhd8ed1ab_0    conda-forge
requests-unixsocket       0.2.0                      py_0    conda-forge
rtree                     0.9.7            py39h7d0d40a_2    conda-forge
ruamel_yaml               0.15.80         py39h89e85a6_1004    conda-forge
rvlib                     0.0.5            py39hc89836e_0    conda-forge
scikit-learn              0.24.2           py39hd4eea88_1    conda-forge
scipy                     1.7.1            py39h056f1c0_0    conda-forge
seaborn                   0.11.2               hd8ed1ab_0    conda-forge
seaborn-base              0.11.2             pyhd8ed1ab_0    conda-forge
segregation               2.1.0              pyhd8ed1ab_0    conda-forge
send2trash                1.8.0              pyhd8ed1ab_0    conda-forge
setuptools                57.4.0           py39h6e9494a_0    conda-forge
shapely                   1.7.1            py39h1d9c377_5    conda-forge
shellingham               1.4.0              pyh44b312d_0    conda-forge
simplejson                3.17.3           py39h89e85a6_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
smmap                     3.0.5              pyh44b312d_0    conda-forge
snakeviz                  2.1.0              pyh9f0ad1d_0    conda-forge
sniffio                   1.2.0            py39h6e9494a_1    conda-forge
snowballstemmer           2.1.0              pyhd8ed1ab_0    conda-forge
snuggs                    1.4.7                      py_0    conda-forge
sortedcontainers          2.4.0              pyhd8ed1ab_0    conda-forge
soupsieve                 2.0.1                      py_1    conda-forge
spaghetti                 1.6.2              pyhd8ed1ab_0    conda-forge
spglm                     1.0.8                      py_0    conda-forge
sphinx                    3.5.4              pyh44b312d_0    conda-forge
sphinx-book-theme         0.1.3              pyhd8ed1ab_0    conda-forge
sphinx-comments           0.0.3              pyh9f0ad1d_0    conda-forge
sphinx-copybutton         0.4.0              pyhd8ed1ab_0    conda-forge
sphinx-external-toc       0.2.3              pyhd8ed1ab_0    conda-forge
sphinx-jupyterbook-latex  0.4.2              pyhd8ed1ab_1    conda-forge
sphinx-multitoc-numbering 0.1.3              pyhd8ed1ab_0    conda-forge
sphinx-panels             0.5.2              pyhd3deb0d_0    conda-forge
sphinx-thebe              0.0.10             pyhd8ed1ab_0    conda-forge
sphinx-togglebutton       0.2.3              pyhd3deb0d_0    conda-forge
sphinxcontrib-applehelp   1.0.2                      py_0    conda-forge
sphinxcontrib-bibtex      2.2.1              pyhd8ed1ab_0    conda-forge
sphinxcontrib-devhelp     1.0.2                      py_0    conda-forge
sphinxcontrib-htmlhelp    2.0.0              pyhd8ed1ab_0    conda-forge
sphinxcontrib-jsmath      1.0.1                      py_0    conda-forge
sphinxcontrib-qthelp      1.0.3                      py_0    conda-forge
sphinxcontrib-serializinghtml 1.1.5              pyhd8ed1ab_0    conda-forge
spint                     1.0.7              pyhd8ed1ab_0    conda-forge
splot                     1.1.4              pyhd8ed1ab_0    conda-forge
spopt                     0.1.2              pyhd8ed1ab_0    conda-forge
spreg                     1.2.4              pyhd8ed1ab_0    conda-forge
spvcm                     0.3.0                      py_0    conda-forge
sqlalchemy                1.3.23           py39h4b0b724_0    conda-forge
sqlite                    3.36.0               h23a322b_0    conda-forge
statsmodels               0.12.2           py39h329c335_0    conda-forge
sympy                     1.8              py39h6e9494a_0    conda-forge
tblib                     1.7.0              pyhd8ed1ab_0    conda-forge
terminado                 0.11.1           py39h6e9494a_0    conda-forge
testpath                  0.5.0              pyhd8ed1ab_0    conda-forge
threadpoolctl             2.2.0              pyh8a188c0_0    conda-forge
tiledb                    2.3.3                h8370e7a_0    conda-forge
tk                        8.6.10               h0419947_1    conda-forge
tobler                    0.8.2              pyhd8ed1ab_0    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
toolz                     0.11.1                     py_0    conda-forge
tornado                   6.1              py39h89e85a6_1    conda-forge
tqdm                      4.62.1             pyhd8ed1ab_0    conda-forge
traitlets                 5.0.5                      py_0    conda-forge
typing_extensions         3.10.0.0           pyha770c72_0    conda-forge
tzcode                    2021a                h0d85af4_2    conda-forge
tzdata                    2021a                he74cb21_1    conda-forge
uc-micro-py               1.0.1              pyhd8ed1ab_0    conda-forge
urllib3                   1.25.11                    py_0    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
webencodings              0.5.1                      py_1    conda-forge
websocket-client          0.57.0           py39h6e9494a_4    conda-forge
wheel                     0.37.0             pyhd8ed1ab_1    conda-forge
widgetsnbextension        3.5.1            py39h6e9494a_4    conda-forge
xarray                    0.19.0             pyhd8ed1ab_1    conda-forge
xerces-c                  3.2.3                h379762d_2    conda-forge
xyzservices               2021.9.1           pyhd8ed1ab_0    conda-forge
xz                        5.2.5                haf1e3a3_1    conda-forge
yaml                      0.2.5                haf1e3a3_0    conda-forge
zeromq                    4.3.4                h1c7c35f_0    conda-forge
zict                      2.0.0                      py_0    conda-forge
zipp                      3.5.0              pyhd8ed1ab_0    conda-forge
zlib                      1.2.11            h7795811_1010    conda-forge
zstd                      1.5.0                h582d3a0_0    conda-forge

Ubuntu environment:

SYSTEM INFO
-----------
python     : 3.8.8 | packaged by conda-forge | (default, Feb 20 2021, 16:22:27)  [GCC 9.3.0]
executable : /opt/conda/bin/python
machine    : Linux-5.4.0-88-generic-x86_64-with-glibc2.10

GEOS, GDAL, PROJ INFO
---------------------
GEOS       : 3.9.0
GEOS lib   : /usr/lib/x86_64-linux-gnu/libgeos_c.so
GDAL       : 3.3.2
GDAL data dir: /opt/conda/share/gdal
PROJ       : 8.1.1
PROJ data dir: /opt/conda/share/proj

PYTHON DEPENDENCIES
-------------------
geopandas  : 0.10.0
pandas     : 1.3.3
fiona      : 1.8.20
numpy      : 1.20.3
shapely    : 1.7.1
rtree      : 0.9.7
pyproj     : 3.2.1
matplotlib : 3.4.3
mapclassify: 2.4.3
geopy      : 2.2.0
psycopg2   : 2.9.1 (dt dec pq3 ext lo64)
geoalchemy2: 0.8.4
pyarrow    : 5.0.0
pygeos     : 0.10.2
# packages in environment at /opt/conda:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                      1_llvm    conda-forge
ablog                     0.10.17                  pypi_0    pypi
abseil-cpp                20210324.2           h9c3ff4c_0    conda-forge
access                    1.1.3              pyhd8ed1ab_0    conda-forge
adal                      1.2.7              pyhd8ed1ab_0    conda-forge
affine                    2.3.0                      py_0    conda-forge
aiohttp                   3.7.4.post0      py38h497a2fe_0    conda-forge
alabaster                 0.7.12                   pypi_0    pypi
alembic                   1.7.3              pyhd8ed1ab_0    conda-forge
amply                     0.1.4                      py_0    conda-forge
amqp                      5.0.6              pyhd8ed1ab_0    conda-forge
anyio                     3.3.2            py38h578d9bd_0    conda-forge
appdirs                   1.4.4              pyh9f0ad1d_0    conda-forge
argon2-cffi               20.1.0           py38h497a2fe_2    conda-forge
arrow-cpp                 5.0.0           py38h94c96a7_8_cpu    conda-forge
asciitree                 0.3.3                      py_2    conda-forge
async-timeout             3.0.1                   py_1000    conda-forge
async_generator           1.10                       py_0    conda-forge
attrs                     21.2.0             pyhd8ed1ab_0    conda-forge
aws-c-cal                 0.5.11               h95a6274_0    conda-forge
aws-c-common              0.6.2                h7f98852_0    conda-forge
aws-c-event-stream        0.2.7               h3541f99_13    conda-forge
aws-c-io                  0.10.5               hfb6a706_0    conda-forge
aws-checksums             0.1.11               ha31a3da_7    conda-forge
aws-sdk-cpp               1.8.186              hb4091e7_3    conda-forge
babel                     2.9.1              pyh44b312d_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
bcrypt                    3.2.0            py38h497a2fe_1    conda-forge
beautifulsoup4            4.10.0             pyha770c72_0    conda-forge
billiard                  3.6.4.0          py38h497a2fe_0    conda-forge
black                     21.9b0             pyhd8ed1ab_0    conda-forge
blas                      2.111                  openblas    conda-forge
blas-devel                3.9.0           11_linux64_openblas    conda-forge
bleach                    4.1.0              pyhd8ed1ab_0    conda-forge
blinker                   1.4                        py_1    conda-forge
blosc                     1.21.0               h9c3ff4c_0    conda-forge
bokeh                     2.4.0            py38h578d9bd_0    conda-forge
boost-cpp                 1.74.0               h312852a_4    conda-forge
boto3                     1.18.53            pyhd8ed1ab_0    conda-forge
botocore                  1.21.53            pyhd8ed1ab_0    conda-forge
bottleneck                1.3.2            py38h6c62de6_4    conda-forge
branca                    0.4.2              pyhd8ed1ab_0    conda-forge
brotli                    1.0.9                h7f98852_5    conda-forge
brotli-bin                1.0.9                h7f98852_5    conda-forge
brotlipy                  0.7.0           py38h497a2fe_1001    conda-forge
brunsli                   0.1                  he1b5a44_0    conda-forge
bs4                       4.10.0               hd8ed1ab_0    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
c-ares                    1.17.2               h7f98852_0    conda-forge
ca-certificates           2021.5.30            ha878542_0    conda-forge
cachetools                4.2.4              pyhd8ed1ab_0    conda-forge
cairo                     1.16.0            h6cf1ce9_1008    conda-forge
celery                    5.1.2              pyhd8ed1ab_0    conda-forge
cenpy                     1.0.0.post4                py_0    conda-forge
certifi                   2021.5.30        py38h578d9bd_0    conda-forge
certipy                   0.1.3                      py_0    conda-forge
cffi                      1.14.6           py38ha65f79e_0    conda-forge
cfitsio                   3.470                hb418390_7    conda-forge
cftime                    1.5.1            py38h6c62de6_0    conda-forge
chardet                   4.0.0            py38h578d9bd_1    conda-forge
charls                    2.2.0                h9c3ff4c_0    conda-forge
charset-normalizer        2.0.0              pyhd8ed1ab_0    conda-forge
click                     7.1.2              pyh9f0ad1d_0    conda-forge
click-didyoumean          0.0.3              pyh8c360ce_0    conda-forge
click-plugins             1.1.1                      py_0    conda-forge
click-repl                0.2.0              pyhd8ed1ab_0    conda-forge
cligj                     0.7.2              pyhd8ed1ab_0    conda-forge
cloudpickle               2.0.0              pyhd8ed1ab_0    conda-forge
clustergram               0.5.1              pyhd8ed1ab_0    conda-forge
coincbc                   2.10.5               hcee13e7_1    conda-forge
colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
colorcet                  2.0.6              pyhd8ed1ab_0    conda-forge
conda                     4.9.2            py38h578d9bd_0    conda-forge
conda-package-handling    1.7.3            py38h497a2fe_0    conda-forge
configurable-http-proxy   4.5.0           node15_he6ea98c_0    conda-forge
contextily                1.1.0              pyhd8ed1ab_0    conda-forge
coverage                  6.0              py38h497a2fe_0    conda-forge
cryptography              3.4.7            py38ha5dfef3_0    conda-forge
curl                      7.79.1               h2574ce0_1    conda-forge
cycler                    0.10.0                     py_2    conda-forge
cykhash                   1.0.2            py38h950e882_2    conda-forge
cython                    0.29.24          py38h709712a_0    conda-forge
cytoolz                   0.11.0           py38h497a2fe_3    conda-forge
dask                      2021.9.1           pyhd8ed1ab_0    conda-forge
dask-core                 2021.9.1           pyhd8ed1ab_0    conda-forge
dask-geopandas            0.1.0a2                  pypi_0    pypi
dask-glm                  0.2.0                      py_1    conda-forge
dask-kubernetes           2021.3.1           pyhd8ed1ab_0    conda-forge
dask-ml                   1.9.0              pyhd8ed1ab_0    conda-forge
dataclasses               0.8                pyhc8e2a94_3    conda-forge
datacube                  1.8.6              pyhd8ed1ab_0    conda-forge
datashader                0.13.0             pyh6c4a22f_0    conda-forge
datashape                 0.5.4                      py_1    conda-forge
debugpy                   1.4.1            py38h709712a_0    conda-forge
decorator                 5.1.0              pyhd8ed1ab_0    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
deprecation               2.1.0              pyh9f0ad1d_0    conda-forge
descartes                 1.1.0                      py_4    conda-forge
distributed               2021.9.1         py38h578d9bd_0    conda-forge
docutils                  0.17.1           py38h578d9bd_0    conda-forge
download                  0.3.5                    pypi_0    pypi
entrypoints               0.3             py38h32f6830_1002    conda-forge
esda                      2.4.1              pyhd8ed1ab_0    conda-forge
et_xmlfile                1.0.1                   py_1001    conda-forge
expat                     2.4.1                h9c3ff4c_0    conda-forge
fasteners                 0.16               pyhd8ed1ab_0    conda-forge
feather-format            0.4.1              pyh9f0ad1d_0    conda-forge
feedgen                   0.9.0                    pypi_0    pypi
fiona                     1.8.20           py38hbb147eb_1    conda-forge
flake8                    3.9.2              pyhd8ed1ab_0    conda-forge
folium                    0.12.0             pyhd8ed1ab_1    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
fontconfig                2.13.1            hba837de_1005    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
freetype                  2.10.4               h0708190_1    conda-forge
freexl                    1.0.6                h7f98852_0    conda-forge
fsspec                    2021.10.0          pyhd8ed1ab_0    conda-forge
fuzzywuzzy                0.18.0             pyhd8ed1ab_0    conda-forge
gdal                      3.3.2            py38h81a01a0_4    conda-forge
geoalchemy2               0.8.4                    pypi_0    pypi
geocube                   0.0.17             pyhd8ed1ab_0    conda-forge
geographiclib             1.52               pyhd8ed1ab_0    conda-forge
geopandas                 0.10.0             pyhd8ed1ab_0    conda-forge
geopandas-base            0.10.0             pyha770c72_0    conda-forge
geopandas-view            0.0.1                    pypi_0    pypi
geopy                     2.2.0              pyhd8ed1ab_0    conda-forge
geos                      3.9.1                h9c3ff4c_2    conda-forge
geotiff                   1.7.0                hcfb7246_3    conda-forge
gettext                   0.19.8.1          h0b5b191_1005    conda-forge
gflags                    2.2.2             he1b5a44_1004    conda-forge
giddy                     2.3.3                      py_0    conda-forge
giflib                    5.2.1                h516909a_2    conda-forge
gitdb                     4.0.7              pyhd8ed1ab_0    conda-forge
gitpython                 3.1.24             pyhd8ed1ab_0    conda-forge
glog                      0.5.0                h48cff8f_0    conda-forge
gmp                       6.2.1                h58526e2_0    conda-forge
gmpy2                     2.1.0b5          py38h8384b0a_0    conda-forge
google-auth               2.2.1              pyh6c4a22f_0    conda-forge
greenlet                  1.1.2            py38h709712a_0    conda-forge
grpc-cpp                  1.40.0               h05f19cf_2    conda-forge
h3-py                     3.7.3            py38h709712a_1    conda-forge
hdbscan                   0.8.27           py38h5c078b8_0    conda-forge
hdf4                      4.2.15               h10796ff_3    conda-forge
hdf5                      1.12.1          nompi_h2750804_100    conda-forge
heapdict                  1.0.1                      py_0    conda-forge
icu                       68.1                 h58526e2_0    conda-forge
idna                      3.1                pyhd3deb0d_0    conda-forge
imagecodecs               2021.7.30        py38hb5ce8f7_1    conda-forge
imageio                   2.9.0                      py_0    conda-forge
imagesize                 1.2.0                    pypi_0    pypi
importlib-metadata        4.8.1            py38h578d9bd_0    conda-forge
importlib_resources       5.2.2              pyhd8ed1ab_0    conda-forge
inequality                1.0.0                      py_0    conda-forge
iniconfig                 1.1.1              pyh9f0ad1d_0    conda-forge
intake                    0.6.3              pyhd8ed1ab_0    conda-forge
intake-stac               0.3.0                      py_0    conda-forge
intake-xarray             0.5.0              pyhd8ed1ab_0    conda-forge
invoke                    1.5.0                    pypi_0    pypi
ipykernel                 6.4.1            py38he5a9106_0    conda-forge
ipyleaflet                0.14.0             pyhd8ed1ab_1    conda-forge
ipympl                    0.8.0              pyhd8ed1ab_0    conda-forge
ipyparallel               7.1.0              pyhd8ed1ab_0    conda-forge
ipyspin                   0.1.5              pyhd8ed1ab_0    conda-forge
ipython                   7.28.0           py38he5a9106_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
ipyurl                    0.1.2              pyhc268e32_1    conda-forge
ipywidgets                7.6.5              pyhd8ed1ab_0    conda-forge
jbig                      2.1               h7f98852_2003    conda-forge
jdcal                     1.4.1                      py_0    conda-forge
jedi                      0.18.0           py38h578d9bd_2    conda-forge
jinja2                    3.0.1              pyhd8ed1ab_0    conda-forge
jmespath                  0.10.0             pyh9f0ad1d_0    conda-forge
joblib                    1.0.1              pyhd8ed1ab_0    conda-forge
jpeg                      9d                   h516909a_0    conda-forge
json-c                    0.15                 h98cffda_0    conda-forge
json5                     0.9.5              pyh9f0ad1d_0    conda-forge
jsonschema                4.0.1              pyhd8ed1ab_0    conda-forge
jupyter-book              0.10.1                   pypi_0    pypi
jupyter-cache             0.4.2                    pypi_0    pypi
jupyter-packaging         0.10.6             pyhd8ed1ab_0    conda-forge
jupyter-server-mathjax    0.2.3              pyhd8ed1ab_0    conda-forge
jupyter-server-proxy      3.1.0              pyhd8ed1ab_0    conda-forge
jupyter-sphinx            0.3.1                    pypi_0    pypi
jupyter_bokeh             3.0.2              pyhd8ed1ab_0    conda-forge
jupyter_client            7.0.5              pyhd8ed1ab_0    conda-forge
jupyter_core              4.8.1            py38h578d9bd_0    conda-forge
jupyter_server            1.11.0             pyhd8ed1ab_0    conda-forge
jupyter_telemetry         0.1.0              pyhd8ed1ab_1    conda-forge
jupyterhub                1.4.2            py38h578d9bd_0    conda-forge
jupyterhub-base           1.4.2            py38h578d9bd_0    conda-forge
jupyterlab                3.1.14             pyhd8ed1ab_0    conda-forge
jupyterlab-geojson        3.1.2                    pypi_0    pypi
jupyterlab_pygments       0.1.2              pyh9f0ad1d_0    conda-forge
jupyterlab_server         2.8.2              pyhd8ed1ab_0    conda-forge
jupyterlab_widgets        1.0.2              pyhd8ed1ab_0    conda-forge
jupytext                  1.13.0             pyhd0ecf6b_0    conda-forge
jxrlib                    1.1                  h516909a_2    conda-forge
kealib                    1.4.14               h87e4c3c_3    conda-forge
kiwisolver                1.3.2            py38h1fd1430_0    conda-forge
kombu                     5.1.0            py38h578d9bd_0    conda-forge
krb5                      1.19.2               hcc1bbae_2    conda-forge
kubernetes_asyncio        18.20.0            pyhd8ed1ab_0    conda-forge
lark-parser               0.12.0             pyhd8ed1ab_0    conda-forge
latexcodec                2.0.1                    pypi_0    pypi
lckr-jupyterlab-variableinspector 3.0.6                    pypi_0    pypi
lcms2                     2.12                 hddcbb42_0    conda-forge
ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
legendgram                0.0.3                      py_1    conda-forge
lerc                      2.2.1                h9c3ff4c_0    conda-forge
libaec                    1.0.6                h9c3ff4c_0    conda-forge
libarchive                3.5.2                hccf745f_1    conda-forge
libblas                   3.9.0           11_linux64_openblas    conda-forge
libbrotlicommon           1.0.9                h7f98852_5    conda-forge
libbrotlidec              1.0.9                h7f98852_5    conda-forge
libbrotlienc              1.0.9                h7f98852_5    conda-forge
libcblas                  3.9.0           11_linux64_openblas    conda-forge
libcurl                   7.79.1               h2574ce0_1    conda-forge
libdap4                   3.20.6               hd7c4107_2    conda-forge
libdeflate                1.7                  h7f98852_5    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libevent                  2.1.10               hcdb4288_3    conda-forge
libffi                    3.3                  h58526e2_2    conda-forge
libgcc-ng                 11.2.0               h1d223b6_9    conda-forge
libgdal                   3.3.2                h9c9eb65_4    conda-forge
libgfortran-ng            11.2.0               h69a702a_9    conda-forge
libgfortran5              11.2.0               h5c6108e_9    conda-forge
libglib                   2.68.4               h3e27bee_0    conda-forge
libgomp                   11.2.0               h1d223b6_9    conda-forge
libiconv                  1.16                 h516909a_0    conda-forge
libkml                    1.3.0             h238a007_1014    conda-forge
liblapack                 3.9.0           11_linux64_openblas    conda-forge
liblapacke                3.9.0           11_linux64_openblas    conda-forge
libllvm10                 10.0.1               he513fc3_3    conda-forge
libllvm11                 11.1.0               hf817b99_2    conda-forge
libnetcdf                 4.8.1           nompi_hb3fd0d9_101    conda-forge
libnghttp2                1.43.0               h812cca2_1    conda-forge
libopenblas               0.3.17          pthreads_h8fe5266_1    conda-forge
libpng                    1.6.37               hed695b0_2    conda-forge
libpq                     13.3                 hd57d9b9_0    conda-forge
libprotobuf               3.18.0               h780b84a_1    conda-forge
libpysal                  4.5.1              pyhd8ed1ab_0    conda-forge
librttopo                 1.1.0                h1185371_6    conda-forge
libsodium                 1.0.18               h516909a_1    conda-forge
libsolv                   0.7.19               h780b84a_5    conda-forge
libspatialindex           1.9.3                h9c3ff4c_4    conda-forge
libspatialite             5.0.1                h8796b1e_9    conda-forge
libssh2                   1.10.0               ha56f1ee_2    conda-forge
libstdcxx-ng              11.2.0               he4da1e4_9    conda-forge
libthrift                 0.15.0               he6d91bd_0    conda-forge
libtiff                   4.3.0                hf544144_1    conda-forge
libutf8proc               2.6.1                h7f98852_0    conda-forge
libuuid                   2.32.1            h14c3975_1000    conda-forge
libuv                     1.41.1               h7f98852_0    conda-forge
libwebp-base              1.2.1                h7f98852_0    conda-forge
libxcb                    1.13              h7f98852_1003    conda-forge
libxml2                   2.9.12               h72842e0_0    conda-forge
libxslt                   1.1.33               h15afd5d_2    conda-forge
libzip                    1.8.0                h4de3113_1    conda-forge
libzlib                   1.2.11            h36c2ea0_1013    conda-forge
libzopfli                 1.0.3                he1b5a44_0    conda-forge
linkify-it-py             1.0.1                    pypi_0    pypi
llvm-openmp               12.0.1               h4bd325d_1    conda-forge
llvmlite                  0.37.0           py38h4630a5e_0    conda-forge
locket                    0.2.0                      py_2    conda-forge
lxml                      4.6.3            py38hf1fe3a4_0    conda-forge
lz4-c                     1.9.3                h9c3ff4c_1    conda-forge
lzo                       2.10              h516909a_1000    conda-forge
mako                      1.1.5              pyhd8ed1ab_0    conda-forge
mamba                     0.16.0           py38h2aa5da1_0    conda-forge
mapclassify               2.4.3              pyhd8ed1ab_0    conda-forge
markdown-it-py            1.1.0              pyhd8ed1ab_0    conda-forge
markupsafe                2.0.1            py38h497a2fe_0    conda-forge
matplotlib-base           3.4.3            py38hf4fb855_1    conda-forge
matplotlib-inline         0.1.3              pyhd8ed1ab_0    conda-forge
matplotlib-scalebar       0.7.2                    pypi_0    pypi
mccabe                    0.6.1                      py_1    conda-forge
mdit-py-plugins           0.2.8              pyhd8ed1ab_0    conda-forge
mercantile                1.2.1              pyhd8ed1ab_0    conda-forge
mgwr                      2.1.2                      py_0    conda-forge
mistune                   0.8.4           py38h497a2fe_1004    conda-forge
mock                      4.0.3            py38h578d9bd_1    conda-forge
momepy                    0.5.0              pyhd8ed1ab_1    conda-forge
monotonic                 1.5                        py_0    conda-forge
more-itertools            8.10.0             pyhd8ed1ab_0    conda-forge
morecantile               3.0.0              pyhd8ed1ab_0    conda-forge
mpc                       1.2.1                h9f54685_0    conda-forge
mpfr                      4.1.0                h9202a9a_1    conda-forge
mpmath                    1.2.1              pyhd8ed1ab_0    conda-forge
msgpack-python            1.0.2            py38h1fd1430_1    conda-forge
multidict                 5.2.0            py38h497a2fe_0    conda-forge
multipledispatch          0.6.0                      py_0    conda-forge
munch                     2.5.0                      py_0    conda-forge
mypy_extensions           0.4.3            py38h578d9bd_3    conda-forge
myst-nb                   0.12.0                   pypi_0    pypi
myst-parser               0.13.5                   pypi_0    pypi
nbclassic                 0.3.2              pyhd8ed1ab_0    conda-forge
nbclient                  0.5.4              pyhd8ed1ab_0    conda-forge
nbconvert                 6.2.0            py38h578d9bd_0    conda-forge
nbdime                    3.1.0              pyhd8ed1ab_0    conda-forge
nbformat                  5.1.3              pyhd8ed1ab_0    conda-forge
ncurses                   6.2                  h58526e2_4    conda-forge
nest-asyncio              1.5.1              pyhd8ed1ab_0    conda-forge
nested-lookup             0.2.22                   pypi_0    pypi
netcdf4                   1.5.7           nompi_py38h2823cc8_103    conda-forge
networkx                  2.5                        py_0    conda-forge
nodejs                    15.14.0              h92b4a50_0    conda-forge
nose                      1.3.7           py38h32f6830_1004    conda-forge
notebook                  6.4.4              pyha770c72_0    conda-forge
nspr                      4.30                 h9c3ff4c_0    conda-forge
nss                       3.69                 hb5efdd6_1    conda-forge
numba                     0.54.0           py38h4bf6c61_0    conda-forge
numcodecs                 0.9.1            py38h709712a_0    conda-forge
numexpr                   2.7.3            py38h51da96c_0    conda-forge
numpy                     1.20.3           py38h9894fe3_1    conda-forge
oauthlib                  3.1.1              pyhd8ed1ab_0    conda-forge
olefile                   0.46               pyh9f0ad1d_1    conda-forge
openblas                  0.3.17          pthreads_h4748800_1    conda-forge
openjpeg                  2.4.0                hb52868f_1    conda-forge
openpyxl                  3.0.9              pyhd8ed1ab_0    conda-forge
openssl                   1.1.1l               h7f98852_0    conda-forge
orc                       1.7.0                h68e2c4e_0    conda-forge
osmnet                    0.1.6                      py_0    conda-forge
osmnx                     1.1.1              pyhd8ed1ab_0    conda-forge
packaging                 21.0               pyhd8ed1ab_0    conda-forge
palettable                3.3.0                      py_0    conda-forge
pamela                    1.0.0                      py_0    conda-forge
pandana                   0.6.1            py38h1abd341_0    conda-forge
pandas                    1.3.3            py38h43a58ef_0    conda-forge
pandas-bokeh              0.5.4                    pypi_0    pypi
pandoc                    2.14.2               h7f98852_0    conda-forge
pandocfilters             1.5.0              pyhd8ed1ab_0    conda-forge
param                     1.11.1             pyh6c4a22f_0    conda-forge
paramiko                  2.7.2              pyh9f0ad1d_0    conda-forge
parquet-cpp               1.5.1                         1    conda-forge
parso                     0.8.2              pyhd8ed1ab_0    conda-forge
partd                     1.2.0              pyhd8ed1ab_0    conda-forge
pathspec                  0.9.0              pyhd8ed1ab_0    conda-forge
patsy                     0.5.2              pyhd8ed1ab_0    conda-forge
pcre                      8.45                 h9c3ff4c_0    conda-forge
pexpect                   4.8.0            py38h32f6830_1    conda-forge
pickleshare               0.7.5           py38h32f6830_1002    conda-forge
pillow                    8.3.2            py38h8e6f84c_0    conda-forge
pip                       21.2.4             pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               h36c2ea0_0    conda-forge
platformdirs              2.3.0              pyhd8ed1ab_0    conda-forge
pluggy                    1.0.0            py38h578d9bd_1    conda-forge
pointpats                 2.2.0                      py_0    conda-forge
polyline                  1.4.0                      py_0    conda-forge
pooch                     1.5.1              pyhd8ed1ab_0    conda-forge
poppler                   21.09.0              ha39eefc_3    conda-forge
poppler-data              0.4.11               hd8ed1ab_0    conda-forge
postgresql                13.3                 h2510834_0    conda-forge
proj                      8.1.1                h277dcde_2    conda-forge
prometheus_client         0.11.0             pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.20             pyha770c72_0    conda-forge
prompt_toolkit            3.0.20               hd8ed1ab_0    conda-forge
psutil                    5.8.0            py38h497a2fe_1    conda-forge
psycopg2                  2.9.1            py38h497a2fe_0    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pulp                      2.5.0            py38h578d9bd_0    conda-forge
py                        1.10.0             pyhd3deb0d_0    conda-forge
pyarrow                   5.0.0           py38h1bc9799_8_cpu    conda-forge
pyasn1                    0.4.8                      py_0    conda-forge
pyasn1-modules            0.2.7                      py_0    conda-forge
pybtex                    0.24.0                   pypi_0    pypi
pybtex-docutils           1.0.0                    pypi_0    pypi
pycodestyle               2.7.0              pyhd8ed1ab_0    conda-forge
pycosat                   0.6.3           py38h497a2fe_1006    conda-forge
pycparser                 2.20               pyh9f0ad1d_2    conda-forge
pyct                      0.4.8                      py_0    pyviz
pyct-core                 0.4.8                      py_0    pyviz
pycurl                    7.44.1           py38h996a351_0    conda-forge
pydantic                  1.8.2            py38h497a2fe_0    conda-forge
pydata-sphinx-theme       0.4.3                    pypi_0    pypi
pyee                      8.1.0              pyh9f0ad1d_0    conda-forge
pyflakes                  2.3.1              pyhd8ed1ab_0    conda-forge
pygeoda                   0.0.8                    pypi_0    pypi
pygeos                    0.10.2           py38hb7fe4a8_0    conda-forge
pygments                  2.10.0             pyhd8ed1ab_0    conda-forge
pyjwt                     2.1.0              pyhd8ed1ab_0    conda-forge
pynacl                    1.4.0            py38h497a2fe_2    conda-forge
pyopenssl                 21.0.0             pyhd8ed1ab_0    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pyppeteer                 0.2.6              pyhd8ed1ab_0    conda-forge
pyproj                    3.2.1            py38h80797bf_2    conda-forge
pyrobuf                   0.9.3            py38h709712a_2    conda-forge
pyrosm                    0.6.0            py38hadf7658_0    conda-forge
pyrsistent                0.17.3           py38h497a2fe_2    conda-forge
pysal                     2.5.0              pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1            py38h578d9bd_3    conda-forge
pytables                  3.6.1            py38hdb04529_4    conda-forge
pytest                    6.2.5            py38h578d9bd_0    conda-forge
pytest-cov                3.0.0              pyhd8ed1ab_0    conda-forge
pytest-tornasync          0.6.0.post2              pypi_0    pypi
python                    3.8.8           hffdb5ce_0_cpython    conda-forge
python-dateutil           2.7.5                      py_0    conda-forge
python-editor             1.0.4                      py_0    conda-forge
python-json-logger        2.0.1              pyh9f0ad1d_0    conda-forge
python-kubernetes         18.20.0            pyhd8ed1ab_0    conda-forge
python-levenshtein        0.12.2           py38h497a2fe_0    conda-forge
python-rapidjson          1.4              py38h709712a_0    conda-forge
python-snappy             0.6.0            py38h49bdff1_0    conda-forge
python_abi                3.8                      2_cp38    conda-forge
pytz                      2021.1             pyhd8ed1ab_0    conda-forge
pyu2f                     0.1.5              pyhd8ed1ab_0    conda-forge
pywavelets                1.1.1            py38hab2c0dc_3    conda-forge
pyyaml                    5.4.1            py38h497a2fe_1    conda-forge
pyzmq                     22.3.0           py38h2035c66_0    conda-forge
quantecon                 0.5.1            py38h578d9bd_0    conda-forge
rasterio                  1.2.9            py38hfd64e68_2    conda-forge
rasterstats               0.15.0             pyhd8ed1ab_0    conda-forge
re2                       2021.09.01           h9c3ff4c_0    conda-forge
readline                  8.1                  h46c0cb4_0    conda-forge
redis-py                  3.5.3              pyh9f0ad1d_0    conda-forge
regex                     2021.9.30        py38h497a2fe_0    conda-forge
reproc                    14.2.3               h7f98852_0    conda-forge
reproc-cpp                14.2.3               h9c3ff4c_0    conda-forge
requests                  2.26.0             pyhd8ed1ab_0    conda-forge
requests-oauthlib         1.3.0              pyh9f0ad1d_0    conda-forge
requests-unixsocket       0.2.0                      py_0    conda-forge
retrying                  1.3.3                      py_2    conda-forge
rio-cogeo                 3.0.0              pyhd8ed1ab_0    conda-forge
rioxarray                 0.7.1              pyhd8ed1ab_0    conda-forge
rpy2                      3.4.3                    pypi_0    pypi
rsa                       4.7.2              pyh44b312d_0    conda-forge
rtree                     0.9.7            py38h02d302b_2    conda-forge
ruamel.yaml               0.17.16          py38h497a2fe_0    conda-forge
ruamel.yaml.clib          0.2.2            py38h497a2fe_2    conda-forge
ruamel_yaml               0.15.80         py38h497a2fe_1004    conda-forge
rvlib                     0.0.5            py38h6c62de6_0    conda-forge
s2n                       1.0.10               h9b69904_0    conda-forge
s3transfer                0.5.0              pyhd8ed1ab_0    conda-forge
sat-stac                  0.4.1              pyh44b312d_0    conda-forge
scikit-image              0.18.3           py38h43a58ef_0    conda-forge
scikit-learn              1.0              py38hacb3eff_1    conda-forge
scipy                     1.7.1            py38h56a6a73_0    conda-forge
seaborn                   0.11.2               hd8ed1ab_0    conda-forge
seaborn-base              0.11.2             pyhd8ed1ab_0    conda-forge
segregation               2.1.0              pyhd8ed1ab_0    conda-forge
send2trash                1.8.0              pyhd8ed1ab_0    conda-forge
setuptools                58.0.4           py38h578d9bd_2    conda-forge
shapely                   1.7.1            py38hb7fe4a8_5    conda-forge
simpervisor               0.4                pyhd8ed1ab_0    conda-forge
simplejson                3.17.5           py38h497a2fe_0    conda-forge
simplification            0.5.12                   pypi_0    pypi
six                       1.16.0             pyh6c4a22f_0    conda-forge
smmap                     3.0.5              pyh44b312d_0    conda-forge
snappy                    1.1.8                he1b5a44_3    conda-forge
sniffio                   1.2.0            py38h578d9bd_1    conda-forge
snowballstemmer           2.1.0                    pypi_0    pypi
snuggs                    1.4.7                      py_0    conda-forge
sortedcontainers          2.4.0              pyhd8ed1ab_0    conda-forge
soupsieve                 2.0.1            py38h32f6830_0    conda-forge
spaghetti                 1.6.4              pyhd8ed1ab_0    conda-forge
spatialpandas             0.4.3              pyhd8ed1ab_0    conda-forge
spglm                     1.0.8                      py_0    conda-forge
sphinx                    3.5.3                    pypi_0    pypi
sphinx-book-theme         0.0.42                   pypi_0    pypi
sphinx-comments           0.0.3                    pypi_0    pypi
sphinx-copybutton         0.3.1                    pypi_0    pypi
sphinx-panels             0.5.2                    pypi_0    pypi
sphinx-thebe              0.0.8                    pypi_0    pypi
sphinx-togglebutton       0.2.3                    pypi_0    pypi
sphinxcontrib-applehelp   1.0.2                    pypi_0    pypi
sphinxcontrib-bibtex      2.1.4                    pypi_0    pypi
sphinxcontrib-devhelp     1.0.2                    pypi_0    pypi
sphinxcontrib-htmlhelp    1.0.3                    pypi_0    pypi
sphinxcontrib-jsmath      1.0.1                    pypi_0    pypi
sphinxcontrib-qthelp      1.0.3                    pypi_0    pypi
sphinxcontrib-serializinghtml 1.1.4                    pypi_0    pypi
spint                     1.0.7              pyhd8ed1ab_0    conda-forge
splot                     1.1.4              pyhd8ed1ab_0    conda-forge
spopt                     0.1.2              pyhd8ed1ab_0    conda-forge
spreg                     1.2.4              pyhd8ed1ab_0    conda-forge
spvcm                     0.3.0                      py_0    conda-forge
sqlalchemy                1.4.25           py38h497a2fe_0    conda-forge
sqlite                    3.36.0               h9cd32fc_2    conda-forge
sshtunnel                 0.3.1              pyhd8ed1ab_0    conda-forge
statsmodels               0.13.0           py38h6c62de6_0    conda-forge
supermercado              0.2.0              pyh9f0ad1d_0    conda-forge
sympy                     1.8              py38h578d9bd_0    conda-forge
tabulate                  0.8.9              pyhd8ed1ab_0    conda-forge
tblib                     1.7.0              pyhd8ed1ab_0    conda-forge
terminado                 0.12.1           py38h578d9bd_0    conda-forge
testpath                  0.5.0              pyhd8ed1ab_0    conda-forge
threadpoolctl             3.0.0              pyh8a188c0_0    conda-forge
tifffile                  2021.8.30          pyhd8ed1ab_0    conda-forge
tiledb                    2.3.4                he87e0bf_0    conda-forge
tini                      0.18.0            h14c3975_1001    conda-forge
tk                        8.6.11               h27826a3_1    conda-forge
tobler                    0.7.0                    pypi_0    pypi
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
tomli                     1.2.1              pyhd8ed1ab_0    conda-forge
tomlkit                   0.7.2            py38h578d9bd_0    conda-forge
toolz                     0.11.1                     py_0    conda-forge
topojson                  1.0                      pypi_0    pypi
tornado                   6.1              py38h497a2fe_1    conda-forge
tqdm                      4.62.3             pyhd8ed1ab_0    conda-forge
traitlets                 5.1.0              pyhd8ed1ab_0    conda-forge
traittypes                0.2.1              pyh9f0ad1d_2    conda-forge
typed-ast                 1.4.3            py38h497a2fe_0    conda-forge
typing-extensions         3.10.0.2             hd8ed1ab_0    conda-forge
typing_extensions         3.10.0.2           pyha770c72_0    conda-forge
tzcode                    2021a                h7f98852_2    conda-forge
tzdata                    2021b                he74cb21_0    conda-forge
uc-micro-py               1.0.1                    pypi_0    pypi
urbanaccess               0.2.2              pyhd3deb0d_0    conda-forge
urbangrammar-graphics     1.2.2                    pypi_0    pypi
urllib3                   1.25.11                    py_0    conda-forge
vine                      5.0.0              pyhd8ed1ab_1    conda-forge
watchdog                  2.0.2                    pypi_0    pypi
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
webencodings              0.5.1                      py_1    conda-forge
websocket-client          0.57.0           py38h578d9bd_4    conda-forge
websockets                9.1              py38h497a2fe_0    conda-forge
wheel                     0.37.0             pyhd8ed1ab_1    conda-forge
widgetsnbextension        3.5.1            py38h578d9bd_4    conda-forge
xarray                    0.19.0             pyhd8ed1ab_1    conda-forge
xarray-spatial            0.1.8              pyhd8ed1ab_0    conda-forge
xarray_leaflet            0.1.15             pyhd8ed1ab_0    conda-forge
xerces-c                  3.2.3                h9d8b166_2    conda-forge
xlrd                      2.0.1              pyhd8ed1ab_3    conda-forge
xlsxwriter                3.0.1              pyhd8ed1ab_0    conda-forge
xorg-kbproto              1.0.7             h14c3975_1002    conda-forge
xorg-libice               1.0.10               h516909a_0    conda-forge
xorg-libsm                1.2.3             hd9c2040_1000    conda-forge
xorg-libx11               1.7.2                h7f98852_0    conda-forge
xorg-libxau               1.0.9                h14c3975_0    conda-forge
xorg-libxdmcp             1.1.3                h516909a_0    conda-forge
xorg-libxext              1.3.4                h7f98852_1    conda-forge
xorg-libxrender           0.9.10            h7f98852_1003    conda-forge
xorg-renderproto          0.11.1            h14c3975_1002    conda-forge
xorg-xextproto            7.3.0             h14c3975_1002    conda-forge
xorg-xproto               7.0.31            h14c3975_1007    conda-forge
xyzservices               2021.9.1           pyhd8ed1ab_0    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
yaml                      0.2.5                h516909a_0    conda-forge
yarl                      1.6.3            py38h497a2fe_2    conda-forge
zarr                      2.10.1             pyhd8ed1ab_0    conda-forge
zeromq                    4.3.4                h9c3ff4c_1    conda-forge
zfp                       0.5.5                h9c3ff4c_7    conda-forge
zict                      2.0.0                      py_0    conda-forge
zipp                      3.6.0              pyhd8ed1ab_0    conda-forge
zlib                      1.2.11            h36c2ea0_1013    conda-forge
zstd                      1.5.0                ha95c52a_0    conda-forge
@brendan-ward
Copy link
Contributor

I am able to reproduce this; haven't yet determined if this is on the pygeos or the GEOS side.

However, the second geography is not valid:

>>> pygeos.is_valid(g2)
False
>>> pygeos.make_valid(g2)
<pygeos.Geometry POINT (0 5)>

I agree that these warnings are not ideal, but if they are limited to invalid geometries, it may not be possible to easily avoid those.

@martinfleis
Copy link
Contributor Author

Ah, that was a typo that caused invalid geometry.

Fixing the invalid geometry resolved the second warning, the overflow is still there. At least I can see it on this snippet:

x, y = 1, 6
g1 = pygeos.box(x, y, x+1, y+1)
g2 = pygeos.box(x-2, y-2, x-1, y-1)
pygeos.distance(g1, g2)

@jorisvandenbossche
Copy link
Member

See also #167. It's not really clear to me where the warning is coming from exactly.

@martinfleis
Copy link
Contributor Author

According to https://stackoverflow.com/a/7559950/9978945, numpy emits overflow encountered in distance when the value is larger than what dtype supports.

@caspervdw
Copy link
Member

I assume the output datatype is float64? As GEOS outputs a double, there should be no typecasting. The overflow is surprising.
Maybe you can verify by providing an explicit “out” array?

I wonder were the numpy code is that triggers this warning for float64 output. Haven’t found it yet…

@martinfleis
Copy link
Contributor Author

martinfleis commented Oct 5, 2021

maybe you can verify by providing an explicit “out” array?

Do you mean like this? That doesn't make a difference, the warning is still there.

pygeos.distance([g1, g2], [g2, g1], out=numpy.ones((2, ), dtype=numpy.float64))

@jorisvandenbossche
Copy link
Member

cc @seberg in case you have an idea about where we could look for finding the reason that our custom ufunc gives such overflow warnings

@caspervdw
Copy link
Member

caspervdw commented Oct 5, 2021

maybe you can verify by providing an explicit “out” array?

Do you mean like this? That doesn't make a difference, the warning is still there.

pygeos.distance([g1, g2], [g2, g1], out=numpy.ones((2, ), dtype=numpy.float64))

Yes exactly. I can't reproduce with your snippet on my system, also when specifying dtype=numpy.float32. But I do have the "invalid value" warnings from the hausdorff_distance tests, which essentially use the same code in ufuncs.c.

Maybe you can do something like this to inspect the binary output:

out = np.empty((1,), dtype=np.float64)
pygeos.distance(g1, g2, out=out)
out.tobytes().hex()

For my hausdorff_distance tests, I got d2f17d82555c3640, which is a perfectly fine double-precision float (22.36067977).

@martinfleis
Copy link
Contributor Author

I get 'cd3b7f669ea0f63f' for this snippet.

@caspervdw
Copy link
Member

My current theory is that GEOS internally sets floating point error flags (IEEE 754) and that numpy picks these up and neatly reports them to the user.

I see no other way that our wrapping code would trigger such warnings when the output value is in fact completely valid.

In that case, a fix should be done upstream in GEOS.

@seberg
Copy link

seberg commented Oct 5, 2021

My current theory is that GEOS internally sets floating point error flags (IEEE 754) and that numpy picks these up and neatly reports them to the user.

That sounds right. Below, way too much information that probably doesn't apply :).

There are some things that make FPE flags annoying, e.g.:

  • Especially clang tends to be a bit sloppier (it is improving though I think), at least if not compiled with -ftrapping-math and generally compilers have bugs. (NumPy distutils always sets this flag now on new versions – if available.)
  • The C99 operators >= (not == and !=) set warning flags when confronted with NaNs (does not seem likely here though). The solution is to use isgreater (and hope compilers don't optimize it to SSE code that fails to not set the flag).

The desperate solution is to clear the FPE flags manually, although that won't discriminate and in theory you would have to store the flags and then reset them (what if casting causes FPEs to be set. To be clear, NumPy doesn't get this right).

In many cases, bad flags are due to compiler optimizations (e.g. you use vectorized units and the compiler decides to optimize away cleaning up the unused part of the SIMD vector, for clang -ftrapping-math should avoid that, but it does not yet work on all systems at least). In those cases adding a volatile can help to forbid the compiler to do incorrect optimizations.

@brendan-ward
Copy link
Contributor

On closer investigation, this appears to be propagating up from GEOS for boundable geometry comparisons.

Compiler environment:

Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin19.6.0

I'm building from the tip of GEOS main branch.

In ufuncs.c, if we instead store the result of the distance to a local variable and never return it to numpy, this warning still gets set. So - we're not causing the overflow on the pygeos side.

Comparing points that have the same distance does not raise this warning:

pygeos.distance(pygeos.Geometry('POINT (0 0)'),pygeos.Geometry('POINT (1 1)'))

whereas lines raise this warning:

pygeos.distance(pygeos.Geometry('LINESTRING (-1 -1, 0 0)'),pygeos.Geometry('LINESTRING (1 1, 2 2)'))

If we inspect the FPE flags (thanks @seberg for the tip!) after performing the calculation, we see that they are indeed set for overflow in this case:

// ...call GEOSDistance(), then ...

int raised = fetestexcept(FE_OVERFLOW);
if (raised & FE_OVERFLOW) {
    printf("Exception raised for geometry calculation: %f\n", *(double*)op1);
}

Will look next into writing a test case for GEOS for this specific case to verify that it indeed is happening there.

@brendan-ward
Copy link
Contributor

Was able to reproduce directly in GEOS, see ticket.

I don't think there are actions to take here in pygeos, short of clearing floating point exceptions after we call GEOS.

@brendan-ward
Copy link
Contributor

Thanks to some quick work by @pramsey (👏 ), this is now fixed on GEOS main and back to 3.9.

I just rebuilt pygeos from the tip of GEOS main and confirmed that the warning is no longer raised.

@martinfleis
Copy link
Contributor Author

You guys are amazing! Thanks!

@caspervdw
Copy link
Member

Closing as this is fixed upstream. Thanks @pramsey for the quick response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants