Friday, 12 May 2017

How to parse large(~400MB) file in Node at one go? String contains JSON object

I am converting Geographical Data from JSON to CSV using NodeJS.

The file contains a huge JSON string representing geographical boundaries. The data is in GeoJSON format.

{
"type": "FeatureCollection",
"df": { "type": "name", "properties": { "name": "" } },

"features": [
{ "type": "Feature", 
"properties": { "OBJECTID_1": 1, "OBJECTID": 1,     "Shape_Area": , "code": "D" }, 
"geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 23.86,     20.99 ], [
.
.
.

I need to parse that "string JSON" into a JSON object so that I can write to a file separated by comma.

Any ideas? how a large string representation of JSON data can be parsed in memory?



via harsh

No comments:

Post a Comment