 parser = new xml2js.Parser()
 
 parser.addListener 'end', (result) ->
+    # Define the mongoose schema
     Camera = new mongoose.Schema
         name: String
         url: String

            x: Number
            y: Number
    Camera.index loc: '2d'
    mongoose.model 'Camera', Camera
    CameraModel = mongoose.model 'Camera'
    mongoose.connect 'mongodb://localhost/cams'

    _(result.Document.Folder.Placemark).each (placemark, i) ->
        url = URL.parse placemark.description.split('"')[3]
        coords = placemark.Point.coordinates.split ','


Error: #{err}"""

    console.log "If you haven't seen any errors, we've probably been successful."

fs.readFile 'data/raw/trafficcameraswithfeed.kml', (err, data) ->
    parser.parseString data
