Download the PHP package phdevutils/geo without Composer

On this page you can find all versions of the php package phdevutils/geo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package geo

phdevutils/geo

Packagist Version

Philippine geo utilities for PHP — a representative coordinate for every PSGC city/municipality plus haversine distance, nearest-city, and within-radius helpers. PHP companion to the npm package @ph-dev-utils/geo.

Coordinates are keyed by the same 6-digit PSGC cityMunCode as phdevutils/core, so they join cleanly.

Quick start

API

Method Returns
Geo::listCoords($filter = []) array of coordinates — filter by region and/or province (null matches NCR / independent cities)
Geo::findCoord($query) coordinate array or null — by 6-digit PSGC code or city name ("City of X" / "X City" tolerant)
Geo::distanceKm($a, $b) float or null — great-circle km; each arg is ['lat'=>,'lng'=>] or a code/name
Geo::nearestCity($point, $n = 1) arrayn nearest, nearest first (each with distanceKm)
Geo::withinRadiusKm($point, $km) array — all within $km, nearest first
Geo::meta() array — provenance + license note for the bundled data

Each coordinate array: cityMunCode (6-digit PSGC), name, province (4-digit code or null for NCR / independent cities), region (2-digit code), lat (float), lng (float), points (int — GeoNames postal points averaged into the centroid). nearestCity / withinRadiusKm results add a distanceKm (float) key.

A point argument is either a ['lat' => float, 'lng' => float] array or a string PSGC code / city name resolvable via Geo::findCoord.

Data & disclaimer

Each coordinate is a representative point — the mean of the GeoNames postal-code points that map to the city/municipality — intended for distance/proximity work. It is not an official PSA centroid or a survey-grade location. Coordinates are derived from the GeoNames Philippines postal dump (CC BY 4.0); the ZIP → cityMunCode join is reused from phdevutils/postal and names/provinces/regions from the PSA Q4 2024 PSGC. See the NOTICE file for attribution.

License

MIT. Bundled coordinate data © GeoNames, CC BY 4.0.


All versions of geo with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package phdevutils/geo contains the following files

Loading the files please wait ...