From ba4977fa16924930784b79cb0b05a0b2885ecbc1 Mon Sep 17 00:00:00 2001 From: navispatial <88932567+navispatial@users.noreply.github.com> Date: Fri, 26 Jul 2024 14:07:44 +0300 Subject: [PATCH] pub(geobase): stable release 1.3.0 --- CHANGELOG.md | 2 +- README.md | 4 +++- dart/geobase/CHANGELOG.md | 4 ++-- dart/geobase/README.md | 4 ++-- dart/geobase/example/geobase_example.dart | 10 +++++----- .../cartesian/areal/cartesian_areal_extension.dart | 4 ++-- dart/geobase/pubspec.yaml | 2 +- .../geobase/test/coordinates/position_series_test.dart | 3 +++ dart/geobase/test/coordinates/position_test.dart | 1 + 9 files changed, 20 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b39d4c2c..75138a61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## 2024-07-26 -* ✨ The [stable version 1.3.0](https://github.com/navibyte/geospatial/milestone/5) with centroid, polylabel, point-in-polygon and other cartesian 2D calculations enhanced - [read more](https://geospatial.navibyte.dev/v1/geobase/geometry-calculations/) +* ✨ The [stable version 1.3.0](https://github.com/navibyte/geospatial/milestone/5) with centroid, polylabel, point-in-polygon and other cartesian 2D calculations enhanced - [read more](https://geospatial.navibyte.dev/v1/geobase/geometry-calculations/)! * All docs: [geospatial.navibyte.dev](https://geospatial.navibyte.dev/). * Published packages at pub.dev: * [geobase version 1.3.0](https://pub.dev/packages/geobase/versions/1.3.0) diff --git a/README.md b/README.md index 9dc786bd..bfd1ff42 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ schemes, vector data models and formats, and geospatial Web APIs. [![Dart](https://img.shields.io/badge/dart-%230175C2.svg?style=for-the-badge&logo=dart&logoColor=white)](https://dart.dev/) [![Flutter](https://img.shields.io/badge/Flutter-%2302569B.svg?style=for-the-badge&logo=Flutter&logoColor=white)](https://flutter.dev/) +✨ New (2024-07-26): The stable version 1.3.0 with centroid, polylabel, point-in-polygon and other cartesian 2D calculations enhanced - [read more](https://geospatial.navibyte.dev/v1/geobase/geometry-calculations/)! + ✨ New (2024-05-26): The new documentation website ([geospatial.navibyte.dev](https://geospatial.navibyte.dev/)) for [geobase](https://geospatial.navibyte.dev/v1/geobase/) and [geodata](https://geospatial.navibyte.dev/v1/geodata/) package documentation published along with the stable version 1.2.0. @@ -316,7 +318,7 @@ Code | Description ## :newspaper_roll: News 2024-07-26 -* ✨ The [stable version 1.3.0](https://github.com/navibyte/geospatial/milestone/5) with centroid, polylabel, point-in-polygon and other cartesian 2D calculations enhanced - [read more](https://geospatial.navibyte.dev/v1/geobase/geometry-calculations/) +* ✨ The [stable version 1.3.0](https://github.com/navibyte/geospatial/milestone/5) with centroid, polylabel, point-in-polygon and other cartesian 2D calculations enhanced - [read more](https://geospatial.navibyte.dev/v1/geobase/geometry-calculations/)! * All docs: [geospatial.navibyte.dev](https://geospatial.navibyte.dev/). * Published packages at pub.dev: * [geobase version 1.3.0](https://pub.dev/packages/geobase/versions/1.3.0) diff --git a/dart/geobase/CHANGELOG.md b/dart/geobase/CHANGELOG.md index 2453ea42..3f7b14c1 100644 --- a/dart/geobase/CHANGELOG.md +++ b/dart/geobase/CHANGELOG.md @@ -1,8 +1,8 @@ ## 1.3.0 -[geobase release 1.3.0](https://github.com/navibyte/geospatial/milestone/5) +✨ New (2024-07-26): The stable version 1.3.0 with centroid, polylabel, point-in-polygon and other cartesian 2D calculations enhanced - [read more](https://geospatial.navibyte.dev/v1/geobase/geometry-calculations/)! -✨ New (2024-07-26): The stable version 1.3.0 with centroid, polylabel, point-in-polygon and other cartesian 2D calculations enhanced - [read more](https://geospatial.navibyte.dev/v1/geobase/geometry-calculations/) +[geobase release 1.3.0](https://github.com/navibyte/geospatial/milestone/5) 🧩 Features: * [Add visual center point calculations for polygons #237](https://github.com/navibyte/geospatial/issues/237) diff --git a/dart/geobase/README.md b/dart/geobase/README.md index efd655ee..b3ca9da3 100644 --- a/dart/geobase/README.md +++ b/dart/geobase/README.md @@ -10,7 +10,7 @@ and [WKB](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geomet ## Features -✨ New (2024-07-26): The stable version 1.3.0 with centroid, polylabel, point-in-polygon and other cartesian 2D calculations enhanced - [read more](https://geospatial.navibyte.dev/v1/geobase/geometry-calculations/) +✨ New (2024-07-26): The stable version 1.3.0 with centroid, polylabel, point-in-polygon and other cartesian 2D calculations enhanced - [read more](https://geospatial.navibyte.dev/v1/geobase/geometry-calculations/)! ✨ New (2024-05-26): The new documentation website ([geospatial.navibyte.dev](https://geospatial.navibyte.dev/)) for the [geobase](https://geospatial.navibyte.dev/v1/geobase/) package documentation published along with the stable version 1.2.0. @@ -304,7 +304,7 @@ Add the dependency in your `pubspec.yaml`: ```yaml dependencies: - geobase: ^1.3.0-dev.1 + geobase: ^1.3.0 ``` Import it: diff --git a/dart/geobase/example/geobase_example.dart b/dart/geobase/example/geobase_example.dart index ffb25e4e..7d79a63a 100644 --- a/dart/geobase/example/geobase_example.dart +++ b/dart/geobase/example/geobase_example.dart @@ -782,17 +782,17 @@ void _geometricCartesianPolygonFromGeometryManipulation() { print('Last position: ${exteriorRing.lastOrNull}'); // 35.0,10.0 print('X coordinate at position 1: ${exteriorRing.x(1)}'); // 45.0 print('Y coordinate at position 3: ${exteriorRing.y(3)}'); // 20.0 - + // Looping positions by accessing coordinate values (best to use this option // when a position series is constructed from a double coordinate value array) - for(int i = 0, len = exteriorRing.positionCount; i < len; i++) { - print('X: ${exteriorRing.x(i)} Y: ${exteriorRing.y(i)} (at $i)'); + for (int i = 0, len = exteriorRing.positionCount; i < len; i++) { + print('X: ${exteriorRing.x(i)} Y: ${exteriorRing.y(i)} (at $i)'); } // Looping positions by accessing `Position` objects (best to use this option // when a position series is constructed from `Position` instances) - for(final pos in exteriorRing.positions) { - print('X: ${pos.x} Y: ${pos.y}'); + for (final pos in exteriorRing.positions) { + print('X: ${pos.x} Y: ${pos.y}'); } } diff --git a/dart/geobase/lib/src/geometric/cartesian/areal/cartesian_areal_extension.dart b/dart/geobase/lib/src/geometric/cartesian/areal/cartesian_areal_extension.dart index 0bbdfa4e..c0072b81 100644 --- a/dart/geobase/lib/src/geometric/cartesian/areal/cartesian_areal_extension.dart +++ b/dart/geobase/lib/src/geometric/cartesian/areal/cartesian_areal_extension.dart @@ -188,9 +188,9 @@ extension CartesianArealExtension on Iterable { /// [destination] calculated in a cartesian 2D plane. /// /// Returns `double.infinity` if a distance could not be calculated. - /// + /// /// Examples: - /// + /// /// ```dart /// // Polygon data (with an exterior ring and one interior ring as a hole) as an /// // `Iterable`. Each ring is represented by an instance of diff --git a/dart/geobase/pubspec.yaml b/dart/geobase/pubspec.yaml index fc8664c6..47bc9009 100644 --- a/dart/geobase/pubspec.yaml +++ b/dart/geobase/pubspec.yaml @@ -1,6 +1,6 @@ name: geobase description: Geospatial data, spherical geodesy, projections, tiling schemes, and vector formats (GeoJSON, WKT, WKB). -version: 1.3.0-dev.1 +version: 1.3.0 repository: https://github.com/navibyte/geospatial homepage: https://geospatial.navibyte.dev/ diff --git a/dart/geobase/test/coordinates/position_series_test.dart b/dart/geobase/test/coordinates/position_series_test.dart index c63a3417..7cfd104f 100644 --- a/dart/geobase/test/coordinates/position_series_test.dart +++ b/dart/geobase/test/coordinates/position_series_test.dart @@ -1086,18 +1086,21 @@ void main() { dist, ); } + void testLinear(PositionSeries series, Position pos, double dist) { expect( series.distanceTo2D(pos, dimensionality: Dimensionality.linear), dist, ); } + void testPunctual(PositionSeries series, Position pos, double dist) { expect( series.distanceTo2D(pos, dimensionality: Dimensionality.punctual), dist, ); } + final s1 = [0.0, 0.0, 1.0, 1.0, 3.0, 1.0].positions(); testAreal(s1, [2.0, 0.0].xy, 0.6324555320336759); testAreal(s1, [1.5, 0.0].xy, 0.4743416490252569); diff --git a/dart/geobase/test/coordinates/position_test.dart b/dart/geobase/test/coordinates/position_test.dart index 6f619910..74655c57 100644 --- a/dart/geobase/test/coordinates/position_test.dart +++ b/dart/geobase/test/coordinates/position_test.dart @@ -483,6 +483,7 @@ void main() { void testDist(Position start, Position end, double dist) { expect(pos.distanceToLineSegment2D(start, end), dist); } + testDist([2.0, 2.0].xy, [2.0, 2.0].xy, 0.0); testDist([1.9, 2.0].xy, [2.1, 2.0].xy, 0.0); testDist([1.9, 3.0].xy, [2.1, 3.0].xy, 1.0);