{"id":16422347,"url":"https://github.com/stephenhillier/autostac","last_synced_at":"2025-04-14T01:54:52.957Z","repository":{"id":66138099,"uuid":"377050439","full_name":"stephenhillier/autostac","owner":"stephenhillier","description":"Instant STAC API from a bucket of geospatial imagery (work in progress)","archived":false,"fork":false,"pushed_at":"2021-08-16T04:26:44.000Z","size":224,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T01:54:47.996Z","etag":null,"topics":["geospatial","gis","remote-sensing","satellite-imagery","stac"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stephenhillier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-06-15T05:49:15.000Z","updated_at":"2024-10-23T18:58:58.000Z","dependencies_parsed_at":"2023-09-24T16:58:52.727Z","dependency_job_id":null,"html_url":"https://github.com/stephenhillier/autostac","commit_stats":{"total_commits":37,"total_committers":1,"mean_commits":37.0,"dds":0.0,"last_synced_commit":"d43866f3f82012ee4430364d67a3c41acecf11ae"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenhillier%2Fautostac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenhillier%2Fautostac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenhillier%2Fautostac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenhillier%2Fautostac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stephenhillier","download_url":"https://codeload.github.com/stephenhillier/autostac/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248809032,"owners_count":21164895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geospatial","gis","remote-sensing","satellite-imagery","stac"],"created_at":"2024-10-11T07:36:15.499Z","updated_at":"2025-04-14T01:54:52.925Z","avatar_url":"https://github.com/stephenhillier.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Autostac\n\nAutostac creates an instant [STAC API](https://github.com/radiantearth/stac-api-spec/blob/master/overview.md) from an S3 bucket or directory of raster data.\n\nIt scans a bucket or directory and creates a catalog complete with Collections and Items generated from the objects inside. The collection endpoints\nsupport filtering and sorting (see below for currently implemented filter/sort options).\n\nThis is a work in progress. When using with a local directory, the assets themselves are not served (just catalogued). If using in S3 mode, links to the objects\non the S3 host will be made available.\n\n## Running the service\n\nWarning: This is a proof of concept! Use at own risk. Starting the server will attempt to open each file in the\nspecified directory with the `GDALOpen` function from the Georust GDAL bindings crate. If GDALOpen is unable to open\nthe file, it will be skipped. A STAC Item will be created for each file that GDALOpen successfully opens.\n\n\nclone the repo and add some imagery to a folder:\n```sh\ngit clone https://github.com/stephenhillier/autostac\ncd autostac\n\n# make a `data` directory under autostac\nmkdir ./data\n\n# make a subdirectory under `data`, which will be turned into a STAC Collection.\nmkdir ./data/imagery\n\n# copy some data into the subdirectory\ncp ~/Downloads/my_image.tif ./data/imagery\n```\n\nFinally, run the server using `cargo run` and browse to http://localhost:8000/ to view the STAC API landing page.\n\n## S3\n\nAutostac supports scanning an S3 bucket.  Within that bucket, any prefixes (subdirectories) will be turned into\ncollections, and any images in the bucket with prefixes will be added to their respective collections.\n\n**WARNING**:  All files will be inspected by the GDAL vsis3 virtual filesystem driver.  Use only on a bucket\ncontaining files you trust.\n\nAny images in the bucket that have no prefix will be skipped (e.g.:  `/mybucket/image.tif`). Currently,\nonly images within subdirectories are catalogued:  `/mybucket/imagery/image.tif`.  You can make as many\nsubdirectories as you want, and they will all become collections.\n\nAutostac uses the same S3 environment variables as GDAL. Example:\n\n```sh\n# Locally running Minio example\nexport AWS_S3_ENDPOINT=http://localhost:9000\n\nexport S3_BUCKET=mybucket\nexport AWS_ACCESS_KEY_ID=minio\nexport AWS_SECRET_ACCESS_KEY=minio123\n\n# required for Minio - GDAL will specify the bucket in the path instead of the subdomain.\nexport AWS_VIRTUAL_HOSTING=FALSE \nexport AWS_HTTPS=NO\n\ncargo run -- --s3\n```\n\n## Browsing and querying the STAC API\n\nThe STAC API can be browsed by visiting the landing page at the root URL (e.g. `http://localhost:8000/`).  You can also use a STAC browser like https://github.com/radiantearth/stac-browser.\n\nCollections will be advertised as child links from the landing page.\n\n### Filtering collections\n\nThe collections endpoint (`/collections/\u003ccollection_id\u003e`) supports filtering using the following query params:\n\n**Intersects**\n\n`intersects` takes a WKT geometry and returns imagery that intersects with any part of that query geometry.\n\nExample:\n\n`http://localhost:8000/collections/my_collection?intersects=POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))`\n\n\n**Contains**\n\n`contains` takes a WKT geometry returns imagery that completely contains the query geometry. Note that only polygons are supported right now. Use `contains`\nif you want to find an image that gives you full coverage over your area of interest.  Images may still have NoData values, cloud cover etc. over\nthe area of interest.\n\nExample:\n\n`http://localhost:8000/collections/my_collection?contains=POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))`\n\n\n**Filtering by date**\n\nTodo.\n\n### Sorting (filtered collections only)\n\nCollections that have been filtered can also be sorted.  Currently only the `spatial_resolution` property is supported for sorting.\n\nCollections that have not been filtered return a normal STAC collection and this will not be sorted (TODO).\n\nExample:\n`http://localhost:8000/collections/my_collection?contains=POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))\u0026sortby=spatial_resolution`\n\n### Limit (filtered collections only)\n\nFiltered collections that return a FeatureCollection can have a limit applied. `limit=n` will cause the FeatureCollection's Feature list\nto have at most `n` features (where n is an integer).  The example below will return the highest resolution dataset that completely covers\nthe area of interest.\n\nExample:\n\n`http://localhost:8000/collections/my_collection?contains=POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))\u0026sortby=spatial_resolution\u0026limit=1`\n\n## Goals\n\n* catalogue spatial data (digital elevation models, satellite imagery, point clouds) in a directory tree or S3 bucket\n* list spatial data available, with options to filter by a geometry/BBOX and by a date/time range\n* return a dataset from either a selected file, or automatically select the best available data in a polygon. Examples:\n  * give me the least cloudy image from the past month in my area of interest\n  * give me the highest resolution DEM that covers `POLYGON ((...))`\n\n## Progress\nCollections are created from subdirectories, and any raster files within those subdirectories are added to their respective\ncollection.  The files themselves are not yet served, just catalogued.\n\nCollections can be filtered with query params, which will return a FeatureCollection of STAC Item features.\n\n### Todo list\n* Date/time search\n* Sort by date, resolution, cloud cover.\n* Refactor catalog \"backends\" and add options - e.g. InMemoryCatalog, PostGISCatalog, FileCatalog (flatgeobuf / sqlite?) etc.\n* Export a flat STAC catalog file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephenhillier%2Fautostac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephenhillier%2Fautostac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephenhillier%2Fautostac/lists"}