Download the PHP package ligorikus/h3-php without Composer
On this page you can find all versions of the php package ligorikus/h3-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ligorikus/h3-php
More information about ligorikus/h3-php
Files in ligorikus/h3-php
Package h3-php
Short Description Pure PHP implementation of H3 geospatial indexing system
License Apache-2.0
Informations about the package h3-php
h3-php
Pure PHP implementation of H3 - Uber's hexagonal hierarchical geospatial indexing system.
Installation
Requirements
- PHP 8.2+
Development Approach
The library's implementation is developed without large language models (LLMs). LLMs are used only for documentation and writing tests.
Development
Use PHP 8.2.27 or newer to run the development tools. Composer resolves the locked dependencies against PHP 8.2.27 so they also install on PHP 8.2.
CI checks the following compatible combinations:
| PHP | PHPUnit |
|---|---|
| 8.2 | 11 |
| 8.3 | 11, 12 |
| 8.4 | 11, 12, 13 |
| 8.5 | 11, 12, 13 |
The matrix resolves dependencies for each actual PHP version. A separate PHP 8.2
job validates and installs composer.lock, audits dependencies, runs tests,
PHPStan, and Psalm.
Quick Start
H3::cellToLatLng(int $h3): LatLng returns the center of an H3 cell as a
LatLng object. getLat() and getLng() return coordinates in degrees.
The cell center may differ from the coordinates originally passed to latLngToCell.
H3 indexes are passed as integers; use hexdec('89283082803ffff') to convert a
hexadecimal H3 index string before calling cellToLatLng.
API implementation status
Functions are grouped and ordered as in the official H3 4.x API reference, including experimental functions and C memory-management helpers.
๐ข Implemented ยท ๐ด Not implemented
Status refers to the API exposed by H3\H3. Low-level helpers such as
H3Modification::h3GetResolution() and H3Modification::h3GetIndexDigit()
are available internally but do not expose the corresponding official API methods.
Indexing
[Official documentation](https://h3geo.org/docs/api/indexing/) - ๐ข `latLngToCell` - ๐ข `cellToLatLng` - ๐ด `cellToBoundary`Inspection
[Official documentation](https://h3geo.org/docs/api/inspection/) - ๐ด `getResolution` - ๐ด `getBaseCellNumber` - ๐ด `getIndexDigit` - ๐ด `constructCell` - ๐ด `stringToH3` - ๐ด `h3ToString` - ๐ด `isValidCell` - ๐ด `isValidIndex` - ๐ด `isResClassIII` - ๐ด `isPentagon` - ๐ด `getIcosahedronFaces` - ๐ด `maxFaceCount`Traversal
[Official documentation](https://h3geo.org/docs/api/traversal/) - ๐ด `gridDistance` - ๐ด `gridRing` - ๐ด `gridRingUnsafe` - ๐ด `maxGridRingSize` - ๐ด `gridDisk` - ๐ด `maxGridDiskSize` - ๐ด `gridDiskDistances` - ๐ด `gridDiskUnsafe` - ๐ด `gridDiskDistancesUnsafe` - ๐ด `gridDiskDistancesSafe` - ๐ด `gridDisksUnsafe` - ๐ด `gridPathCells` - ๐ด `gridPathCellsSize` - ๐ด `cellToLocalIj` - ๐ด `localIjToCell`Hierarchy
[Official documentation](https://h3geo.org/docs/api/hierarchy/) - ๐ด `cellToParent` - ๐ด `cellToChildren` - ๐ด `cellToChildrenSize` - ๐ด `cellToCenterChild` - ๐ด `cellToChildPos` - ๐ด `childPosToCell` - ๐ด `compactCells` - ๐ด `uncompactCells` - ๐ด `uncompactCellsSize`Regions
[Official documentation](https://h3geo.org/docs/api/regions/) - ๐ด `polygonToCells` - ๐ด `maxPolygonToCellsSize` - ๐ด `polygonToCellsExperimental` - ๐ด `maxPolygonToCellsSizeExperimental` - ๐ด `cellsToLinkedMultiPolygon` / `cellsToMultiPolygon` - ๐ด `destroyLinkedMultiPolygon`Directed edges
[Official documentation](https://h3geo.org/docs/api/uniedge/) - ๐ด `areNeighborCells` - ๐ด `cellsToDirectedEdge` - ๐ด `isValidDirectedEdge` - ๐ด `getDirectedEdgeOrigin` - ๐ด `getDirectedEdgeDestination` - ๐ด `directedEdgeToCells` - ๐ด `originToDirectedEdges` - ๐ด `directedEdgeToBoundary` - ๐ด `reverseDirectedEdge`Vertexes
[Official documentation](https://h3geo.org/docs/api/vertex/) - ๐ด `cellToVertex` - ๐ด `cellToVertexes` - ๐ด `vertexToLatLng` - ๐ด `isValidVertex`Miscellaneous
[Official documentation](https://h3geo.org/docs/api/misc/) - ๐ด `degsToRads` - ๐ด `radsToDegs` - ๐ด `getHexagonAreaAvgKm2` - ๐ด `getHexagonAreaAvgM2` - ๐ด `cellAreaRads2` - ๐ด `cellAreaKm2` - ๐ด `cellAreaM2` - ๐ด `getHexagonEdgeLengthAvgKm` - ๐ด `getHexagonEdgeLengthAvgM` - ๐ด `edgeLengthKm` - ๐ด `edgeLengthM` - ๐ด `edgeLengthRads` - ๐ด `getNumCells` - ๐ด `getRes0Cells` - ๐ด `res0CellCount` - ๐ด `getPentagons` - ๐ด `pentagonCount` - ๐ด `greatCircleDistanceKm` - ๐ด `greatCircleDistanceM` - ๐ด `greatCircleDistanceRads` - ๐ด `describeH3Error`License
Apache License 2.0 - see LICENSE