定制 stepandalecky/kml-parser 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

stepandalecky/kml-parser

最新稳定版本:v0.2.2

Composer 安装命令:

composer require stepandalecky/kml-parser

包简介

Turn KML file into objects

README 文档

README

Latest Stable Version License

The most intuitive KML parser. Each part of the file is represented by a special class, so everything you need is accessible via predictable and hinted methods.

Installation

Using composer:

composer require stepandalecky/kml-parser 

Usage

A simple example, how to use the parser:

<?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2" id="test"> <Document> <name>Document name</name> <description>Description</description> <Style id="icon-1899-0288D1-normal"> # ... </Style> <Style id="icon-1899-0288D1-highlight"> # ... </Style> <StyleMap id="icon-1899-0288D1"> # ... </StyleMap> <Folder> <name>Unnamed layer</name> # ... </Folder> </Document> </kml> 
use StepanDalecky\KmlParser\Parser; $parser = Parser::fromFile('file.xml'); // $parser = Parser::fromString($xmlString); $kml = $parser->getKml(); $document = $kml->getDocument(); $styles = $document->getStyles(); echo $styles[0]->getId(); // icon-1899-0288D1-normal $folders = $document->getFolders(); echo $folders[0]->getName(); // Unnamed layer 

For more examples see the tests.

Unsupported KML Elements?

Custom development of this library is not planned anymore. There are two ways to deal with elements that have not been covered yet:

  1. Fork this library, add elements you need and create a merge request back to this library.
  2. Use emergency method Entity::getElement().

统计信息

  • 总下载量: 29.22k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固