Skip to content

Error decoding JSON field when writing STAC Items to STAC GeoParquet #722

@ceholden

Description

@ceholden

👋 while trying to use rustac-py to write STAC Items to GeoParquet I encountered an issue,

RustacError: Json error: whilst decoding field 'proj:geometry': whilst decoding field 'coordinates': expected [ got 394843.75

This occurred while trying to write to STAC GeoParquet but not while trying to write to JSON. This issue happened when trying to write 2 STAC Items, but when I write them individually I don't encounter the issue.

This issue can be reproduced using some of the STAC Items from the Maxar open data catalog,

import pystac
import rustac

urls = [
    "https://maxar-opendata.s3.amazonaws.com/events/Hurricane-Ian-9-26-2022/ard/17/031331303020/2022-10-03/10300100DB064000.json",
    "https://maxar-opendata.s3.amazonaws.com/events/Hurricane-Ian-9-26-2022/ard/17/031331303211/2022-10-03/10300100DB064000.json"
]
items = []
for url in urls:
    item = pystac.read_file(url)
    item.validate()
    items.append(item)

# this is fine
await rustac.write("rustac-test.json", [item.to_dict() for item in items])

# boom!
await rustac.write("rustac-test.parquet", [item.to_dict() for item in items])

# this is also fine
for item in items:
    await rustac.write("rustac-test.parquet", [item.to_dict()])

I'm using rustac through rustac-py on version rustac==0.7.0.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions