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

stac sentinel2 create-item on SAFE dir not working #154

Open
MathewNWSH opened this issue Jan 4, 2024 · 0 comments
Open

stac sentinel2 create-item on SAFE dir not working #154

MathewNWSH opened this issue Jan 4, 2024 · 0 comments

Comments

@MathewNWSH
Copy link

Hello,
I tried to start generating json items based on my SAFE products dirs.
On each the error is raised:

TypeError: Type is not JSON serializable: numpy.float64

Command I'm using:

**stac sentinel2 create-item /home/eouser/Downloads**/S2A_MSIL2A_20231229T001021_N0510_R016_T58UFG_20231229T020450.SAFE /home/eouser/Desktop/output/

stactools was installed by pip install stactools-sentinel2

Full log:

(python3.11) eouser@ubuntu-wms:~$ stac sentinel2 create-item /home/eouser/Downloads/S2A_MSIL2A_20231229T001021_N0510_R016_T58UFG_20231229T020450.SAFE /home/eouser/Desktop/output/
/opt/venv/python3.11/lib/python3.11/site-packages/antimeridian/_implementation.py:391: FixWindingWarning: The exterior ring of this shape is wound clockwise. Since this is a common error in real-world geometries, this package is reversing the exterior coordinates of the input shape before running its algorithm. If you know that your input shape is correct (i.e. if your data encompasses both poles), pass `fix_winding=False`.
  FixWindingWarning.warn()
Traceback (most recent call last):
  File "/opt/venv/python3.11/bin/stac", line 8, in <module>
    sys.exit(run_cli())
             ^^^^^^^^^
  File "/opt/venv/python3.11/lib/python3.11/site-packages/stactools/cli/cli.py", line 37, in run_cli
    cli(prog_name="stac")
  File "/opt/venv/python3.11/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/python3.11/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/venv/python3.11/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/python3.11/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/python3.11/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/python3.11/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/python3.11/lib/python3.11/site-packages/stactools/sentinel2/commands.py", line 67, in create_item_command
    item.save_object()
  File "/opt/venv/python3.11/lib/python3.11/site-packages/pystac/stac_object.py", line 469, in save_object
    stac_io.save_json(dest_href, self.to_dict(include_self_link=include_self_link))
  File "/opt/venv/python3.11/lib/python3.11/site-packages/pystac/stac_io.py", line 259, in save_json
    txt = self.json_dumps(json_dict, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/python3.11/lib/python3.11/site-packages/pystac/stac_io.py", line 127, in json_dumps
    return orjson.dumps(json_dict, option=orjson.OPT_INDENT_2, **kwargs).decode(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Type is not JSON serializable: numpy.float64

Sample data:
https://s3.waw3-2.cloudferro.com/swift/v1/demo_data/

@philvarner philvarner changed the title stac sentinel2 create-item on SAFE dir not wroking stac sentinel2 create-item on SAFE dir not working Jan 8, 2024
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

1 participant