diff --git a/python/core/CHANGELOG.md b/python/core/CHANGELOG.md new file mode 100644 index 00000000..5841875e --- /dev/null +++ b/python/core/CHANGELOG.md @@ -0,0 +1,51 @@ +# Changelog + +## [0.2.0] - 2024-03-22 + +### New! :sparkles: + +- New I/O support for reading and writing to geospatial formats: + - [Asynchronous FlatGeobuf reader](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/io/#geoarrow.rust.core.read_flatgeobuf_async). This also supports passing a spatial filter. + - [Initial support for reading from PostGIS](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/io/#geoarrow.rust.core.read_postgis). Note that not all Postgres data types are supported yet. Create an issue if your query fails. + - [Reading](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/io/#geoarrow.rust.core.read_geojson_lines) and [writing](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/io/#geoarrow.rust.core.write_geojson_lines) [newline-delimited GeoJSON](https://stevage.github.io/ndgeojson/). + - [Pyogrio integration](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/io/#geoarrow.rust.core.read_pyogrio) for reading from OGR/GDAL. + - [Asynchronous GeoParquet reader](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/io/#geoarrow.rust.core.read_parquet_async) for reading from remote files. By @weiji14 in https://github.com/geoarrow/geoarrow-rs/pull/493 + - Also new support for writing GeoParquet files. + - Most I/O readers and writers support Python file-like objects (in binary mode). + - Support for [reading](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/io/#geoarrow.rust.core.read_ipc) and [writing](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/io/#geoarrow.rust.core.write_ipc) Arrow IPC files. +- Better interoperability with the Python geospatial ecosystem. + - [Import from](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/interop/#geoarrow.rust.core.from_geopandas) and [export to](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/interop/#geoarrow.rust.core.to_geopandas) GeoPandas GeoDataFrames. Refer to the [GeoPandas interoperability documentation](https://geoarrow.org/geoarrow-rs/python/v0.2.0/ecosystem/geopandas/). + - [Import from](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/interop/#geoarrow.rust.core.from_shapely) and [export to](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/interop/#geoarrow.rust.core.to_shapely) Shapely arrays. Refer to the [Shapely interoperability documentation](https://geoarrow.org/geoarrow-rs/python/v0.2.0/ecosystem/shapely/). + - [Better integration with Lonboard](https://geoarrow.org/geoarrow-rs/python/v0.2.0/ecosystem/lonboard/) for fast visualization in Jupyter. + - All scalars, arrays, chunked arrays, and table objects implement [`__geo_interface__`](https://gist.github.com/sgillies/2217756) for interoperability with existing tools. + - Numpy interoperability for float array output from algorithms. Pass any `Float64Array` or `BooleanArray` to `numpy.asarray`. You can also pass a numpy array as vectorized input into a function like [`line_interpolate_point`](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/functions/#geoarrow.rust.core.line_interpolate_point). +- New algorithms! + - [Explode a Table](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/functions/#geoarrow.rust.core.explode) where each multi-geometry expands into multiple rows of single geometries. + - [`total_bounds`](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/functions/#geoarrow.rust.core.total_bounds) + - Unified [`area` function](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/functions/#geoarrow.rust.core.area) for planar and geodesic area. + - Unified [`simplify` function](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/functions/#geoarrow.rust.core.simplify) for multiple simplification methods. Also new support for [topology-preserving simplification](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/enums/#geoarrow.rust.core.enums.SimplifyMethod.VW_Preserve). + - Unified [`length` function](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/functions/#geoarrow.rust.core.length) for euclidean and geodesic length calculations. + - [`frechet_distance`](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/functions/#geoarrow.rust.core.frechet_distance) for LineString similarity. + - [`affine_transform`](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/functions/#geoarrow.rust.core.affine_transform), which integrates with the Python [`affine`](https://github.com/rasterio/affine) library. + - [`line_interpolate_point`](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/functions/#geoarrow.rust.core.line_interpolate_point) and [`line_locate_point`](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/functions/#geoarrow.rust.core.line_locate_point) for linear referencing. + - [`polylabel`](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/functions/#geoarrow.rust.core.polylabel) for polygon labeling. +- Improved display of Python objects: + - Scalars now display as SVG geometries inside Jupyter environments. + - Tables, arrays, and chunked arrays implement `__repr__` so that you can inspect data easily. +- Improved usability: + - [`PointArray.from_xy`](https://geoarrow.org/geoarrow-rs/python/v0.2.0/api/core/geometry/array/#geoarrow.rust.core.PointArray.from_xy) to simplify creating a point array from numpy arrays of coordinates. + - Index into arrays and chunked arrays with square brackets. E.g. `point_array[0]` will access the first point in the array. Negative indexing is also supported, so `point_array[-1]` will get the last item in the array. +- New [top-level docs website](https://geoarrow.org/geoarrow-rs/). + + +## New Contributors + +* @Robinlovelace made their first contribution in https://github.com/geoarrow/geoarrow-rs/pull/484 +* @weiji14 made their first contribution in https://github.com/geoarrow/geoarrow-rs/pull/493 + +**Full Changelog**: https://github.com/geoarrow/geoarrow-rs/compare/py-v0.1.0...py-v0.2.0 + + +## [0.1.0] - 2024-01-08 + +- Initial public release. diff --git a/python/core/Cargo.lock b/python/core/Cargo.lock index 69f35709..e3c2a5ff 100644 --- a/python/core/Cargo.lock +++ b/python/core/Cargo.lock @@ -1009,7 +1009,7 @@ dependencies = [ [[package]] name = "geoarrow-rust-core" -version = "0.1.0" +version = "0.2.0" dependencies = [ "arrow", "arrow-array", diff --git a/python/core/Cargo.toml b/python/core/Cargo.toml index bbe73861..1286b146 100644 --- a/python/core/Cargo.toml +++ b/python/core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "geoarrow-rust-core" -version = "0.1.0" +version = "0.2.0" authors = ["Kyle Barron "] edition = "2021" description = "Efficient, vectorized geospatial operations in Python." diff --git a/python/core/src/algorithm/geo/simplify.rs b/python/core/src/algorithm/geo/simplify.rs index 9cee85e4..4ddba1cf 100644 --- a/python/core/src/algorithm/geo/simplify.rs +++ b/python/core/src/algorithm/geo/simplify.rs @@ -33,9 +33,9 @@ impl<'a> FromPyObject<'a> for SimplifyMethod { /// unaltered version of the geometry. /// /// Other args: -/// method: The method to use for simplification calculation. One of "rdp" or "vw". Refer to -/// the documentation on [SimplifyMethod][geoarrow.rust.core.enums.SimplifyMethod] for more -/// information. +/// method: The method to use for simplification calculation. One of `"rdp"`, `"vw"`, or +/// `"vw_preserve"`. Refer to the documentation on +/// [SimplifyMethod][geoarrow.rust.core.enums.SimplifyMethod] for more information. /// /// Returns: /// Simplified geometry array. @@ -80,8 +80,8 @@ macro_rules! impl_simplify { /// will return an unaltered version of the geometry. /// /// Other args: - /// method: The method to use for simplification calculation. One of "rdp" or - /// "vw". Refer to the documentation on + /// method: The method to use for simplification calculation. One of `"rdp"`, + /// `"vw"`, or `"vw_preserve"`. Refer to the documentation on /// [SimplifyMethod][geoarrow.rust.core.enums.SimplifyMethod] for more /// information. /// @@ -117,8 +117,8 @@ macro_rules! impl_chunked { /// will return an unaltered version of the geometry. /// /// Other args: - /// method: The method to use for simplification calculation. One of "rdp" or - /// "vw". Refer to the documentation on + /// method: The method to use for simplification calculation. One of `"rdp"`, + /// `"vw"`, or `"vw_preserve"`. Refer to the documentation on /// [SimplifyMethod][geoarrow.rust.core.enums.SimplifyMethod] for more /// information. /// diff --git a/python/core/src/algorithm/native/explode.rs b/python/core/src/algorithm/native/explode.rs index f5c12a1e..f8a2a27e 100644 --- a/python/core/src/algorithm/native/explode.rs +++ b/python/core/src/algorithm/native/explode.rs @@ -5,8 +5,8 @@ use pyo3::prelude::*; /// Explode a table. /// -/// This is intended to be equivalent to the [`explode` function in -/// GeoPandas][geopandas.GeoDataFrame.explode]. +/// This is intended to be equivalent to the [`explode`][geopandas.GeoDataFrame.explode] function +/// in GeoPandas. /// /// Args: /// input: input table @@ -22,8 +22,8 @@ pub fn explode(input: GeoTable) -> PyGeoArrowResult { impl GeoTable { /// Explode a table. /// - /// This is intended to be equivalent to the [`explode` function in - /// GeoPandas][geopandas.GeoDataFrame.explode]. + /// This is intended to be equivalent to the [`explode`][geopandas.GeoDataFrame.explode] + /// function in GeoPandas. /// /// Returns: /// A new table with multi-part geometries exploded to separate rows. diff --git a/python/core/src/interop/shapely/from_shapely.rs b/python/core/src/interop/shapely/from_shapely.rs index 0bebb108..2d37a86a 100644 --- a/python/core/src/interop/shapely/from_shapely.rs +++ b/python/core/src/interop/shapely/from_shapely.rs @@ -91,7 +91,8 @@ fn numpy_to_offsets_buffer( /// method on a chunked GeoArrow array class to construct a chunked array. /// - This will first call [`to_ragged_array`][shapely.to_ragged_array], falling back to /// [`to_wkb`][shapely.to_wkb] if necessary. If you know you have mixed-type geometries in your -/// column, use [`MixedGeometryArray.from_shapely`][MixedGeometryArray.from_shapely]. ' +/// column, use +/// [`MixedGeometryArray.from_shapely`][geoarrow.rust.core.MixedGeometryArray.from_shapely]. /// /// This is because `to_ragged_array` is the fastest approach but fails on mixed-type geometries. /// It supports combining Multi-* geometries with non-multi-geometries in the same array, so you diff --git a/python/docs/mkdocs.yml b/python/docs/mkdocs.yml index 2300bf04..ab76e483 100644 --- a/python/docs/mkdocs.yml +++ b/python/docs/mkdocs.yml @@ -22,33 +22,33 @@ extra: nav: - index.md - API Reference: - - core: - - api/core/index.md - - Geometry Arrays: - - api/core/geometry/array.md - - api/core/geometry/chunked.md - - api/core/geometry/scalar.md - - Primitive Arrays: - - api/core/primitive/array.md - - api/core/primitive/chunked.md - - api/core/table.md - - Operations: api/core/functions.md - - Interoperability: api/core/interop.md - - IO: api/core/io.md - - Enums: api/core/enums.md - - Types: api/core/types.md + - core: + - api/core/index.md + - Geometry Arrays: + - api/core/geometry/array.md + - api/core/geometry/chunked.md + - api/core/geometry/scalar.md + - Primitive Arrays: + - api/core/primitive/array.md + - api/core/primitive/chunked.md + - api/core/table.md + - Operations: api/core/functions.md + - Interoperability: api/core/interop.md + - IO: api/core/io.md + - Enums: api/core/enums.md + - Types: api/core/types.md - Ecosystem: - - ecosystem/geopandas.md - - ecosystem/lonboard.md - # - ecosystem/polars.md - - ecosystem/pyogrio.md - - ecosystem/shapely.md + - ecosystem/geopandas.md + - ecosystem/lonboard.md + # - ecosystem/polars.md + - ecosystem/pyogrio.md + - ecosystem/shapely.md - Performance: - - performance/multithreading.md + - performance/multithreading.md + - Changelog: CHANGELOG.md # - Caveats: caveats.md # - Performance: performance.md - # - Changelog: CHANGELOG.md # - "How it works?": how-it-works.md watch: diff --git a/python/docs/source/CHANGELOG.md b/python/docs/source/CHANGELOG.md new file mode 120000 index 00000000..3a3a672f --- /dev/null +++ b/python/docs/source/CHANGELOG.md @@ -0,0 +1 @@ +../../core/CHANGELOG.md \ No newline at end of file