geoPHP
geoPHP copied to clipboard
union() not working even for example
Trying to use the union() to combine two polygons. First by following the example:
$poly1 = geoPHP::load('POLYGON((30 10,10 20,20 40,40 40,30 10))','wkt');
$poly2 = geoPHP::load('POLYGON((35 10,10 20,15 40,45 45,35 10),(20 30, 35 35, 30 20, 20 30))','wkt');
$combined_poly = $poly1->union($poly2);
Then the $combined_poly is null after the last line is executed. Please note I take the dollar sign away from geoPHP::load() because the it complained "Class name must be a valid object or a string".
@burkeker, do you have GEOS extensions installed in your environment? The union() method isn't implemented unless you have that library installed.
https://github.com/phayes/geoPHP/wiki/API-Reference#wiki-Methods-2
It would be great that when the extension is not properly installed the library would throw an exception, otherwise it just fails silently
It would be even better if it didn't depend on a library that was impossible to build even now.