mjaschen/phpgeo
PHPGeo is a lightweight geospatial library for PHP. Model geographic coordinates (with ellipsoid support) and compute high‑precision distances and related calculations between points. Compatible with modern PHP versions (8.2+ for latest).
This release has no breaking changes.
Thanks, @nilshoerrmann, for contributing!
Bounds::getAsPolygon() which returns a polygon containing the four nodes of the Bounds instanceBounds::getNorthEast() and Bounds::getSouthWest()CardinalDirection::isStrictlyNorth(), CardinalDirection::isStrictlyEast(), CardinalDirection::isStrictlySouth() and CardinalDirection::isStrictlyWest()Direction for checking if one point is north, eat, south or west from another pointIntersection for checking if two geometries intersect each otherDMS and Line classesSimplifyBearing if two consecutive points share the same location, fixes #79.static to self to prevent accidentally calling the constructor with wrong arguments in child classes (Ellipsoid, Line, Polygon, Polyline)simplifyGeometry() methods in SimplifyBearing and SimplifyDouglasPeucker classes (fixes #69).CoordinateFactory emitted a warning if a coordindates string without arc seconds was passed to the fromString() methodWorld␣Geodetic␣System␣␣1984 → World␣Geodetic␣System␣1984 (#49)getIntermediatePoint() to the Line class which calculates an intermediate point on a line by following the Great Circle between the two line ends and dividing the line by the given fraction (0.0 ... 1.0)getMidpoint() to the Line class which calculates the midpoint of a line by following the Great Circle between the two line ends and dividing the line into two halves.Cartesian which abstracts three-dimensional cartesian coordinates x, y, and ztolerance attribute is now protected (SimplifyDouglasPeucker)BoundsFactory to create a bounds instance for a center point and a given distance to the bounds' corners. Thanks @sdennler!PointToLineDistancePointToLineDistance calculates the smallest distance between a point and a linehasSameLocation() checks if two points share the same location (optionally within a distance which defaults to 0.001 m = 1 mm)addUniquePoint adds unique points to a polyline (i.e., points that doesn't already exist in that polyline)getAveragePoint() returns the average value of latitude and longitude values for a polylinePolygon::contains()Polyline can now be retrieved in form of a Bound object.VincentyVincentyCoordinateFactoryBearingEllipsoidal::inverseVincenty().Simplify was removed; alternatives: SimplifyBearing or SimplifyDouglasPeuckerLine objectLine instance (point 1 -> point 2)SimplifyInterface was introduced and is implemented in two classes:
SimplifyDouglasPeucker and SimplifyBearingSimplify processor class is now deprecated and will be removed in the
2.0 release.43° 37.386' N, 070° 12.472' WWarning: Backwards-compatibility-breaking changes (see README for upgrade details)
GeometryLinesInterface for geometries containing lines (Line, Polyline, Polygon)getBounds() method to GeometryInterfaceWarning: Backwards-compatibility-breaking changes
setPoint1() and setPoint2() from Linemaster is now renamed to mainGeometryFactoryInterface::fromString() now has GeometryInterface as return typegetDestination() and getBearingFinal() from DirectVincentyBearinggetDistance(), getBearingInitial() and getBearingFinal() from InverseVincentyBearinggetX(), getY() and getZ() from CartesiangetPoint1() and getPoint2() from LineHow can I help you explore Laravel packages today?