question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ValueError: Unknown column geometry

See original GitHub issue

I am getting the following exception on mac os 10.14.5 despite my condarc has strict mode.

Error:

Error : Traceback (most recent call last):
  File "/Users/Naresh/anaconda3/envs/dev/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2897, in get_loc
    return self._engine.get_loc(key)
  File "pandas/_libs/index.pyx", line 107, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 131, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1607, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1614, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'geometry'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/Naresh/anaconda3/envs/dev/lib/python3.6/site-packages/geopandas/geodataframe.py", line 155, in set_geometry
    level = frame[col].values
  File "/Users/Naresh/anaconda3/envs/dev/lib/python3.6/site-packages/geopandas/geodataframe.py", line 546, in __getitem__
    result = super(GeoDataFrame, self).__getitem__(key)
  File "/Users/Naresh/anaconda3/envs/dev/lib/python3.6/site-packages/pandas/core/frame.py", line 2980, in __getitem__
    indexer = self.columns.get_loc(key)
  File "/Users/Naresh/anaconda3/envs/dev/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2899, in get_loc
    return self._engine.get_loc(self._maybe_cast_indexer(key))
  File "pandas/_libs/index.pyx", line 107, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 131, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1607, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1614, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'geometry'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "ImageCoregister.py", line 18, in <module>
    a = CRL.correct_shifts()
  File "/Users/Naresh/anaconda3/envs/dev/lib/python3.6/site-packages/arosics/CoReg_local.py", line 603, in correct_shifts
    coreg_info = self.coreg_info
  File "/Users/Naresh/anaconda3/envs/dev/lib/python3.6/site-packages/arosics/CoReg_local.py", line 575, in coreg_info
    'GCPList': self.tiepoint_grid.GCPList,
  File "/Users/Naresh/anaconda3/envs/dev/lib/python3.6/site-packages/arosics/CoReg_local.py", line 333, in tiepoint_grid
    self._tiepoint_grid.get_CoRegPoints_table()
  File "/Users/Naresh/anaconda3/envs/dev/lib/python3.6/site-packages/arosics/Tie_Point_Grid.py", line 402, in get_CoRegPoints_table
    GDF = GDF.astype(np.object).merge(records.astype(np.object), on='POINT_ID', how="inner")
  File "/Users/Naresh/anaconda3/envs/dev/lib/python3.6/site-packages/geopandas/geodataframe.py", line 711, in astype
    df = geopandas.GeoDataFrame(df, geometry=self._geometry_column_name)
  File "/Users/Naresh/anaconda3/envs/dev/lib/python3.6/site-packages/geopandas/geodataframe.py", line 83, in __init__
    self.set_geometry(geometry, inplace=True)
  File "/Users/Naresh/anaconda3/envs/dev/lib/python3.6/site-packages/geopandas/geodataframe.py", line 157, in set_geometry
    raise ValueError("Unknown column %s" % col)
ValueError: Unknown column geometry

conda list


