Skip to content
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
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ exclude = ["js"]
resolver = "2"

[workspace.package]
edition = "2021"
edition = "2024"
license = "MIT OR Apache-2.0"
repository = "https://github.com/geoarrow/geoarrow-rs"
rust-version = "1.85"

[workspace.dependencies]
arrow-array = "54.3.1"
Expand Down
2 changes: 1 addition & 1 deletion js/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repository = "https://github.com/geoarrow/geoarrow-rs"
license = "MIT OR Apache-2.0"
keywords = ["webassembly", "arrow", "geospatial"]
categories = ["wasm", "science::geo"]
rust-version = "1.82"
rust-version = "1.85"

[lib]
crate-type = ["cdylib", "rlib"]
Expand Down
2 changes: 1 addition & 1 deletion python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repository = "https://github.com/geoarrow/geoarrow-rs"
license = "MIT OR Apache-2.0"
keywords = ["python", "arrow", "geospatial"]
categories = ["wasm", "science::geo"]
rust-version = "1.82"
rust-version = "1.85"

[workspace.dependencies]
arrow = "54"
Expand Down
2 changes: 1 addition & 1 deletion python/proj/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repository = "https://github.com/geoarrow/geoarrow-rs"
license = "MIT OR Apache-2.0"
keywords = ["python", "arrow", "geospatial"]
categories = ["wasm", "science::geo"]
rust-version = "1.75"
rust-version = "1.85"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
Expand Down
2 changes: 1 addition & 1 deletion python/pyo3-geoarrow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repository = "https://github.com/geoarrow/geoarrow-rs"
license = "MIT OR Apache-2.0"
keywords = ["python", "arrow"]
categories = []
rust-version = "1.82"
rust-version = "1.85"

[dependencies]
arrow = { workspace = true, features = ["ffi", "chrono-tz"] }
Expand Down
2 changes: 1 addition & 1 deletion rust/geoarrow-array/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = { workspace = true }
repository = { workspace = true }
description = "Rust implementation of GeoArrow"
categories = ["science::geo"]
rust-version = "1.82"
rust-version = { workspace = true }


[dependencies]
Expand Down
9 changes: 5 additions & 4 deletions rust/geoarrow-array/src/array/coord/interleaved.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,11 @@ impl InterleavedCoordBuffer {

pub(crate) fn from_arrow(array: &FixedSizeListArray, dim: Dimension) -> Result<Self> {
if array.value_length() != dim.size() as i32 {
return Err(GeoArrowError::General(
format!( "Expected the FixedSizeListArray to match the dimension. Array length is {}, dimension is: {:?} have size 2", array.value_length(), dim)

));
return Err(GeoArrowError::General(format!(
"Expected the FixedSizeListArray to match the dimension. Array length is {}, dimension is: {:?} have size 2",
array.value_length(),
dim
)));
}

let coord_array_values = array
Expand Down
2 changes: 1 addition & 1 deletion rust/geoarrow-array/src/array/geometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ impl TryFrom<(&UnionArray, GeometryType)> for GeometryArray {
return Err(GeoArrowError::General(format!(
"Unexpected type_id {}",
type_id
)))
)));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion rust/geoarrow-array/src/array/geometrycollection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::eq::offset_buffer_eq;
use crate::error::{GeoArrowError, Result};
use crate::scalar::GeometryCollection;
use crate::trait_::{ArrayAccessor, GeoArrowArray, IntoArrow};
use crate::util::{offsets_buffer_i64_to_i32, OffsetBufferUtils};
use crate::util::{OffsetBufferUtils, offsets_buffer_i64_to_i32};

/// An immutable array of GeometryCollection geometries.
///
Expand Down
2 changes: 1 addition & 1 deletion rust/geoarrow-array/src/array/linestring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::eq::offset_buffer_eq;
use crate::error::{GeoArrowError, Result};
use crate::scalar::LineString;
use crate::trait_::{ArrayAccessor, GeoArrowArray, IntoArrow};
use crate::util::{offsets_buffer_i64_to_i32, OffsetBufferUtils};
use crate::util::{OffsetBufferUtils, offsets_buffer_i64_to_i32};

use arrow_array::cast::AsArray;
use arrow_array::{Array, ArrayRef, GenericListArray, OffsetSizeTrait};
Expand Down
9 changes: 6 additions & 3 deletions rust/geoarrow-array/src/array/mixed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use geoarrow_schema::{
MultiPointType, MultiPolygonType, PointType, PolygonType,
};

