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. simonschaufi/php-libkml

ActiveLibrary

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

A library to manipulate KML/KMZ files

v1.0.1(2y ago)307.2k↓37.5%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 3mo 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 1mo 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

42

—

FairBetter than 90% of packages

Maintenance52

Moderate activity, may be stable

Popularity36

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

815d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/851921f03d132288119a99dba83e85abc620f3f896f8baaf1e5d107955064dfa?d=identicon)[simonschaufi](/maintainers/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.6k8.6M22](/packages/mjaschen-phpgeo)[martin-georgiev/postgresql-for-doctrine

Extends Doctrine with native PostgreSQL support for arrays, JSONB, ranges, PostGIS geometries, text search, ltree, uuid, and 100+ PostgreSQL-specific functions.

4485.3M4](/packages/martin-georgiev-postgresql-for-doctrine)[creof/doctrine2-spatial

Doctrine2 multi-platform support for spatial types and functions

2763.3M11](/packages/creof-doctrine2-spatial)[jsor/doctrine-postgis

Spatial and Geographic Data with PostGIS and Doctrine.

2191.6M1](/packages/jsor-doctrine-postgis)[brick/geo

GIS geometry library

245862.1k15](/packages/brick-geo)[longitude-one/doctrine-spatial

Doctrine multi-platform support for spatial types and functions, compliant with Doctrine 2.19, 3.1, and dev ones (3.2 and 4.0).

891.4M1](/packages/longitude-one-doctrine-spatial)

PHPackages © 2026

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