Open
Description
It seems as though, after attempting to use this fork to parse Twitter API GeoJSON data from this page (which parses fine in the original version of geoPHP), I am unable to use it for my use case. The coordinates
in the example below are ripped directly from the Twitter API docs.
$json = "{
\"coordinates\": [
[
[-74.026675, 40.683935],
[-74.026675, 40.877483],
[-73.910408, 40.877483],
[-73.910408, 40.3935]
]
],
\"type\": \"Polygon\"
}";
geoPHP::load(json_decode($json, true), 'json'); // <= This throws and exception with 'Cannot create Polygon: contains non-closed ring'
My understanding of the new Polygon
class is that the constructor allows passing of a param 'forceCreate' => true
to allow the Polygon to resolve itself to the start point, however there is no way to pass this arg through from geoPHP::load
.
Metadata
Assignees
Labels
No labels
Activity