Open david-faith opened 8 years ago
Edit: This workaround seems to do the trick:
$geos_geometry = $geo->geos(); //GEOSGeometry
$geos_POS = $geos_geometry->pointOnSurface(); //GEOSGeometry
$geos_POS->isEmpty(); //false
$geos_POS->getX(); //-73.932666589981
$geos_POS->getY(); //40.85405746088
That is because it seems the function is overriden in the Collection class. Had the same issue, and I commented line 310 in lib/geometry/Collection.php:
public function pointOnSurface() { return NULL; }
and it works fine now.
@david-faith where does the $geo
variable come form
Using geoPHP with geos installed. pointOnSurface() for a valid polygon always returns null. While other functions such as centroid() work fine.
Example:
I'm wondering if anyone else has this problem (or I'm missing something)?