Parse JSON and GeoJSON Files

Combining GeoJSON and JSON data together

by J. Albert Bowden

JavaScript

var json1 = '{ "type": "Feature", "properties": { "FIPS": "19119", "COUNTY": "Lyon", "attributes": {"population": "95000", "cropAcres": "204560", "malePop": "47034"} } }';
var json2 = '{ "type": "Polygon", "coordinates": [[-96.599154418445536, 43.500333547026258],[-96.58646743128935, 43.500300486630792]]}';

var myObject = {
    json1: JSON.parse(json1),
    json2: JSON.parse(json2)
}

console.log(JSON.stringify(myObject));