-
Notifications
You must be signed in to change notification settings - Fork 122
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
Disallow saving to the filesystem when using APILayoutStrategy #1486
Comments
Can you provide a minimum-reproducable example? A simple script to create a collection and an item would be best. Thanks! |
I'll try to create a to_dict of the catalog hierarchy and check if starting from there would re-create the issue |
@gadomski this scirpt is similar to that I wrote, depurated of many business detail that are not useful for replicate the issue. in resume the script accept a path containing COGs, walk it selecting all tif and create the following hierarchy catalog->highlevel collection->item collection->item I've to populate with 26k images (the catalog) divided in group of 5 files (item collection in the script simulated having a collection with only a tif file item/asset) to replicate:
|
p.s. I tried to dump all the stac hierarchy dumping json from stacobject.to_dict(), but recreating the hierarchy with stacobject.from_file(...) generate great number of issue, so I did it creating the above script. |
seems the issue is in inside |
more, if fix creation of json in stac_io contect fail due to: |
Thanks for the information! I was able to reproduce the problem, and the key issue is that the The FWIW your minimum reproducible example was still pretty verbose, here's the script that I used to reproduce: import datetime
from pystac import Catalog, CatalogType, Collection, Extent, Item
from pystac.layout import APILayoutStrategy
item = Item("an-item", None, None, datetime.datetime.now(), {})
extent = Extent.from_items([item])
catalog = Catalog("a-catalog", "A description")
collection = Collection("a-collection", "A description", extent)
collection.add_item(item)
catalog.add_child(collection)
catalog.normalize_hrefs(root_href="issues-1486", strategy=APILayoutStrategy())
catalog.save(CatalogType.SELF_CONTAINED) |
@gadomski thank you for the analysis, I looked in the repo before bu I didn't find this because I looked into issues (open and closed). And thanks to give me a resumed test, I just realised later that I would be able to simplify it just reading unit test. cheers |
when writing db but href generated with
APILayoutStrategy
and error is issued, seems because try to update connection.json but looking it with the same name of created folder that contain collection.json.Note, collection.json is not (yet) present in the folder
anything else I can add to facilitare replication? a to_dict() of the catalog?
here the stack trace
The text was updated successfully, but these errors were encountered: