Decoding fails on multidimensional array
mikejcorey opened this issue · 2 comments
I'm running into problems decoding a GeoJSON string that as far as I can tell is valid JSON.
Here's the full JSON string I'm sending to the decoder:
{"type":"FeatureCollection","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::3857"}},"features":[{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-13483771.9163,4699077.70459],[-13485123.1123,4700163.02188],[-13490514.2039,4696563.11539],[-13483771.9163,4699077.70459]]]},"properties":{"id":"057","name":"Nevada"}}]}
The problem comes in the "coordinates" field, which is a multidimensional array of points. When I decode the JSON, the coordinates field is returned as the following string:
-13483771.9163,4699077.70459,-13485123.1123,4700163.02188,-13490514.2039,4696563.11539,-13483771.9163,4699077.70459
Any ideas?
Thanks much!
I'll check it out when I have a moment. Thanks for the report.
It looks like it's being parsed properly from what I can see.
An array, when converted to a string, is converted to comma separated values, and this effect is recursive, so this...
trace([["a","b"].["c","d"]])
Appears to be this...
a,b,c,d
Try using encodeJson to convert it back to JSON to make sure.