affine                    2.3.0                      py_0    conda-forge
arosics                   0.9.2                    pypi_0    pypi
asciitree                 0.3.3                      py_2    conda-forge
asn1crypto                1.0.0                    py36_0    conda-forge
attrs                     19.2.0                     py_0    conda-forge
basemap                   1.2.1            py36hd103db2_1    conda-forge
bokeh                     1.3.4                    py36_0    conda-forge
boost-cpp                 1.70.0               hd59e818_1    conda-forge
branca                    0.3.1                    pypi_0    pypi
bzip2                     1.0.8                h01d97ff_1    conda-forge
ca-certificates           2019.9.11            hecc5488_0    conda-forge
cairo                     1.16.0            h0ab9d94_1001    conda-forge
certifi                   2019.6.16                py36_1    conda-forge
cffi                      1.12.3           py36hccf1714_0    conda-forge
cfitsio                   3.470                h389770f_2    conda-forge
chardet                   3.0.4                 py36_1003    conda-forge
click                     7.0                        py_0    conda-forge
click-plugins             1.1.1                      py_0    conda-forge
cligj                     0.5.0                      py_0    conda-forge
cloudpickle               1.2.2                      py_0    conda-forge
cmocean                   2.0                        py_1    conda-forge
colorspacious             1.1.2              pyh24bf2e0_0    conda-forge
configobj                 5.0.6                      py_0    conda-forge
cryptography              2.7              py36h212c5bf_0    conda-forge
curl                      7.65.3               h22ea746_0    conda-forge
cycler                    0.10.0                     py_1    conda-forge
cytoolz                   0.10.0           py36h01d97ff_0    conda-forge
dask                      2.5.0                      py_0    conda-forge
dask-core                 2.5.0                      py_0    conda-forge
decorator                 4.4.0                      py_0    conda-forge
dill                      0.3.1.1                  pypi_0    pypi
distributed               2.5.1                      py_0    conda-forge
earthpy                   0.7.4                      py_0    conda-forge
expat                     2.2.5             h6de7cb9_1003    conda-forge
fasteners                 0.14.1                     py_3    conda-forge
fiona                     1.8.6            py36h7eb7563_3    conda-forge
folium                    0.10.0                   pypi_0    pypi
fontconfig                2.13.1            h1027ab8_1000    conda-forge
freetype                  2.10.0               h24853df_1    conda-forge
freexl                    1.0.5             h1de35cc_1002    conda-forge
fsspec                    0.5.1                      py_0    conda-forge
gdal                      2.4.1           py36h39889d8_10    conda-forge
geoarray                  0.8.22                   pypi_0    pypi
geojson                   2.5.0                    pypi_0    pypi
geopandas                 0.6.0                      py_0    conda-forge
geos                      3.7.2                h6de7cb9_2    conda-forge
geotiff                   1.4.3             h113155d_1001    conda-forge
gettext                   0.19.8.1          h46ab8bc_1002    conda-forge
giflib                    5.1.7                h01d97ff_1    conda-forge
glib                      2.58.3            h9d45998_1002    conda-forge
hdf4                      4.2.13            hf3c6af0_1002    conda-forge
hdf5                      1.10.4          nompi_h0cbb7df_1106    conda-forge
heapdict                  1.0.1                      py_0    conda-forge
icu                       58.2              h0a44026_1000    conda-forge
idna                      2.8                   py36_1000    conda-forge
imageio                   2.5.0                    py36_0    conda-forge
jinja2                    2.10.1                     py_0    conda-forge
jpeg                      9c                h1de35cc_1001    conda-forge
json-c                    0.13.1            h1de35cc_1001    conda-forge
kealib                    1.4.10            hecf890f_1003    conda-forge
kiwisolver                1.1.0            py36h770b8ee_0    conda-forge
krb5                      1.16.3            hcfa6398_1001    conda-forge
libblas                   3.8.0               13_openblas    conda-forge
libcblas                  3.8.0               13_openblas    conda-forge
libcurl                   7.65.3               h16faf7d_0    conda-forge
libcxx                    9.0.0                         0    conda-forge
libcxxabi                 9.0.0                         0    conda-forge
libdap4                   3.20.4               habf5908_0    conda-forge
libedit                   3.1.20170329      hcfe32e1_1001    conda-forge
libffi                    3.2.1             h6de7cb9_1006    conda-forge
libgdal                   2.4.1               hc4192b8_10    conda-forge
libgfortran               3.0.1                         0    conda-forge
libiconv                  1.15              h01d97ff_1005    conda-forge
libkml                    1.3.0             hed7d534_1010    conda-forge
liblapack                 3.8.0               13_openblas    conda-forge
libnetcdf                 4.6.2             h6b88ef6_1001    conda-forge
libopenblas               0.3.7                hd44dcd8_1    conda-forge
libpng                    1.6.37               h2573ce8_0    conda-forge
libpq                     11.5                 h756f0eb_1    conda-forge
libspatialindex           1.9.0                h6de7cb9_1    conda-forge
libspatialite             4.3.0a            hb3e03d6_1030    conda-forge
libssh2                   1.8.2                hcdc9a53_2    conda-forge
libtiff                   4.0.10            hd08fb8f_1003    conda-forge
libxml2                   2.9.9                hd80cff7_2    conda-forge
locket                    0.2.0                      py_2    conda-forge
lz4-c                     1.8.3             h6de7cb9_1001    conda-forge
markupsafe                1.1.1            py36h1de35cc_0    conda-forge
matplotlib                3.1.1                    py36_1    conda-forge
matplotlib-base           3.1.1            py36h3a684a6_1    conda-forge
monotonic                 1.5                        py_0    conda-forge
mpld3                     0.3                      pypi_0    pypi
msgpack-python            0.6.2            py36h770b8ee_0    conda-forge
munch                     2.3.2                      py_0    conda-forge
ncurses                   6.1               h0a44026_1002    conda-forge
networkx                  2.3                        py_0    conda-forge
numcodecs                 0.6.3            py36h0a44026_0    conda-forge
numpy                     1.17.2           py36h6b0580a_0    conda-forge
olefile                   0.46                       py_0    conda-forge
openjpeg                  2.3.1                hdc36067_1    conda-forge
openssl                   1.1.1c               h01d97ff_0    conda-forge
packaging                 19.2                       py_0    conda-forge
pandas                    0.25.1           py36h86efe34_0    conda-forge
partd                     1.0.0                      py_0    conda-forge
pcre                      8.41              h0a44026_1003    conda-forge
pillow                    6.2.0            py36hb6f49c9_0    conda-forge
pip                       19.2.3                   py36_0    conda-forge
pixman                    0.38.0            h01d97ff_1003    conda-forge
plotly                    4.1.1                    pypi_0    pypi
poppler                   0.67.0               hd5eb092_7    conda-forge
poppler-data              0.4.9                         1    conda-forge
postgresql                11.5                 h25afefd_1    conda-forge
proj4                     5.2.0             h6de7cb9_1006    conda-forge
psutil                    5.6.3            py36h01d97ff_0    conda-forge
py-tools-ds               0.14.21                  pypi_0    pypi
pycparser                 2.19                     py36_1    conda-forge
pyfftw                    0.11.1          py36h917ab60_1001    conda-forge
pykdtree                  1.3.1           py36h917ab60_1002    conda-forge
pykrige                   1.4.0           py36h1d22016_1001    conda-forge
pyopenssl                 19.0.0                   py36_0    conda-forge
pyparsing                 2.4.2                      py_0    conda-forge
pyproj                    1.9.6           py36h01d97ff_1002    conda-forge
pyresample                1.13.1           py36h86efe34_0    conda-forge
pyshp                     2.1.0                      py_0    conda-forge
pysocks                   1.7.1                    py36_0    conda-forge
python                    3.6.7             h94afb7f_1005    conda-forge
python-dateutil           2.8.0                      py_0    conda-forge
pytz                      2019.2                     py_0    conda-forge
pywavelets                1.0.3            py36h1e5eb4f_1    conda-forge
pyyaml                    5.1.2            py36h01d97ff_0    conda-forge
rasterio                  1.0.25           py36h238e834_0    conda-forge
readline                  8.0                  hcfe32e1_0    conda-forge
requests                  2.22.0                   py36_1    conda-forge
retrying                  1.3.3                    pypi_0    pypi
rtree                     0.8.3           py36h666c49c_1002    conda-forge
scikit-image              0.15.0           py36h86efe34_2    conda-forge
scipy                     1.3.1            py36hab3da7d_2    conda-forge
setuptools                41.2.0                   py36_0    conda-forge
shapely                   1.6.4           py36h0567c5e_1006    conda-forge
six                       1.12.0                py36_1000    conda-forge
snuggs                    1.4.7                      py_0    conda-forge
sortedcontainers          2.1.0                      py_0    conda-forge
spectral                  0.19                     pypi_0    pypi
sqlite                    3.29.0               hb7d70f7_1    conda-forge
tblib                     1.4.0                      py_0    conda-forge
tk                        8.6.9             h2573ce8_1003    conda-forge
toolz                     0.10.0                     py_0    conda-forge
tornado                   6.0.3            py36h01d97ff_0    conda-forge
tzcode                    2019a             h01d97ff_1002    conda-forge
urllib3                   1.25.6                   py36_0    conda-forge
utm                       0.5.0                    pypi_0    pypi
viscm                     0.7                pyh24bf2e0_0    conda-forge
wheel                     0.33.6                   py36_0    conda-forge
xerces-c                  3.2.2             h4db8090_1003    conda-forge
xz                        5.2.4             h1de35cc_1001    conda-forge
yaml                      0.1.7             h1de35cc_1001    conda-forge
zarr                      2.3.2                    py36_0    conda-forge
zict                      1.0.0                      py_0    conda-forge
zlib                      1.2.11            h01d97ff_1006    conda-forge
zstd                      1.4.0                ha9f0a20_0    conda-forge

