Commit 74d9544
authored
fix: deconstruct item collection when writing ndjson (#167)
cc @hrodmn
```sh
$ rustac search https://stac.maap-project.org --collections icesat2-boreal-v3.1-agb --max-items 2 -o ndjson
{"id":"boreal_agb_2020_202508201755714903_0003300","bbox":[-114.59879925054304,49.48077531986013,-112.85773713759698,50.60188181261153],"type":"Feature","links":[{"rel":"collection","type":"application/json","href":"https://stac.maap-project.org/collections/icesat2-boreal-v3.1-agb"},{"rel":"parent","type":"application/json","href":"https://stac.maap-project.org/collections/icesat2-boreal-v3.1-agb"},{"rel":"root","type":"application/json","href":"https://stac.maap-project.org/"},{"rel":"self","type":"application/geo+json","href":"https://stac.maap-project.org/collections/icesat2-boreal-v3.1-agb/items/boreal_agb_2020_202508201755714903_0003300"}],"assets":{"cog":{"gsd":30,"href":"s3://nasa-maap-data-store/file-staging/nasa-map/icesat2-boreal-v3.1/agb/0003300/boreal_agb_2020_202508201755714903_0003300.tif","type":"image/tiff; application=geotiff; profile=cloud-optimized","bands":[{"name":"mean_agbd","unit":"Mg ha-1","scale":1,"nodata":-9999.0,"offset":0,"sampling":"area","data_type":"float32","histogram":{"max":175.16749572753906,"min":0.6196765899658203,"count":11,"buckets":[7052664,441070,332270,294155,249099,195105,152856,51991,4914,174]},"statistics":{"mean":14.515077559481112,"stddev":27.601881177100985,"maximum":175.16749572753906,"minimum":0.6196765899658203,"valid_percent":97.4922},"spatial_resolution":30},{"name":"std_agbd","unit":"Mg ha-1","scale":1,"nodata":-9999.0,"offset":0,"sampling":"area","data_type":"float32","histogram":{"max":45.995460510253906,"min":0.112965427339077,"count":11,"buckets":[6914058,894421,634985,232124,73201,16131,5837,3247,282,12]},"statistics":{"mean":2.951711920429418,"stddev":4.408658052082873,"maximum":45.995460510253906,"minimum":0.112965427339077,"valid_percent":97.4922},"spatial_resolution":30}],"roles":["data"],"title":"Gridded predictions of aboveground biomass (Mg/ha)","description":"Gridded predictions of aboveground biomass (Mg/ha)","processing:level":"L4"},"training_data_parquet":{"href":"s3://nasa-maap-data-store/file-staging/nasa-map/icesat2-boreal-v3.1/agb/0003300/boreal_agb_2020_202508201755714903_0003300_train.parquet","type":"application/x-parquet","roles":["data"],"title":"Tabular training data","description":"Tabular training data with latitude, longitude, and biomass observations"}},"geometry":{"type":"Polygon","coordinates":[[[-114.59879925054304,50.15253728393152],[-113.90124100268127,49.48077531986013],[-112.85773713759698,49.92391646714159],[-113.54609166427896,50.60188181261153],[-114.59879925054304,50.15253728393152]]]},"collection":"icesat2-boreal-v3.1-agb","properties":{"datetime":"2020-07-01T23:59:59.500000Z","proj:bbox":[3968521.9999999953,3213304.0000000093,4058521.9999999953,3303304.0000000093],"proj:wkt2":"PROJCS[\"unnamed\",GEOGCS[\"GRS 1980(IUGG, 1980)\",DATUM[\"unknown\",SPHEROID[\"GRS80\",6378137,298.257222101],TOWGS84[0,0,0,0,0,0,0]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]]],PROJECTION[\"Albers_Conic_Equal_Area\"],PARAMETER[\"latitude_of_center\",40],PARAMETER[\"longitude_of_center\",180],PARAMETER[\"standard_parallel_1\",50],PARAMETER[\"standard_parallel_2\",70],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]","proj:shape":[3000,3000],"end_datetime":"2020-12-31T23:59:59Z","proj:geometry":{"type":"Polygon","coordinates":[[[3968521.9999999953,3213304.0000000093],[4058521.9999999953,3213304.0000000093],[4058521.9999999953,3303304.0000000093],[3968521.9999999953,3303304.0000000093],[3968521.9999999953,3213304.0000000093]]]},"proj:transform":[30.0,0.0,3968521.9999999953,0.0,-30.0,3303304.0000000093,0.0,0.0,1.0],"start_datetime":"2020-01-01T00:00:00Z","created_datetime":"2025-08-20T00:00:00+00:00","icesat2-boreal:in_daac":true,"icesat2-boreal:tile_id":"0003300"},"stac_version":"1.1.0","stac_extensions":["https://stac-extensions.github.io/projection/v1.1.0/schema.json"]}
{"id":"boreal_agb_2020_202508201755714861_0000544","bbox":[57.668175458260485,50.00125738393917,59.20217219488729,50.97761041743663],"type":"Feature","links":[{"rel":"collection","type":"application/json","href":"https://stac.maap-project.org/collections/icesat2-boreal-v3.1-agb"},{"rel":"parent","type":"application/json","href":"https://stac.maap-project.org/collections/icesat2-boreal-v3.1-agb"},{"rel":"root","type":"application/json","href":"https://stac.maap-project.org/"},{"rel":"self","type":"application/geo+json","href":"https://stac.maap-project.org/collections/icesat2-boreal-v3.1-agb/items/boreal_agb_2020_202508201755714861_0000544"}],"assets":{"cog":{"gsd":30,"href":"s3://nasa-maap-data-store/file-staging/nasa-map/icesat2-boreal-v3.1/agb/0000544/boreal_agb_2020_202508201755714861_0000544.tif","type":"image/tiff; application=geotiff; profile=cloud-optimized","bands":[{"name":"mean_agbd","unit":"Mg ha-1","scale":1,"nodata":-9999.0,"offset":0,"sampling":"area","data_type":"float32","histogram":{"max":176.0052032470703,"min":0.27263352274894714,"count":11,"buckets":[8785987,16705,5435,2314,1082,567,387,221,68,19]},"statistics":{"mean":0.9879209580172442,"stddev":2.5558262253122197,"maximum":176.0052032470703,"minimum":0.27263352274894714,"valid_percent":97.91983333333332},"spatial_resolution":30},{"name":"std_agbd","unit":"Mg ha-1","scale":1,"nodata":-9999.0,"offset":0,"sampling":"area","data_type":"float32","histogram":{"max":43.77642822265625,"min":0.10243990272283554,"count":11,"buckets":[8747047,39842,13419,6781,2524,1323,907,636,281,25]},"statistics":{"mean":0.44872608375218503,"stddev":1.0205389352986312,"maximum":43.77642822265625,"minimum":0.10243990272283554,"valid_percent":97.91983333333332},"spatial_resolution":30}],"roles":["data"],"title":"Gridded predictions of aboveground biomass (Mg/ha)","description":"Gridded predictions of aboveground biomass (Mg/ha)","processing:level":"L4"},"training_data_parquet":{"href":"s3://nasa-maap-data-store/file-staging/nasa-map/icesat2-boreal-v3.1/agb/0000544/boreal_agb_2020_202508201755714861_0000544_train.parquet","type":"application/x-parquet","roles":["data"],"title":"Tabular training data","description":"Tabular training data with latitude, longitude, and biomass observations"}},"geometry":{"type":"Polygon","coordinates":[[[59.20217219488729,50.19084051082751],[58.912567485634185,50.97761041743663],[57.668175458260485,50.78488521490738],[57.97909409514872,50.00125738393917],[59.20217219488729,50.19084051082751]]]},"collection":"icesat2-boreal-v3.1-agb","properties":{"datetime":"2020-07-01T23:59:59.500000Z","proj:bbox":[-4671478.000000006,6993304.000000009,-4581478.000000006,7083304.000000009],"proj:wkt2":"PROJCS[\"unnamed\",GEOGCS[\"GRS 1980(IUGG, 1980)\",DATUM[\"unknown\",SPHEROID[\"GRS80\",6378137,298.257222101],TOWGS84[0,0,0,0,0,0,0]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]]],PROJECTION[\"Albers_Conic_Equal_Area\"],PARAMETER[\"latitude_of_center\",40],PARAMETER[\"longitude_of_center\",180],PARAMETER[\"standard_parallel_1\",50],PARAMETER[\"standard_parallel_2\",70],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]","proj:shape":[3000,3000],"end_datetime":"2020-12-31T23:59:59Z","proj:geometry":{"type":"Polygon","coordinates":[[[-4671478.000000006,6993304.000000009],[-4581478.000000006,6993304.000000009],[-4581478.000000006,7083304.000000009],[-4671478.000000006,7083304.000000009],[-4671478.000000006,6993304.000000009]]]},"proj:transform":[30.0,0.0,-4671478.000000006,0.0,-30.0,7083304.000000009,0.0,0.0,1.0],"start_datetime":"2020-01-01T00:00:00Z","created_datetime":"2025-08-20T00:00:00+00:00","icesat2-boreal:in_daac":false,"icesat2-boreal:tile_id":"0000544"},"stac_version":"1.1.0","stac_extensions":["https://stac-extensions.github.io/projection/v1.1.0/schema.json"]}
```1 parent fd75e69 commit 74d9544
4 files changed
+444
-320
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
8 | 12 | | |
9 | 13 | | |
10 | 14 | | |
| |||
0 commit comments