Issue with parsing the coordinates in array format
See original GitHub issueThe main assumption of the data is to be like:
var data = [
{ name: 'Location A', category: 'Store', street: 'Market', lat: 39.984, lng: -75.343 },
{ name: 'Location B', category: 'House', street: 'Broad', lat: 39.284, lng: -75.833 },
{ name: 'Location C', category: 'Office', street: 'South', lat: 39.123, lng: -74.534 }
];
when the coordinates are within an array as below, the generated GeoJSON is not valid:
var data = [
{ name: 'Location A', category: 'Store', street: 'Market', coordinates: [39.984, -75.343] },
{ name: 'Location B', category: 'House', street: 'Broad', coordinates: [39.284, -75.833] },
{ name: 'Location C', category: 'Office', street: 'South', coordinates: [39.123, -74.534] }
];
I tried to parse the above-mentioned dataset as below and it didn’t work either:
GeoJSON.parse(data, {Point: ['coordinates']});
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
parsing an array of an array of coordinates · Issue #22 - GitHub
I am trying to figure out how to parse an array of an array of coordinates, and have tried going through the section...
Read more >Parsing array of objects to format data - Stack Overflow
I want to parse the coordinates position to get a more scalable object and get its properties nesting. This is what I've tried:...
Read more >Solved: Parse JSON Help - Power Platform Community
I'm able to access all parameters just fine EXCEPT for the latitude and longitude "locked up" in the geometry/coordinates array:
Read more >Parse a cell array of strings without looping - MATLAB Answers
I need to parse each string to separate the coordinates, convert the coordinates to numbers, do an operation on them, then put them...
Read more >JSON functions | BigQuery - Google Cloud
JSON_QUERY, Extracts a JSON value, such as an array or object, or a JSON scalar value, such as a string, number, or boolean....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same 😦
Fixed in #39