Skip to content

Commit

Permalink
pub(geobase): stable release 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
navispatial committed Jul 26, 2024
1 parent d903c66 commit ba4977f
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions dart/geobase/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions dart/geobase/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions dart/geobase/example/geobase_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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}');
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ extension CartesianArealExtension on Iterable<PositionSeries> {
/// [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<PositionSeries>`. Each ring is represented by an instance of
Expand Down
2 changes: 1 addition & 1 deletion dart/geobase/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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/

Expand Down
3 changes: 3 additions & 0 deletions dart/geobase/test/coordinates/position_series_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions dart/geobase/test/coordinates/position_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ba4977f

Please sign in to comment.