Skip to content

Commit

Permalink
--wip-- [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
gadomski committed Jun 24, 2024
1 parent 95164a1 commit 54d063c
Show file tree
Hide file tree
Showing 9 changed files with 748 additions and 540 deletions.
8 changes: 8 additions & 0 deletions convert.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import json

import stac_geoparquet

with open("stac-arrow/data/naip.json") as f:
items = json.load(f)["features"]
dataframe = stac_geoparquet.to_geodataframe(items)
dataframe.to_parquet("stac-arrow/data/naip.parquet")
2 changes: 1 addition & 1 deletion scripts/requirements.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
stac-api-validator
stac-geoparquet
stac-geoparquet<0.5 # v0.5 uses geoparquet 1.1, but geoarrow-rs is geoparquet 1.0
4 changes: 1 addition & 3 deletions scripts/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ certifi==2024.6.2
# stac-api-validator
charset-normalizer==3.3.2
# via requests
ciso8601==2.3.1
# via stac-geoparquet
click==8.1.7
# via
# stac-api-validator
Expand Down Expand Up @@ -106,7 +104,7 @@ stac-api-validator==0.6.2
# via -r scripts/requirements.in
stac-check==1.3.3
# via stac-api-validator
stac-geoparquet==0.5.1
stac-geoparquet==0.4.1
# via -r scripts/requirements.in
stac-validator==3.3.2
# via
Expand Down
11 changes: 2 additions & 9 deletions stac-arrow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,10 @@ Reading from a [geoparquet](https://geoparquet.org/) file:

```rust
use std::fs::File;
use parquet::arrow::arrow_reader::ParquetRecordBatchReaderBuilder;

let file = File::open("data/naip.parquet").unwrap();
let reader = ParquetRecordBatchReaderBuilder::try_new(file)
.unwrap()
.build()
.unwrap();
let mut items = Vec::new();
for result in reader {
items.extend(stac_arrow::record_batch_to_items(result.unwrap()).unwrap());
}
let geo_table = geoarrow::io::parquet::read_geoparquet(file, Default::default()).unwrap();
let items = stac_arrow::geo_table_to_items(geo_table).unwrap();
assert_eq!(items.len(), 5);
```

Expand Down
Loading

0 comments on commit 54d063c

Please sign in to comment.