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

Release: 0.10.1 #40

Merged
merged 10 commits into from
Sep 18, 2023
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
45 changes: 25 additions & 20 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,47 @@
# CHANGELOG

## 0.10.1

- Added Example README.md
- Revised Documentation Content

## 0.10.0

- Geodesy Refactoring
- Implement Geodesic Measurements
- Calculate the length of a polyline formed by connecting multiple points
- Calculate the area of a polygon defined by a set of points using Shoelace formula
- Implement Intersection and Projection
- Calculate intersection points of two geodesic lines
- Project a point onto a geodesic line
- Refactored Geodesy
- Implemented Geodesic Measurements
- Calculating the length of a polyline formed by connecting multiple points
- Calculating the area of a polygon defined by a set of points using Shoelace formula
- Implemented Intersection and Projection
- Calculating intersection points of two geodesic lines
- Projecting a point onto a geodesic line

## 0.9.0

- Implement DistanceCalculations: EquirectangularApproximation, and SphericalLawOfCosines
- Implement GeodeticPointManipulation: DestinationPoint, MidPointBetweenTwoPoints, and GreatCirclePoint
- Implemented DistanceCalculations: EquirectangularApproximation, and SphericalLawOfCosines
- Implemented GeodeticPointManipulation: DestinationPoint, MidPointBetweenTwoPoints, and GreatCirclePoint

## 0.8.0

- Implement Calculating Polygon Area With Hole
- Implement Vincenty Formula for Geodesic Distance Calculation
- Add CODE_OF_CONDUCT.md
- Revise LICENSE
- Implemented Calculating Polygon Area With Hole
- Implemented Vincenty Formula for Geodesic Distance Calculation
- Added CODE_OF_CONDUCT.md
- Revised LICENSE

## 0.7.0

- Refactor geodesy
- Support Class & Static methods
- Refactored geodesy
- Supported Class & Static methods

## 0.6.0

- Add findPolygonCentroid
- Add getPolygonIntersection
- Added findPolygonCentroid
- Added getPolygonIntersection

## 0.5.0

- Add greatCircleDistanceBetweenTwoGeoPoints
- Add getRectangleBounds
- Add calculateBoundingBox
- Added greatCircleDistanceBetweenTwoGeoPoints
- Added getRectangleBounds
- Added calculateBoundingBox

## 0.4.2

Expand Down
File renamed without changes.
34 changes: 13 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,32 @@ dart pub add geodesy
flutter pub add geodesy
```

### Import the library in your dart file
### Import Geodesy

```dart
import 'package:geodesy/geodesy.dart';
```

### Initialization

```dart
final Geodesy geodesy = Geodesy();
```

## Class

The Geodesy class provides a collection of methods for performing various geodetic calculations, including distance calculations, point intersections, and more. This class is designed to work with geographical coordinates in the form of latitude and longitude.

Please see the details [here](doc/CLASS.md).
The `Geodesy` class provides a collection of methods for performing various geodetic calculations, including distance calculations, point intersections, and more. This class is designed to work with geographical coordinates in the form of latitude and longitude.

### Example

Please check out [here](example/class_example.dart).
Please see the [Usage](doc/CLASS.md) and [Example](example/class_example.dart).

## Static Methods

Static methods are available without using Geodesy instance.
Static methods are available without using `Geodesy` instance.

Please see the [Usage](doc/METHODS.md) and [Example](example/static_example.dart).

Please see the details [here](doc/METHODS.md).
### Example
## License

Please check out [here](example/static_example.dart).
## Code of Conduct
This project is licensed under [MIT](./LICENSE).

See [here](doc/CODE_OF_CONDUCT.md).
## Contributors

## License
Thank you for your contributions! We appreciate all the contributions from the community.

See [here](./LICENSE).
<a href="https://github.com/wingkwong/geodesy/graphs/contributors">
<img src="https://contrib.rocks/image?repo=wingkwong/geodesy" />
</a>
20 changes: 7 additions & 13 deletions doc/CLASS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
The `Geodesy` class provides a collection of methods for performing various geodetic calculations, including distance calculations, point intersections, and more. This class is designed to work with geographical coordinates in the form of latitude and longitude.

```dart
final Geodesy geodesy = Geodesy();
final geodesy = Geodesy();
```

Call any function which is given blow using geodesy Instance
Call any function which is given below using geodesy Instance.

## Methods

Expand Down Expand Up @@ -215,9 +215,7 @@ Returns a `LatLng` object representing the centroid of the polygon.

### Get Polygon Intersection

Calculate the intersection of

two polygons defined by their vertices.
Calculate the intersection of two polygons defined by their vertices.

```dart
List<LatLng> getPolygonIntersection(List<LatLng> polygon1, List<LatLng> polygon2)
Expand Down Expand Up @@ -280,16 +278,12 @@ double length = PolyLine.calculatePolyLineLength(polyLinePoints);
### Polygon Area Calculation using Shoelace formula

```dart
double polygonArea = geodesy.calculatePolygonArea(polygonPoints);
double polygonArea = geodesy.calculatePolygonArea(polygonPoints);
```

### Intersection points of two geodesic lines

```dart
LatLng? intersection = geodesy.calculateGeodesicLineIntersection(
start1, end1, start2, end2);
```

---

This `Geodesy` class provides a comprehensive set of methods for performing various geodetic calculations and operations. You can use these methods to calculate distances, bearings, intersections, and more based on geographical coordinates.
LatLng? intersection = geodesy.calculateGeodesicLineIntersection(
start1, end1, start2, end2);
```
10 changes: 3 additions & 7 deletions doc/METHODS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Static Methods

The `Geodesy` Static Methods provides a collection of methods for performing various geodetic calculations, including distance calculations, point intersections, and more. This designed to work with geographical coordinates in the form of latitude and longitude.
This `Geodesy` provides a comprehensive set of methods for performing various geodetic calculations and operations. You can use these methods to calculate distances, bearings, intersections, and more based on geographical coordinates.

Call any Static Methods which is given below without using geodesy Instance.
Call any Static Methods which is given below without using `Geodesy` Instance.

## Methods

Expand Down Expand Up @@ -113,7 +113,7 @@ BoundingBox.isGeoPointInBoundingBox(l, topLeft, bottomRight);

Returns `true` if the point is within the bounding box, otherwise `false`.

### IsGeo Point In Polygon
### Is GeoPoint In Polygon

Check if a given point is within a polygon using the even-odd rule algorithm.

Expand Down Expand Up @@ -272,7 +272,3 @@ double length = PolyLine.calculatePolyLineLength(polyLinePoints);
LatLng? intersection = GeodesicLines.calculateGeodesicLineIntersection(
start1, end1, start2, end2);
```

---

This `Geodesy` provides a comprehensive set of methods for performing various geodetic calculations and operations. You can use these methods to calculate distances, bearings, intersections, and more based on geographical coordinates.
42 changes: 42 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Example

## Geodesy Class

Check out full examples [here](./class_example.dart).

```dart
import 'package:geodesy/geodesy.dart';

void main() {
final Geodesy geodesy = Geodesy();
List<LatLng> polygon = [
const LatLng(0, 0),
const LatLng(4, 0),
const LatLng(4, 4),
const LatLng(0, 4)
];
LatLng centroid = geodesy.findPolygonCentroid(polygon);
// Centroid: 2.0, 2.0
print("Centroid: ${centroid.latitude}, ${centroid.longitude}");
}
```

## Static Methods

Check out full examples [here](./static_example.dart).

```dart
import 'package:geodesy/geodesy.dart';

void main() {
List<LatLng> polygon = [
const LatLng(0, 0),
const LatLng(4, 0),
const LatLng(4, 4),
const LatLng(0, 4)
];
final LatLng centroid = PolygonCentroid.findPolygonCentroid(polygon);
// Centroid: 2.0, 2.0
print("Centroid: ${centroid.latitude}, ${centroid.longitude}");
}
```
6 changes: 0 additions & 6 deletions example/static_example.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import 'package:geodesy/geodesy.dart';
import 'package:geodesy/src/core/GeodesicMeasurements/polygon_area_by_points.dart';
import 'package:geodesy/src/core/GeodesicMeasurements/polyline_length_by_multiple_points.dart';
import 'package:geodesy/src/core/GeodeticPointManipulation/calculate_destination_point.dart';
import 'package:geodesy/src/core/GeodeticPointManipulation/calculate_points_along_great_circle.dart';
import 'package:geodesy/src/core/GeodeticPointManipulation/mid_point_between_two_points.dart';
import 'package:geodesy/src/core/IntersectionAndProjection/geodesic_lines.dart';

void main() {
// Calculate Bounding Box
Expand Down
2 changes: 1 addition & 1 deletion lib/src/geodesy.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:geodesy/geodesy.dart';

///Geodesy class that acts as a wrapper for various geodetic calculations. This class provides a
/// Geodesy class that acts as a wrapper for various geodetic calculations. This class provides a
/// wide range of geo-spatial functionalities, from calculating distances and bearings to working
/// with polygons, points, and lines. This can be a valuable utility for geo-spatial applications
class Geodesy {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: geodesy
description: A Dart library for geodesic and trigonometric calculations working with points and paths
version: 0.10.0
version: 0.10.1
homepage: https://github.com/wingkwong/geodesy

environment:
Expand Down
1 change: 0 additions & 1 deletion test/geodesy_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,6 @@ void main() {
expect(length, equals(111319.0));
});

///
test('Lines are parallel and do not intersect', () {
// Create two parallel lines with no intersection
LatLng start1 = const LatLng(0.0, 0.0);
Expand Down