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

ERROR while executing index2d command - df['node'] = node #8

Open
AbdelghaniTamort opened this issue May 12, 2023 · 2 comments
Open

Comments

@AbdelghaniTamort
Copy link

issue.log

@Yarroudh
Copy link
Owner

Yarroudh commented May 12, 2023

@AbdelghaniTamort thanks for sharing this issue, can you share with me your conda environment as YAML file?
You can run conda env export --name optimenv --file optimenv.yml

@baal-lgln
Copy link

Hi, I'm using the docker image (yarroudh/optim3d) and get a similar error message when I try to run optim3d index2d /home/user/data/wippolder.gpkg:

/opt/mambaforge/lib/python3.10/site-packages/optim3d/main.py:360: FutureWarning: Calling float on a single element Series is deprecated and will raise a TypeError in the future. Use float(ser.iloc[0]) instead
  quadTree = QuadTree(Bounds(float(bounds.minx), float(bounds.miny), float(width), float(height)), max_objects=max)
/opt/mambaforge/lib/python3.10/site-packages/geopandas/io/file.py:545: UserWarning: You are attempting to write an empty DataFrame to file. For some drivers, this operation may fail.
  _to_file_fiona(df, filename, driver, schema, crs, mode, **kwargs)
Traceback (most recent call last):
  File "/opt/mambaforge/bin/optim3d", line 8, in <module>
    sys.exit(cli())
  File "/opt/mambaforge/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/opt/mambaforge/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/opt/mambaforge/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/mambaforge/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/mambaforge/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/opt/mambaforge/lib/python3.10/site-packages/optim3d/main.py", line 378, in index2d
    df['node'] = node
  File "/opt/mambaforge/lib/python3.10/site-packages/geopandas/geodataframe.py", line 1443, in __setitem__
    super().__setitem__(key, value)
  File "/opt/mambaforge/lib/python3.10/site-packages/pandas/core/frame.py", line 3959, in __setitem__
    self._set_item(key, value)
  File "/opt/mambaforge/lib/python3.10/site-packages/pandas/core/frame.py", line 4152, in _set_item
    value = self._sanitize_column(value)
  File "/opt/mambaforge/lib/python3.10/site-packages/pandas/core/frame.py", line 4878, in _sanitize_column
    com.require_length_match(value, self.index)
  File "/opt/mambaforge/lib/python3.10/site-packages/pandas/core/common.py", line 576, in require_length_match
    raise ValueError(
ValueError: Length of values (0) does not match length of index (60)

Testdata is obtained from here: https://data.3dgi.xyz/roofer-test-data/

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

3 participants