use crate::ArrayAccessor;
use crate::array::{
LineStringArray, MultiLineStringArray, MultiPointArray, MultiPolygonArray, PointArray,
PolygonArray, WKBArray,
Expand All @@ -23,7 +24,6 @@ use crate::datatypes::GeoArrowType;
use crate::error::{GeoArrowError, Result};
use crate::scalar::Geometry;
use crate::trait_::GeoArrowArray;
use crate::ArrayAccessor;

/// # Invariants
///
Expand Down Expand Up @@ -572,7 +572,10 @@ impl TryFrom<(&UnionArray, Dimension, CoordType)> for MixedGeometryArray {
};

if dim != found_dimension {
return Err( GeoArrowError::General(format!("expected dimension: {:?}, found child array with dimension {:?} and type_id: {}", dim, found_dimension, type_id )));
return Err(GeoArrowError::General(format!(
"expected dimension: {:?}, found child array with dimension {:?} and type_id: {}",
dim, found_dimension, type_id
)));
}

match type_id {
Expand Down Expand Up @@ -640,7 +643,7 @@ impl TryFrom<(&UnionArray, Dimension, CoordType)> for MixedGeometryArray {
return Err(GeoArrowError::General(format!(
"Unexpected type_id {}",
type_id
)))
)));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion rust/geoarrow-array/src/array/multilinestring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::eq::offset_buffer_eq;
use crate::error::{GeoArrowError, Result};
use crate::scalar::MultiLineString;
use crate::trait_::{ArrayAccessor, GeoArrowArray, IntoArrow};
use crate::util::{offsets_buffer_i64_to_i32, OffsetBufferUtils};
use crate::util::{OffsetBufferUtils, offsets_buffer_i64_to_i32};

/// An immutable array of MultiLineString geometries.
///
Expand Down
2 changes: 1 addition & 1 deletion rust/geoarrow-array/src/array/multipoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::eq::offset_buffer_eq;
use crate::error::{GeoArrowError, Result};
use crate::scalar::MultiPoint;
use crate::trait_::{ArrayAccessor, GeoArrowArray, IntoArrow};
use crate::util::{offsets_buffer_i64_to_i32, OffsetBufferUtils};
use crate::util::{OffsetBufferUtils, offsets_buffer_i64_to_i32};

/// An immutable array of MultiPoint geometries.
///
Expand Down
2 changes: 1 addition & 1 deletion rust/geoarrow-array/src/array/multipolygon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::eq::offset_buffer_eq;
use crate::error::{GeoArrowError, Result};
use crate::scalar::MultiPolygon;
use crate::trait_::{ArrayAccessor, GeoArrowArray, IntoArrow};
use crate::util::{offsets_buffer_i64_to_i32, OffsetBufferUtils};
use crate::util::{OffsetBufferUtils, offsets_buffer_i64_to_i32};

/// An immutable array of MultiPolygon geometries.
///
Expand Down
2 changes: 1 addition & 1 deletion rust/geoarrow-array/src/array/point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ use arrow_buffer::NullBuffer;
use arrow_schema::{DataType, Field};
use geoarrow_schema::{Metadata, PointType};

use crate::GeoArrowType;
use crate::array::{CoordBuffer, InterleavedCoordBuffer, SeparatedCoordBuffer};
use crate::eq::point_eq;
use crate::error::{GeoArrowError, Result};
use crate::scalar::Point;
use crate::trait_::{ArrayAccessor, GeoArrowArray, IntoArrow};
use crate::GeoArrowType;

/// An immutable array of Point geometries.
///
Expand Down
2 changes: 1 addition & 1 deletion rust/geoarrow-array/src/array/polygon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::eq::offset_buffer_eq;
use crate::error::{GeoArrowError, Result};
use crate::scalar::Polygon;
use crate::trait_::{ArrayAccessor, GeoArrowArray, IntoArrow};
use crate::util::{offsets_buffer_i64_to_i32, OffsetBufferUtils};
use crate::util::{OffsetBufferUtils, offsets_buffer_i64_to_i32};

