PHPackages                             simonschaufi/php-libkml - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. simonschaufi/php-libkml

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

simonschaufi/php-libkml
=======================

A library to manipulate KML/KMZ files

v1.0.1(2y ago)308.7k↓21.7%11[2 issues](https://github.com/simonschaufi/php-libkml/issues)[4 PRs](https://github.com/simonschaufi/php-libkml/pulls)GPL-3.0PHPPHP ^7.4 || ^8.0CI passing

Since Feb 22Pushed 5mo ago4 watchersCompare

[ Source](https://github.com/simonschaufi/php-libkml)[ Packagist](https://packagist.org/packages/simonschaufi/php-libkml)[ Docs](https://github.com/simonschaufi/php-libkml)[ Fund](https://www.paypal.me/simonschaufi/10)[ GitHub Sponsors](https://github.com/simonschaufi)[ RSS](/packages/simonschaufi-php-libkml/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (2)Dependencies (13)Versions (8)Used By (0)

PHP KML parser
==============

[](#php-kml-parser)

[![Donate](https://camo.githubusercontent.com/604e3db9c8751116b3f765aad0353ec7ded655bbe8aaacbc38d8c4a6b784b3ed/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d50617950616c2d677265656e2e737667)](https://www.paypal.me/simonschaufi/10)[![Latest Version on Packagist](https://camo.githubusercontent.com/5fc0210bd6daae51f4c9776abfe4e1283e803b456d27a8bcb7ee9a744c9548de/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696d6f6e736368617566692f7068702d6c69626b6d6c2e737667)](https://packagist.org/packages/simonschaufi/php-libkml)[![GitHub Tests Action Status](https://camo.githubusercontent.com/007c00c486ce3930c0a97fc787b4b44b22eee2e69a6899b09a27865ef3ddbd42/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73696d6f6e736368617566692f7068702d6c69626b6d6c2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473)](https://github.com/simonschaufi/php-libkml/actions?query=workflow%3Arun-tests+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/e05ae1b965fc06c8769e3924d4278001fd4c8fd9689c81bb3919e2f02e6ff528/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73696d6f6e736368617566692f7068702d6c69626b6d6c2e737667)](https://packagist.org/packages/simonschaufi/php-libkml)[![License](https://camo.githubusercontent.com/5e6470a28a6755194a26c3cecaf20bf3fa58adf311c213d3b9c25e7f5f45148e/68747470733a2f2f706f7365722e707567782e6f72672f73696d6f6e736368617566692f7068702d6c69626b6d6c2f6c6963656e7365)](https://packagist.org/packages/simonschaufi/php-libkml)

A php library to parse KML/KMZ files.

php-libKML maps KML/KMZ data into PHP objects that follow the KML specification. The purpose of the library is to create KML file from code, parse KML files and convert to another format maintaining the complete KML information.

Features
--------

[](#features)

- KML schema version 2.2
- PHP 7.4+
- Composer integration
- Object oriented design
- Comprehensive KML model
- Import
    - KML

Future features:

- Google extensions support
- Import
    - KMZ
    - GeoJson
- Export
    - KML/KMZ
    - GeoJson
    - WKT

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require simonschaufi/php-libkml
```

Usage
-----

[](#usage)

```
$kmlReader = new KmlReader();
$kmlDocument = $kmlReader->fromString($kml);
// or
$kmlDocument = $kmlReader->fromKmlFile($kmlFilePath);
```

Contributing
------------

[](#contributing)

**Pull Requests** are gladly welcome!

Please remember to add an issue and connect it to your pull requests. It is very helpful to understand what kind of issue the PR is going to solve.

Bugfixes:

Please describe what kind of bug your fix solves and give us feedback on how to reproduce the issue. We're going to accept only bugfixes if we can reproduce the issue.

Execute unit tests:

```
composer local:tests:unit
```

Execute acceptance tests:

```
composer local:tests:acceptance
```

Credits
-------

[](#credits)

- [Simon Schaufelberger](https://github.com/simonschaufi)
- [All Contributors](../../graphs/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance48

Moderate activity, may be stable

Popularity37

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

2

Last Release

861d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/941794?v=4)[Simon Schaufelberger](/maintainers/simonschaufi)[@simonschaufi](https://github.com/simonschaufi)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (168 commits)")[![earelin](https://avatars.githubusercontent.com/u/1623784?v=4)](https://github.com/earelin "earelin (52 commits)")[![simonschaufi](https://avatars.githubusercontent.com/u/941794?v=4)](https://github.com/simonschaufi "simonschaufi (18 commits)")[![actions-user](https://avatars.githubusercontent.com/u/65916846?v=4)](https://github.com/actions-user "actions-user (1 commits)")[![yariksheptykin](https://avatars.githubusercontent.com/u/636846?v=4)](https://github.com/yariksheptykin "yariksheptykin (1 commits)")

---

Tags

geojsonkmlphpgiskml

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/simonschaufi-php-libkml/health.svg)

```
[![Health](https://phpackages.com/badges/simonschaufi-php-libkml/health.svg)](https://phpackages.com/packages/simonschaufi-php-libkml)
```

###  Alternatives

[mjaschen/phpgeo

Simple Yet Powerful Geo Library

1.6k9.3M28](/packages/mjaschen-phpgeo)[brick/geo

GIS geometry library

2501.3M21](/packages/brick-geo)[funiq/geophp

Open-source native PHP library for doing geometry operations. Can read and write a wide variety of formats: (E)WKT, (E)WKB, TWKB, GeoJSON, KML, GPX, GeoRSS. Works with all Simple-Feature geometries (Point, LineString, Polygon...) and can be used to get centroids, bounding-boxes, area, etc.

22117.8k1](/packages/funiq-geophp)[clickstorm/go-maps-ext

Google Maps Extension. Simply insert a google map Version 3 without jQuery, calculate a route, images for markers, style maps, KML, categories, responsive and many more.

24170.5k3](/packages/clickstorm-go-maps-ext)[markbaker/quadtrees

QuadTree implementation in PHP

1740.3k](/packages/markbaker-quadtrees)[ricklab/location

A library of PHP objects for spatial calculations

1635.3k](/packages/ricklab-location)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
