Download the PHP package hular369/geo-shapify without Composer
On this page you can find all versions of the php package hular369/geo-shapify. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hular369/geo-shapify
More information about hular369/geo-shapify
Files in hular369/geo-shapify
Package geo-shapify
Short Description A PHP library that allows to check if a coordinate(lat,long) is inside or outside of a circle or a polygon, calculate area occupied by a polygon/circle, and find out the nearest vertex of a polygon from a given point.
License MIT
Informations about the package geo-shapify
A PHP library that allows to check if a coordinate(lat,long) is inside or outside of a circle or a country or a polygon or a circle.
This package enables you to check if a coordinate is inside a defined boundary of a country or a polygon. It also provides a feature to calculate the area of a given boundary defined by a country or a polygon coordinates (latitude, longitude), and also for circles.
Features
-
Country Boundaries:
- Check if a coordinate is inside a country.
- Determine which boundary coordinate is nearest to a given point(lat, long),
- Calculate the area of a country.
-
Polygon Boundaries:
- Check if a coordinate is inside a polygon.
- Calculate the area of a polygon.
- Circular Boundaries:
- Check if a coordinate is inside a circle defined by a center and radius.
- Calculate the area of a circle.
Usage
For Countries and Polygons:
- Define the polygon coordinates.
- Create a polygon shape using
ShapeFactory. - Check if a coordinate is inside the polygon using
contains. - Calculate the area of the polygon using
area.
For Circles:
- Create a circle shape using
ShapeFactorywith center coordinates and radius. - Check if a coordinate is inside the circle using
contains. - Calculate the area of the circle using
area.
This package enables you to check if a coordinate is inside a defined boundary of a polygon. It also facilitates with a feature to calculate area of a given boundary defined by polygon coordinates (Lat,long).
To work features on countries, you can implement as follows:
To create and work with polygons, you can use the ShapeFactory class as follows:
For circles:
;