condarc

auto_activate_base: false
ssl_verify: true
channels:
  - conda-forge
  - defaults
channel_priority: strict

conda info :

active environment : dev
 active env location : /Users/Naresh/anaconda3/envs/dev
         shell level : 1
    user config file : /Users/Naresh/.condarc
populated config files : /Users/Naresh/.condarc
       conda version : 4.7.12
 conda-build version : 3.18.8
      python version : 3.7.3.final.0
    virtual packages : 
    base environment : /Users/Naresh/anaconda3  (writable)
        channel URLs : https://conda.anaconda.org/conda-forge/osx-64
                       https://conda.anaconda.org/conda-forge/noarch
                       https://repo.anaconda.com/pkgs/main/osx-64
                       https://repo.anaconda.com/pkgs/main/noarch
                       https://repo.anaconda.com/pkgs/r/osx-64
                       https://repo.anaconda.com/pkgs/r/noarch
       package cache : /Users/Naresh/anaconda3/pkgs
                       /Users/Naresh/.conda/pkgs
    envs directories : /Users/Naresh/anaconda3/envs
                       /Users/Naresh/.conda/envs
            platform : osx-64
          user-agent : conda/4.7.12 requests/2.22.0 CPython/3.7.3 Darwin/18.6.0 OSX/10.14.5
             UID:GID : 501:20
          netrc file : /Users/Naresh/.netrc
        offline mode : False

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
danschefcommented, Nov 27, 2019

