-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
forceCreate
arg not usable when creating new Polygon from JSON coordinates
field
#5
Comments
Lines 129 to 142 in facd8fb
|
Yes, using the original example data, I have tried the following geoPHP::load(json_decode($json, true), 'json', ['forceCreate' => true]; but it did not change anything. |
Both OGC specification and GeoJSON specification requires polygon rings to be closed, but I don't think Twitter has any developers left who can fix this :) Extra arguments of I think we should add a static option to geoPHP class, e.g. |
That sounds like a non-trivial amount of work that I doubt is high on anyone's priority list, so I will just keep tabs on this issue to see if anyone else runs into this like I did and if they came up with a solution. |
What could be a good stop-gap in the meantime though is having the ability to configure per-type options and pass them through the geoPHP::load(
json_decode($json, true),
'json',
[
'typeArgs' => {
'Polygon' => [
'forceCreate' => true,
],
],
],
); |
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.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 fromgeoPHP::load
.The text was updated successfully, but these errors were encountered: