geo-io / wkb-generator
Well-known binary (WKB) Generator.
Installs: 4 688
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.3
- geo-io/interface: ~1.0
Requires (Dev)
- mockery/mockery: ~0.9.0
README
Generates Well-known binary (WKB) representations from geometric objects.
class MyExtractor implements GeoIO\Extractor { public function extractType($geometry) { if ($geometry instanceof MyPoint) { return self::TYPE_POINT; } // ... } public function extractCoordinatesFromPoint($point) { return array( 'x' => $point->getX(), 'y' => $point->getY(), 'z' => null, 'm' => null, ); } // ... } $extractor = MyExtractor(); $generator = new GeoIO\WKB\Generator\Generator($extractor, array( 'hex' => true )); echo $generator->generate(new MyPoint(1, 2)); // Outputs: // 0101000000000000000000f03f0000000000000040
Installation
Install through composer. Check the packagist page for all available versions.
composer require geo-io/wkb-generator
License
Copyright (c) 2014-2022 Jan Sorgalla. Released under the MIT License.