Skip to content
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

Support more data types in GeozeroDatasource impl #619

Merged
merged 8 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ rayon = ["dep:rayon"]
[dependencies]
anyhow = "1"
arrow = { version = "51", features = ["ffi"] }
arrow-array = "51"
arrow-array = { version = "51", features = ["chrono-tz"] }
arrow-buffer = "51"
arrow-cast = "51"
arrow-data = "51"
arrow-ipc = "51"
arrow-json = "51"
arrow-schema = "51"
async-stream = { version = "0.3", optional = true }
async-trait = { version = "0.1", optional = true }
Expand Down Expand Up @@ -96,6 +97,13 @@ sqlx = { version = "0.7", optional = true, default-features = false, features =
thiserror = "1"
tokio = { version = "1", default-features = false, optional = true }

# Temporary until https://github.com/georust/geozero/pull/208 is merged and released.
geojson = { version = "0.24.1", default-features = false }

half = "*"
lexical-core = "*"


[dev-dependencies]
approx = "0.5.1"
bytes = "1.5.0"
Expand Down
46 changes: 46 additions & 0 deletions js/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion js/src/io/geojson.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::io::Cursor;

use geoarrow::io::geojson::read_geojson as _read_geojson;
use geoarrow::io::geojson::{read_geojson as _read_geojson, write_geojson as _write_geojson};
// use parquet_wasm::utils::assert_parquet_file_not_empty;
use wasm_bindgen::prelude::*;

Expand Down Expand Up @@ -32,3 +32,15 @@ pub fn read_geojson(file: &[u8], batch_size: Option<usize>) -> WasmResult<Table>
let (schema, batches) = geo_table.into_inner();
Ok(Table::new(schema, batches))
}

/// Write table to GeoJSON
///
/// Note that this consumes the table input
#[wasm_bindgen(js_name = writeGeoJSON)]
pub fn write_geojson(table: Table) -> WasmResult<Vec<u8>> {
let (schema, batches) = table.into_inner();
let mut rust_table = geoarrow::table::Table::try_new(schema, batches)?;
let mut output_file: Vec<u8> = vec![];
_write_geojson(&mut rust_table, &mut output_file)?;
Ok(output_file)
}
46 changes: 46 additions & 0 deletions python/core/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion python/core/src/io/parquet/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ impl ParquetFile {
#[pyclass(module = "geoarrow.rust.core._rust")]
pub struct ParquetDataset {
inner: _ParquetDataset<ParquetObjectReader>,
#[allow(dead_code)]
rt: Arc<Runtime>,
}

Expand Down
Loading
Loading