Skip to content

Commit

Permalink
Add example js file for csv output
Browse files Browse the repository at this point in the history
  • Loading branch information
joto committed Jul 15, 2012
1 parent 653e8cc commit c4966b7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions osmjs/js/osm2csv.js
@@ -0,0 +1,20 @@
/*
Osmium Javascript Example
osm2csv.js
run with: osmjs -j osm2csv.js OSMFILE
*/

var out = Osmium.Output.CSV.open('out.csv');

Osmium.Callbacks.node = function() {
out.print(this.id, this.tags['name'], this.tags['note']);
}

Osmium.Callbacks.end = function() {
out.close();
}

0 comments on commit c4966b7

Please sign in to comment.