Skip to content

Commit 3c375fa

Browse files
committed
update README + change log
1 parent 0e3ad18 commit 3c375fa

File tree

2 files changed

+73
-33
lines changed

2 files changed

+73
-33
lines changed

Diff for: CHANGELOG.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,23 @@
33
All notable changes to `mjaschen/phpgeo` will be documented in this file.
44
Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
55

6-
## [5.1.0]
6+
## [6.0.0]
7+
8+
**Warning: Backwards-compatibility-breaking changes** (see README for upgrade details)
79

810
### Added
911

1012
- Support for PHP 8.4
13+
- `GeometryLinesInterface` for geometries containing lines (`Line`, `Polyline`, `Polygon`)
14+
- `getBounds()` method to `GeometryInterface`
15+
16+
### Removed
17+
18+
- Support for PHP 8.1
19+
20+
### Changed
21+
22+
- Replaced Psalm with PHPStan for static code analysis
1123

1224
## [5.0.0]
1325

Diff for: README.md

+60-32
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# phpgeo - A Simple Geo Library for PHP
22

3-
phpgeo provides abstractions to geographical coordinates (including support for different ellipsoids) and allows you to calculate geographical distances between coordinates with high precision.
3+
phpgeo provides abstractions to geographical coordinates (including support for different ellipsoids) and allows you to
4+
calculate geographical distances between coordinates with high precision.
45

56
[![Latest Stable Version](https://poser.pugx.org/mjaschen/phpgeo/v)](//packagist.org/packages/mjaschen/phpgeo)
67
[![Total Downloads](https://poser.pugx.org/mjaschen/phpgeo/downloads)](//packagist.org/packages/mjaschen/phpgeo)
@@ -11,27 +12,28 @@ phpgeo provides abstractions to geographical coordinates (including support for
1112

1213
## Requirements
1314

14-
Minimum required PHP version is 8.1. *phpgeo* is tested up to PHP 8.3.
15+
Minimum required PHP version is 8.2. *phpgeo* is tested up to PHP 8.4.
1516

1617
New features will only go into the main branch and won't be backported.
1718

1819
It's possible to install older versions of *phpgeo* for older PHP versions.
1920
Please refer to the following table for the compatibility matrix:
2021

21-
| PHP Version | phpgeo Version | Support Status | Composer Install |
22-
| :---------: | :------------: | :----------------: | --------------------------------------- |
23-
| 8.3 | 5.x | ✅ active | `composer require mjaschen/phpgeo` |
24-
| 8.2 | 5.x | ✅ active | `composer require mjaschen/phpgeo` |
25-
| 8.1 | 5.x | ✅ active | `composer require mjaschen/phpgeo` |
22+
| PHP Version | phpgeo Version | Support Status | Composer Install |
23+
|:-----------:|:--------------:|:----------------:|-----------------------------------------|
24+
| 8.4 | 6.x | ✅ active | `composer require mjaschen/phpgeo` |
25+
| 8.3 | 6.x | ✅ active | `composer require mjaschen/phpgeo` |
26+
| 8.2 | 6.x | ✅ active | `composer require mjaschen/phpgeo` |
27+
| 8.1 | 5.x | ⚠️ security only | `composer require mjaschen/phpgeo:^5.0` |
2628
| 8.0 | 4.x | ⚠️ security only | `composer require mjaschen/phpgeo:^4.0` |
2729
| 7.4 | 4.x | ⚠️ security only | `composer require mjaschen/phpgeo:^4.0` |
2830
| 7.3 | 4.x | ⚠️ security only | `composer require mjaschen/phpgeo:^4.0` |
29-
| 7.2 | 3.x | ❌ end of life | `composer require mjaschen/phpgeo:^3.0` |
30-
| 7.1 | 2.x | ❌ end of life | `composer require mjaschen/phpgeo:^2.0` |
31-
| 7.0 | 2.x | ❌ end of life | `composer require mjaschen/phpgeo:^2.0` |
32-
| 5.6 | 1.x | ❌ end of life | `composer require mjaschen/phpgeo:^1.0` |
33-
| 5.5 | 1.x | ❌ end of life | `composer require mjaschen/phpgeo:^1.0` |
34-
| 5.4 | 1.x | ❌ end of life | `composer require mjaschen/phpgeo:^1.0` |
31+
| 7.2 | 3.x | ❌ end of life | `composer require mjaschen/phpgeo:^3.0` |
32+
| 7.1 | 2.x | ❌ end of life | `composer require mjaschen/phpgeo:^2.0` |
33+
| 7.0 | 2.x | ❌ end of life | `composer require mjaschen/phpgeo:^2.0` |
34+
| 5.6 | 1.x | ❌ end of life | `composer require mjaschen/phpgeo:^1.0` |
35+
| 5.5 | 1.x | ❌ end of life | `composer require mjaschen/phpgeo:^1.0` |
36+
| 5.4 | 1.x | ❌ end of life | `composer require mjaschen/phpgeo:^1.0` |
3537

3638
## Documentation
3739

@@ -51,15 +53,27 @@ Update the version constraint in the project's `composer.json` and
5153
run `composer update` or require the new version by running:
5254

5355
```shell
54-
composer require mjaschen/phpgeo:^5.0
56+
composer require mjaschen/phpgeo:^6.0
5557
```
5658

59+
### Upgrading to 6.x
60+
61+
*phpgeo* has some breaking changes in the 6.x release line. Please refer to the following list to see what has changed
62+
and what you need to do to upgrade your code.
63+
64+
| Change | Description | Action |
65+
|--------------------------------------------------------------------------------|---------------------------------------------------------------|-----------------------------------------------------------------------------------|
66+
| `Line`, `Polygon`, and `Polyline` classes are now implementing a new interface | `GeometryLinesInterface` provides the `getSegments()` method. | There's no need to change anything if you don't extend those classes. |
67+
| `getBounds()` method was added to `GeometryInterface` | | Ensure your class has a `getBounds()` method if you implement `GeometryInterface` |
68+
| removed support for PHP 8.1 | Older PHP versions are no longer supported. | Upgrade to at least PHP 8.2 or keep using phpgeo 5.x |
69+
5770
### Upgrading to 5.x
5871

59-
*phpgeo* has some breaking changes in the 5.x release line. Please refer to the following list to see what has changed and what you need to do to upgrade your code.
72+
*phpgeo* has some breaking changes in the 5.x release line. Please refer to the following list to see what has changed
73+
and what you need to do to upgrade your code.
6074

6175
| Change | Description | Action |
62-
| ----------------------------------------------------------- | ------------------------------------------- | ------------------------------------------------------- |
76+
|-------------------------------------------------------------|---------------------------------------------|---------------------------------------------------------|
6377
| `setPoint1()` and `setPoint2()` methods removed from `Line` | The `Line` class now is immutable. | Use the constructor to create a new instance of `Line`. |
6478
| removed support for PHP 7.3, 7.4 and 8.0 | Older PHP versions are no longer supported. | Upgrade to at least PHP 8.1. |
6579

@@ -69,27 +83,35 @@ Starting with version 2.0.0 phpgeo is licensed under the MIT license. Older vers
6983

7084
## Features
7185

72-
**Info:** Please visit the **[documentation site](https://phpgeo.marcusjaschen.de/)** for complete and up-to-date documentation with many examples!
86+
**Info:** Please visit the **[documentation site](https://phpgeo.marcusjaschen.de/)** for complete and up-to-date
87+
documentation with many examples!
7388

7489
phpgeo provides the following features (follow the links for examples):
7590

76-
- abstractions of several geometry objects ([coordinate/point](https://phpgeo.marcusjaschen.de/Geometries/Coordinate.html),
91+
- abstractions of several geometry
92+
objects ([coordinate/point](https://phpgeo.marcusjaschen.de/Geometries/Coordinate.html),
7793
[line](https://phpgeo.marcusjaschen.de/Geometries/Line.html),
7894
[polyline/GPS track](https://phpgeo.marcusjaschen.de/Geometries/Polyline.html),
7995
[polygon](https://phpgeo.marcusjaschen.de/Geometries/Polygon.html)
8096
- support for different [ellipsoids](https://phpgeo.marcusjaschen.de/Geometries/Ellipsoid.html), e.g. WGS-84
8197
- [length/distance/perimeter calculations](https://phpgeo.marcusjaschen.de/Calculations/Distance_and_Length.html)
8298
with different implementations (Haversine, Vincenty)
8399
- [Geofence](https://phpgeo.marcusjaschen.de/Calculations/Geofence.html) calculation,
84-
i.e. answering the question "Is this point contained in that area/polygon?" and other [intersection](https://phpgeo.marcusjaschen.de/Comparisons/Intersections.html) checks between different geometries
100+
i.e. answering the question "Is this point contained in that area/polygon?" and
101+
other [intersection](https://phpgeo.marcusjaschen.de/Comparisons/Intersections.html) checks between different
102+
geometries
85103
- [formatting and output](https://phpgeo.marcusjaschen.de/Formatting_and_Output/index.html) of geometry objects
86104
(GeoJSON, nice strings, e. g. `18° 54′ 41″ -155° 40′ 42″`)
87-
- calculation of [bearing angle between two points](https://phpgeo.marcusjaschen.de/Calculations/Bearing_and_Destination.html#page_Bearing-between-two-points)
105+
- calculation
106+
of [bearing angle between two points](https://phpgeo.marcusjaschen.de/Calculations/Bearing_and_Destination.html#page_Bearing-between-two-points)
88107
(spherical or with Vincenty's formula)
89-
- calculation of a [destination point for a given starting point](https://phpgeo.marcusjaschen.de/Calculations/Bearing_and_Destination.html#page_Destination-point-for-given-bearing-and-distance),
108+
- calculation of
109+
a [destination point for a given starting point](https://phpgeo.marcusjaschen.de/Calculations/Bearing_and_Destination.html#page_Destination-point-for-given-bearing-and-distance),
90110
bearing angle, and distance (spherical or with Vincenty's formula)
91-
- calculation of the [perpendicular distance between a point and a line](https://phpgeo.marcusjaschen.de/Calculations/Perpendicular_Distance.html)
92-
- calculation of the [Cardinal Distances between two points](https://phpgeo.marcusjaschen.de/Calculations/Cardinal_Distance.html)
111+
- calculation of
112+
the [perpendicular distance between a point and a line](https://phpgeo.marcusjaschen.de/Calculations/Perpendicular_Distance.html)
113+
- calculation of
114+
the [Cardinal Distances between two points](https://phpgeo.marcusjaschen.de/Calculations/Cardinal_Distance.html)
93115
- getting segments of a [polyline](https://phpgeo.marcusjaschen.de/Geometries/Polyline.html#page_Segments)
94116
/[polygon](https://phpgeo.marcusjaschen.de/Geometries/Polygon.html#page_Segments),
95117
- [reversing direction](https://phpgeo.marcusjaschen.de/Geometries/Polygon.html#page_Reverse-Direction)
@@ -134,7 +156,9 @@ echo $coordinate1->getDistance($coordinate2, new Vincenty()); // returns 128130.
134156

135157
### Simplifying a polyline
136158

137-
Polylines can be simplified to save storage space or bandwidth. Simplification is done with the [Ramer–Douglas–Peucker algorithm](https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm) (AKA Douglas-Peucker algorithm).
159+
Polylines can be simplified to save storage space or bandwidth. Simplification is done with
160+
the [Ramer–Douglas–Peucker algorithm](https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm) (AKA
161+
Douglas-Peucker algorithm).
138162

139163
```php
140164
<?php
@@ -164,7 +188,8 @@ $simplified = $processor->simplify(1500000);
164188
phpgeo has a polygon implementation which can be used to determinate if a point is contained in it or not.
165189
A polygon consists of at least three points. Points are instances of the `Coordinate` class.
166190

167-
**Warning:** The calculation gives wrong results if the polygons has points on both sides of the 180/-180 degrees meridian.
191+
**Warning:** The calculation gives wrong results if the polygons has points on both sides of the 180/-180 degrees
192+
meridian.
168193

169194
```php
170195
<?php
@@ -255,10 +280,10 @@ Of course, it's possible to use the test runners directly, e.g. for PHPUnit:
255280
./vendor/bin/phpunit
256281
```
257282

258-
Psalm:
283+
PHPStan:
259284

260285
```shell
261-
./vendor/bin/psalm
286+
./vendor/bin/phpstan
262287
```
263288

264289
### Running GitHub Actions locally
@@ -272,8 +297,11 @@ act --rm -P ubuntu-latest=shivammathur/node:latest
272297
## Credits
273298

274299
* Marcus Jaschen <[email protected]> and [all contributors](https://github.com/mjaschen/phpgeo/graphs/contributors)
275-
* [Chris Veness](http://www.movable-type.co.uk/scripts/latlong-vincenty.html) - JavaScript implementation of the [Vincenty formula](http://en.wikipedia.org/wiki/Vincenty%27s_formulae) for distance calculation
276-
* Ersts,P.J., Horning, N., and M. Polin[Internet] Perpendicular Distance Calculator(version 1.2.2) [Documentation](http://biodiversityinformatics.amnh.org/open_source/pdc/documentation.php). American Museum of Natural History, Center for Biodiversity and Conservation. Available from http://biodiversityinformatics.amnh.org/open_source/pdc. Accessed on 2013-07-07.
277-
* W. Randolph Franklin, PNPOLY - Point Inclusion in Polygon Test [Documentation](http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html)
278-
279-
[Psalm]: https://github.com/vimeo/psalm
300+
* [Chris Veness](http://www.movable-type.co.uk/scripts/latlong-vincenty.html) - JavaScript implementation of
301+
the [Vincenty formula](http://en.wikipedia.org/wiki/Vincenty%27s_formulae) for distance calculation
302+
* Ersts,P.J., Horning, N., and M. Polin[Internet] Perpendicular Distance Calculator(version
303+
1.2.2) [Documentation](http://biodiversityinformatics.amnh.org/open_source/pdc/documentation.php). American Museum of
304+
Natural History, Center for Biodiversity and Conservation. Available
305+
from http://biodiversityinformatics.amnh.org/open_source/pdc. Accessed on 2013-07-07.
306+
* W. Randolph Franklin, PNPOLY - Point Inclusion in Polygon
307+
Test [Documentation](http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html)

0 commit comments

Comments
 (0)