Traceback (most recent call last): File “ImageCoregister.py”, line 18, in <module> a = CRL.correct_shifts() File “/Users/Naresh/anaconda3/envs/dev/lib/python3.6/site-packages/arosics/CoReg_local.py”, line 603, in correct_shifts coreg_info = self.coreg_info File “/Users/Naresh/anaconda3/envs/dev/lib/python3.6/site-packages/arosics/CoReg_local.py”, line 575, in coreg_info ‘GCPList’: self.tiepoint_grid.GCPList, File “/Users/Naresh/anaconda3/envs/dev/lib/python3.6/site-packages/arosics/CoReg_local.py”, line 333, in tiepoint_grid self._tiepoint_grid.get_CoRegPoints_table() File “/Users/Naresh/anaconda3/envs/dev/lib/python3.6/site-packages/arosics/Tie_Point_Grid.py”, line 402, in get_CoRegPoints_table GDF = GDF.astype(np.object).merge(records.astype(np.object), on=‘POINT_ID’, how=“inner”) File “/Users/Naresh/anaconda3/envs/dev/lib/python3.6/site-packages/geopandas/geodataframe.py”, line 711, in astype df = geopandas.GeoDataFrame(df, geometry=self._geometry_column_name) File “/Users/Naresh/anaconda3/envs/dev/lib/python3.6/site-packages/geopandas/geodataframe.py”, line 83, in init self.set_geometry(geometry, inplace=True) File “/Users/Naresh/anaconda3/envs/dev/lib/python3.6/site-packages/geopandas/geodataframe.py”, line 157, in set_geometry raise ValueError(“Unknown column %s” % col) ValueError: Unknown column geometry

However, it is also arosics that is creating a GeoDataFrame that should be a plain DataFrame (https://gitext.gfz-potsdam.de/danschef/arosics/blob/master/arosics/Tie_Point_Grid.py#L396-399), so that could also be updated there.

This is fixed in version 0.9.3 of AROSICS.

1reaction
jorisvandenbosschecommented, Oct 11, 2019

@brendan-ward this issue is now fixed on master, but I opened https://github.com/geopandas/geopandas/issues/1153 with your description of the .loc issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

raise ValueError when producing a shape file with geopandas
The issue is that you're populating the geometry field with a string representation of the geometry rather than a shapely geometry object.
Read more >
GeoPandas not recognizing geometry type
I have checked to make sure every geometry in the GeoPandas geometry column was a point but I am still receiving this error...
Read more >
Missing and empty geometries - GeoPandas
Empty geometries are actual geometry objects but that have no coordinates (and thus also no area, ... Missing geometries are unknown values in...
Read more >
ValueError: Unknown column geometry (#31) · Issues · Daniel ...
ValueError : Unknown column geometry ... This error is raised from geopandas here with geopandas versions from 0.6.0 on. The code needs to...
Read more >
Python GeoDataFrame.copy Examples
... self.df.geometry) # unknown column with self.assertRaises(ValueError): self.df.set_geometry('nonexistent-column') # ndim error with self.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found