longitude-one/wkb-parser
Composer 安装命令:
composer require longitude-one/wkb-parser
包简介
Parser for well-known binary (WKB/EWKB) object data
README 文档
README
Parser library for 2D, 3D, and 4D Open Geospatial Consortium (OGC) WKB or PostGIS EWKB spatial object data.
Note
This package is the continuation of the now abandoned creof/wkt-parser package.
Installation
composer require longitude-one/wkb-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:
$parser = new Parser($input); $value = $parser->parse();
If many values need to be parsed, a single Parser instance can be used:
$parser = new Parser(); $value1 = $parser->parse($input1); $value2 = $parser->parse($input2);
Input value
Encoding
The parser currently supports 3 WKB encodings:
- OGC v1.1
- OGC v1.2
- PostGIS EWKB
Format
The parser supports a number of input formats:
- Binary string (as returned from database or
pack('H*', $hexString)) - Bare hexadecimal text string (
'01010000003D0AD7A3.....') - Hexadecimal test string prepended with
x,X,0x, or0X('0x01010000003D0AD7A3.....', etc.)
Return
The parser will return an array with the keys type, value, srid, and dimension.
typestring, the uppercase spatial object type (POINT,LINESTRING, etc.) without any dimension.valuearray, contains integer or float values for points, nested arrays containing these based on spatial object type, or empty array for EMPTY geometry.sridinteger, the SRID if present in EWKB value,nullotherwise.dimensionstring, will containZ,M, orZMfor the respective 3D and 4D objects,nullotherwise.
Exceptions
The Reader and Parser will throw exceptions implementing interface CrEOF\Geo\WKB\Exception\ExceptionInterface.
References
- PostGIS EWKB - https://github.com/postgis/postgis/blob/master/doc/ZMSgeoms.txt
- OGC Simple Feature Access, Part 1 - http://www.opengeospatial.org/standards/sfa
- OGC Simple Feature Access, Part 2 - http://www.opengeospatial.org/standards/sfs
longitude-one/wkb-parser 适用场景与选型建议
longitude-one/wkb-parser 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 697.21k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2024 年 04 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「geometry」 「text」 「parser」 「geography」 「string」 「spatial」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 longitude-one/wkb-parser 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 longitude-one/wkb-parser 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 longitude-one/wkb-parser 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Texy converts plain text in easy to read Texy syntax into structurally valid (X)HTML. It supports adding of images, links, nested lists, tables and has full support for CSS. Texy supports hyphenation of long words (which reflects language rules), clickable emails and URL (emails are obfuscated again
Easy to use SDK with grabber for multiple platforms at once like YouTube, Dailymotion, Facebook and more.
An MT940 bank statement parser for PHP
Common libraries used by Zimbra Api
Geo-related tools PHP 7.3+ library
Laravel integration for the jsonapi.org parser
统计信息
- 总下载量: 697.21k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 36
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-04-01