承接 longitude-one/wkt-parser 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

longitude-one/wkt-parser

最新稳定版本:3.0.0

Composer 安装命令:

composer require longitude-one/wkt-parser

包简介

Parser for well-known text (WKT) object strings

README 文档

README

longitude-one/wkt-parser Stable release Packagist License

Lexer and parser library for 2D, 3D, and 4D WKT/EWKT spatial object strings.

PHP CI Maintainability Test Coverage Coverage Status Minimum PHP Version

CI Downloads

Note

This package is the continuation of the now abandoned creof/wkt-parser package.

Installation

composer require longitude-one/wkt-parser

Usage

There are two use patterns for the parser. The value to be parsed can be passed into the constructor, then parse() called on the returned Parser object:

$input = 'POLYGON((0 0,10 0,10 10,0 10,0 0))';

$parser = new Parser($input);

$value = $parser->parse();

If many values need to be parsed, a single Parser instance can be used:

$input1 = 'POLYGON((0 0,10 0,10 10,0 10,0 0))';
$input2 = 'POINT(0,0)';

$parser = new Parser();

$value1 = $parser->parse($input1);
$value2 = $parser->parse($input2);

Return

The parser will return an array with the keys type, value, srid, and dimension.

  • type string, the spatial object type (POINT, LINESTRING, etc.) without any dimension.
  • value array, contains integer or float values for points, or nested arrays containing these based on spatial object type.
  • srid integer, the SRID if EWKT value was parsed, null otherwise.
  • dimension string, will contain Z, M, or ZM for the respective 3D and 4D objects, null otherwise.

Exceptions

The Lexer and Parser will throw exceptions implementing interface LongitudeOne\Geo\WKT\Exception\ExceptionInterface.

统计信息

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

GitHub 信息

  • Stars: 9
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

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