 _ = require 'underscore'
 URL = require 'url'
 mongoose = require 'mongoose'
+util = require 'util'
 
 parser = new xml2js.Parser()
 


    # Parse each Placemark into a mongoose model and save each
    _(result.Document.Folder.Placemark).each (placemark, i) ->
        url = URL.parse placemark.description.split('"')[3]
        coords = placemark.Point.coordinates.split ','



Error: #{err}"""

            if isLast
                CameraModel.count {}, (err, count) ->
                    console.log "Saved #{count} cameras successfully."
                    mongoose.disconnect()

fs.readFile 'data/raw/trafficcameraswithfeed.kml', (err, data) ->
    if err then console.log err else parser.parseString data