/// An immutable array of Polygon geometries using GeoArrow's in-memory representation.
///
Expand Down
2 changes: 1 addition & 1 deletion rust/geoarrow-array/src/array/wkb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,9 @@ impl TryFrom<WKBArray<i64>> for WKBArray<i32> {

#[cfg(test)]
mod test {
use crate::GeoArrowArray;
use crate::builder::WKBBuilder;
use crate::test::point;
use crate::GeoArrowArray;

use super::*;

Expand Down
4 changes: 2 additions & 2 deletions rust/geoarrow-array/src/array/wkt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ use arrow_schema::{DataType, Field};
use geoarrow_schema::{Metadata, WktType};
use wkt::Wkt;

use crate::ArrayAccessor;
use crate::datatypes::GeoArrowType;
use crate::error::{GeoArrowError, Result};
use crate::trait_::{GeoArrowArray, IntoArrow};
use crate::util::{offsets_buffer_i32_to_i64, offsets_buffer_i64_to_i32};
use crate::ArrayAccessor;

/// An immutable array of WKT geometries using GeoArrow's in-memory representation.
///
Expand Down Expand Up @@ -225,8 +225,8 @@ impl TryFrom<WKTArray<i64>> for WKTArray<i32> {
mod test {
use arrow_array::builder::GenericStringBuilder;

use crate::test::point;
use crate::GeoArrowArray;
use crate::test::point;

use super::*;

Expand Down
20 changes: 10 additions & 10 deletions rust/geoarrow-array/src/builder/geometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ impl<'a> GeometryBuilder {
dim => {
return Err(GeoArrowError::General(format!(
"Unsupported dimension {dim:?}"
)))
)));
}
}
} else {
Expand All @@ -369,7 +369,7 @@ impl<'a> GeometryBuilder {
dim => {
return Err(GeoArrowError::General(format!(
"Unsupported dimension {dim:?}"
)))
)));
}
}
}
Expand Down Expand Up @@ -429,7 +429,7 @@ impl<'a> GeometryBuilder {
dim => {
return Err(GeoArrowError::General(format!(
"Unsupported dimension {dim:?}"
)))
)));
}
}
} else {
Expand All @@ -452,7 +452,7 @@ impl<'a> GeometryBuilder {
dim => {
return Err(GeoArrowError::General(format!(
"Unsupported dimension {dim:?}"
)))
)));
}
}
}
Expand Down Expand Up @@ -511,7 +511,7 @@ impl<'a> GeometryBuilder {
dim => {
return Err(GeoArrowError::General(format!(
"Unsupported dimension {dim:?}"
)))
)));
}
}
} else {
Expand All @@ -534,7 +534,7 @@ impl<'a> GeometryBuilder {
dim => {
return Err(GeoArrowError::General(format!(
"Unsupported dimension {dim:?}"
)))
)));
}
}
}
Expand Down Expand Up @@ -591,7 +591,7 @@ impl<'a> GeometryBuilder {
dim => {
return Err(GeoArrowError::General(format!(
"Unsupported dimension {dim:?}"
)))
)));
}
}
} else {
Expand Down Expand Up @@ -648,7 +648,7 @@ impl<'a> GeometryBuilder {
dim => {
return Err(GeoArrowError::General(format!(
"Unsupported dimension {dim:?}"
)))
)));
}
}
} else {
Expand Down Expand Up @@ -705,7 +705,7 @@ impl<'a> GeometryBuilder {
dim => {
return Err(GeoArrowError::General(format!(
"Unsupported dimension {dim:?}"
)))
)));
}
}
} else {
Expand Down Expand Up @@ -796,7 +796,7 @@ impl<'a> GeometryBuilder {
dim => {
return Err(GeoArrowError::General(format!(
"Unsupported dimension {dim:?}"
)))
)));
}
}
} else {
Expand Down
6 changes: 4 additions & 2 deletions rust/geoarrow-array/src/builder/offsets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,10 @@ impl<O: OffsetSizeTrait> OffsetsBuilder<O> {
#[inline]
pub unsafe fn start_end_unchecked(&self, index: usize) -> (usize, usize) {
// soundness: the invariant of the function
let start = self.0.get_unchecked(index).to_usize().unwrap();
let end = self.0.get_unchecked(index + 1).to_usize().unwrap();
let start = unsafe { self.0.get_unchecked(index) }.to_usize().unwrap();
let end = unsafe { self.0.get_unchecked(index + 1) }
.to_usize()
.unwrap();
(start, end)
}

Expand Down
4 changes: 2 additions & 2 deletions rust/geoarrow-array/src/builder/wkb.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
use arrow_array::builder::GenericBinaryBuilder;
use arrow_array::OffsetSizeTrait;
use arrow_array::builder::GenericBinaryBuilder;
use geo_traits::{
GeometryCollectionTrait, GeometryTrait, GeometryType, LineStringTrait, MultiLineStringTrait,
MultiPointTrait, MultiPolygonTrait, PointTrait, PolygonTrait,
};
use geoarrow_schema::WkbType;
use wkb::Endianness;
use wkb::writer::{
write_geometry_collection, write_line_string, write_multi_line_string, write_multi_point,
write_multi_polygon, write_point, write_polygon,
};
use wkb::Endianness;

use crate::array::WKBArray;
use crate::capacity::WKBCapacity;
Expand Down
Loading
Loading