Skip to content

Missing buffer style support for Pdo Engine #58

@TimmyBravo

Description

@TimmyBravo

I recently started using this package in a project where I need to use the buffer method from the geometry engine in order to change the size of a MultiPolygon. Doing this with the default settings using Postgres with PostGIS resulted in unwanted rounded corners. It's possible to fix this using the "buffer_style_parameters" of PostGIS but the buffer method on the PdoEngine doesn't support this. I was also unable to extend the PdoEngine in order to implement this since it's final and the queryGeometry-method is protected which results in being unable to access that directly. I could extend the DatabaseEngine but I'd prefer not to in order to keep your functionality of the PdoEngine in order to make sure everything works in future updates etc.

I was able to work around this for now by creating a reflection class and making queryGeometry accessible but would like added support for these parameters if possible

$refClass = new ReflectionClass(self::getGeometryEngine());
$method = $refClass->getMethod('queryGeometry');

$params = 'endcap=square join=mitre mitre_limit=5.0 quad_segs=1';
$buffered = $method->invoke(self::getGeometryEngine(), 'ST_Buffer', $polygon, -$buffer, $params);

I looked into adding this functionality in order to create a pull request myself but am not sure how you guys want to do this since the different databases support them differently. GEOS and geosop doesn't currently support this so it can only be added to the DatabaseEngine as of now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions