title: How do I parse a large KML file into JSON
body: <p>I am designing a map application that shows traffic density in areas of Hong Kong. I have to use road segment data from a .kml file I extracted from a .kmz file provided by the Transport Department website.</p>
  
  <p>The data is publicly available and can be found here: <a href="https://data.gov.hk/en-data/dataset/hk-td-tis_15-road-network-v2/resource/aa45b44d-a08b-4638-92d0-1295d815982a" rel="nofollow noreferrer">https://data.gov.hk/en-data/dataset/hk-td-tis_15-road-network-v2/resource/aa45b44d-a08b-4638-92d0-1295d815982a</a></p>
  
  <p>The file is very large, around 500MB.</p>
  
  <p>I am using Node.js to process the data. I just want to extract the street name, the street code and the coordinates of the segment to possibly store in json files named corresponding to each street code. </p>
  
  <p>For example, the json file for the street with the street code 10000 would be 10000.js. Or possibly in the future store that data in a database.</p>
  
  <p>The main problem is that the file is large and I can't store it in memory to parse it with a kml parser.</p>