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

Shapely deprecation warning from ShapelyFeature class #1984

Closed
chowington opened this issue Jan 14, 2022 · 1 comment
Closed

Shapely deprecation warning from ShapelyFeature class #1984

chowington opened this issue Jan 14, 2022 · 1 comment
Milestone

Comments

@chowington
Copy link

Description

The ShapelyFeature class causes a deprecation warning from Shapely to appear.

Code to reproduce

Instantiate a ShapelyFeature.

Traceback

/home/chowingt/miniconda3/envs/GOS-env/lib/python3.9/site-packages/cartopy/feature/__init__.py:217: ShapelyDeprecationWarning: Iteration over multi-part geometries is deprecated and will be removed in Shapely 2.0. Use the `geoms` property to access the constituent parts of a multi-part geometry.
  self._geoms = tuple(geometries)
/home/chowingt/miniconda3/envs/GOS-env/lib/python3.9/site-packages/cartopy/feature/__init__.py:217: ShapelyDeprecationWarning: __len__ for multi-part geometries is deprecated and will be removed in Shapely 2.0. Check the length of the `geoms` property instead to get the  number of parts of a multi-part geometry.
  self._geoms = tuple(geometries)
Full environment definition

Operating system

Ubuntu 20.04.3

Cartopy version

0.20.2

conda list

# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
alabaster                 0.7.12                     py_0    conda-forge
argon2-cffi               20.1.0           py39h27cfd23_1
async_generator           1.10               pyhd3eb1b0_0
attrs                     21.2.0             pyhd3eb1b0_0
babel                     2.9.1              pyh44b312d_0    conda-forge
backcall                  0.2.0              pyhd3eb1b0_0
blas                      1.0                         mkl
bleach                    4.1.0              pyhd3eb1b0_0
bottleneck                1.3.2            py39hdd57654_1
brotli                    1.0.9                he6710b0_2
brotlipy                  0.7.0           py39h3811e60_1003    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
c-ares                    1.18.1               h7f98852_0    conda-forge
ca-certificates           2021.10.26           h06a4308_2
cartopy                   0.20.2           py39h8394fad_0    conda-forge
certifi                   2021.10.8        py39h06a4308_2
cffi                      1.14.6           py39h400218f_0
charset-normalizer        2.0.10             pyhd8ed1ab_0    conda-forge
colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
cryptography              36.0.1           py39h95dcef6_0    conda-forge
cycler                    0.11.0             pyhd3eb1b0_0
dataclasses               0.8                pyhc8e2a94_3    conda-forge
dbus                      1.13.18              hb2f20db_0
debugpy                   1.5.1            py39h295c915_0
decorator                 5.1.0              pyhd3eb1b0_0
defusedxml                0.7.1              pyhd3eb1b0_0
docutils                  0.16             py39hf3d152e_3    conda-forge
entrypoints               0.3              py39h06a4308_0
et_xmlfile                1.1.0            py39h06a4308_0
expat                     2.4.1                h2531618_2
fontconfig                2.13.1               h6c09931_0
fonttools                 4.25.0             pyhd3eb1b0_0
freetype                  2.11.0               h70c0345_0
geos                      3.10.1               h9c3ff4c_1    conda-forge
giflib                    5.2.1                h7b6447c_0
glib                      2.69.1               h5202010_0
gst-plugins-base          1.14.0               h8213a91_2
gstreamer                 1.14.0               h28cd5cc_2
haversine                 2.5.1              pyhd8ed1ab_0    conda-forge
icu                       58.2                 he6710b0_3
idna                      3.1                pyhd3deb0d_0    conda-forge
imagesize                 1.3.0              pyhd8ed1ab_0    conda-forge
importlib-metadata        4.8.2            py39h06a4308_0
importlib_metadata        4.8.2                hd3eb1b0_0
intel-openmp              2021.4.0          h06a4308_3561
ipykernel                 6.4.1            py39h06a4308_1
ipython                   7.29.0           py39hb070fc8_0
ipython_genutils          0.2.0              pyhd3eb1b0_1
ipywidgets                7.6.5              pyhd3eb1b0_1
jbig                      2.1               h7f98852_2003    conda-forge
jedi                      0.18.0           py39h06a4308_1
jinja2                    3.0.3              pyhd8ed1ab_0    conda-forge
jpeg                      9d                   h7f8727e_0
jsonschema                3.2.0              pyhd3eb1b0_2
jupyter                   1.0.0            py39h06a4308_7
jupyter_client            7.1.0              pyhd3eb1b0_0
jupyter_console           6.4.0              pyhd3eb1b0_0
jupyter_core              4.9.1            py39h06a4308_0
jupyterlab_pygments       0.1.2                      py_0
jupyterlab_widgets        1.0.0              pyhd3eb1b0_1
kiwisolver                1.3.1            py39h2531618_0
krb5                      1.19.2               hcc1bbae_3    conda-forge
latexcodec                2.0.1              pyh9f0ad1d_0    conda-forge
lcms2                     2.12                 h3be6417_0
ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
lerc                      3.0                  h9c3ff4c_0    conda-forge
libcurl                   7.81.0               h2574ce0_0    conda-forge
libdeflate                1.8                  h7f98852_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libffi                    3.3                  he6710b0_2
libgcc-ng                 11.2.0              h1d223b6_11    conda-forge
libgfortran-ng            7.5.0               ha8ba4b0_17
libgfortran4              7.5.0               ha8ba4b0_17
libgomp                   11.2.0              h1d223b6_11    conda-forge
libnghttp2                1.43.0               h812cca2_1    conda-forge
libnsl                    2.0.0                h7f98852_0    conda-forge
libpng                    1.6.37               hbc83047_0
libsodium                 1.0.18               h7b6447c_0
libssh2                   1.10.0               ha56f1ee_2    conda-forge
libstdcxx-ng              11.2.0              he4da1e4_11    conda-forge
libtiff                   4.3.0                h6f004c6_2    conda-forge
libuuid                   1.0.3                h7f8727e_2
libwebp                   1.2.0                h89dd481_0
libwebp-base              1.2.0                h27cfd23_0
libxcb                    1.14                 h7b6447c_0
libxml2                   2.9.12               h03d6c58_0
libzlib                   1.2.11            h36c2ea0_1013    conda-forge
lz4-c                     1.9.3                h295c915_1
markupsafe                2.0.1            py39h3811e60_1    conda-forge
matplotlib-base           3.5.0            py39h3ed280b_0
matplotlib-inline         0.1.2              pyhd3eb1b0_2
mistune                   0.8.4           py39h27cfd23_1000
mkl                       2021.4.0           h06a4308_640
mkl-service               2.4.0            py39h7f8727e_0
mkl_fft                   1.3.1            py39hd3c417c_0
mkl_random                1.2.2            py39h51133e4_0
munkres                   1.1.4                      py_0
nbclient                  0.5.3              pyhd3eb1b0_0
nbconvert                 6.3.0            py39h06a4308_0
nbformat                  5.1.3              pyhd3eb1b0_0
ncurses                   6.2                  h58526e2_4    conda-forge
nest-asyncio              1.5.1              pyhd3eb1b0_0
notebook                  6.4.6            py39h06a4308_0
numexpr                   2.8.1            py39h6abb31d_0
numpy                     1.21.2           py39h20f2e39_0
numpy-base                1.21.2           py39h79a1101_0
olefile                   0.46               pyhd3eb1b0_0
openpyxl                  3.0.9              pyhd3eb1b0_0
openssl                   1.1.1m               h7f8727e_0
packaging                 21.3               pyhd8ed1ab_0    conda-forge
pandas                    1.3.5            py39h8c16a72_0
pandocfilters             1.4.3            py39h06a4308_1
parso                     0.8.3              pyhd3eb1b0_0
pcre                      8.45                 h295c915_0
pexpect                   4.8.0              pyhd3eb1b0_3
pickleshare               0.7.5           pyhd3eb1b0_1003
pillow                    8.4.0            py39h5aabda8_0
pip                       21.3.1             pyhd8ed1ab_0    conda-forge
proj                      8.2.0                h277dcde_0    conda-forge
prometheus_client         0.12.0             pyhd3eb1b0_0
prompt-toolkit            3.0.20             pyhd3eb1b0_0
prompt_toolkit            3.0.20               hd3eb1b0_0
ptyprocess                0.7.0              pyhd3eb1b0_2
pybtex                    0.24.0             pyhd8ed1ab_2    conda-forge
pybtex-docutils           1.0.1            py39hf3d152e_1    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pygments                  2.11.2             pyhd8ed1ab_0    conda-forge
pyopenssl                 21.0.0             pyhd8ed1ab_0    conda-forge
pyparsing                 3.0.6              pyhd8ed1ab_0    conda-forge
pyproj                    3.3.0            py39h1b810de_0    conda-forge
pyqt                      5.9.2            py39h2531618_6
pyrsistent                0.18.0           py39heee7806_0
pyshp                     2.1.3              pyhd3eb1b0_0
pysocks                   1.7.1            py39hf3d152e_4    conda-forge
python                    3.9.7                h12debd9_1
python-dateutil           2.8.2              pyhd3eb1b0_0
python_abi                3.9                      2_cp39    conda-forge
pytz                      2021.3             pyhd8ed1ab_0    conda-forge
pyyaml                    6.0              py39h3811e60_3    conda-forge
pyzmq                     22.3.0           py39h295c915_2
qt                        5.9.7                h5867ecd_1
qtconsole                 5.1.1              pyhd3eb1b0_0
qtpy                      1.10.0             pyhd3eb1b0_0
readline                  8.1                  h46c0cb4_0    conda-forge
requests                  2.27.1             pyhd8ed1ab_0    conda-forge
scipy                     1.7.3            py39hc147768_0
send2trash                1.8.0              pyhd3eb1b0_1
setuptools                60.5.0           py39hf3d152e_0    conda-forge
shapely                   1.8.0            py39h98e2149_4    conda-forge
sip                       4.19.13          py39h2531618_0
six                       1.16.0             pyh6c4a22f_0    conda-forge
snowballstemmer           2.2.0              pyhd8ed1ab_0    conda-forge
sphinx                    4.3.2              pyh6c4a22f_0    conda-forge
sphinxcontrib-applehelp   1.0.2                      py_0    conda-forge
sphinxcontrib-bibtex      2.4.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_1    conda-forge
sqlite                    3.37.0               h9cd32fc_0    conda-forge
terminado                 0.9.4            py39h06a4308_0
testpath                  0.5.0              pyhd3eb1b0_0
tk                        8.6.11               h27826a3_1    conda-forge
tornado                   6.1              py39h27cfd23_0
traitlets                 5.1.1              pyhd3eb1b0_0
tzdata                    2021e                he74cb21_0    conda-forge
urllib3                   1.26.8             pyhd8ed1ab_1    conda-forge
wcwidth                   0.2.5              pyhd3eb1b0_0
webencodings              0.5.1            py39h06a4308_1
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
widgetsnbextension        3.5.1            py39h06a4308_0
xz                        5.2.5                h516909a_1    conda-forge
yaml                      0.2.5                h7f98852_2    conda-forge
zeromq                    4.3.4                h2531618_0
zipp                      3.7.0              pyhd3eb1b0_0
zlib                      1.2.11            h36c2ea0_1013    conda-forge
zstd                      1.5.1                ha95c52a_0    conda-forge
@greglucas
Copy link
Contributor

I believe this was fixed by #1999 being able to pass a single geometry. Feel free to reopen if that is not the case.

@greglucas greglucas added this to the 0.21 milestone Aug 21, 2022
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

Successfully merging a pull request may close this issue.

2 participants