You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A polygon is provided as an array of points, which is in geojson format. wicket.wrtie() incorrectly returns a POINT( ... ) rather than a POLYGON ( ... )
This is because the above statement turns coords into a string.
So from "coordinates" : [ [ [x,y], [x,y], ... ] ]
into "coordinates" : "x,y,x,y,x,y,...".
This is an invalid format and should rather be "coordinates": "[[[x,y],[x, ],... ]]", however a POINT ( ... ) is still returned as if it was correct notation
Thus the stringified version of coords is invalid, but unfortunately is the result of the syntax shown above and is expected. Ideally the invalid syntax should be handled and simply thrown as is done with other invalid cases.
Using JSON.stringify is the solution and correct way of stringifying arrays.
The text was updated successfully, but these errors were encountered:
A polygon is provided as an array of points, which is in geojson format.
wicket.wrtie()
incorrectly returns aPOINT( ... )
rather than aPOLYGON ( ... )
This is because the above statement turns
coords
into a string.So from
"coordinates" : [ [ [x,y], [x,y], ... ] ]
into
"coordinates" : "x,y,x,y,x,y,..."
.This is an invalid format and should rather be
"coordinates": "[[[x,y],[x, ],... ]]"
, however aPOINT ( ... )
is still returned as if it was correct notationThus the stringified version of
coords
is invalid, but unfortunately is the result of the syntax shown above and is expected.Ideally the invalid syntax should be handled and simply
thrown
as is done with other invalid cases.Using
JSON.stringify
is the solution and correct way of stringifying arrays.The text was updated successfully, but these errors were encountered: