Skip to content

Commit

Permalink
revert features_to_collection.rb back to one that actually works
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Perkins committed Aug 19, 2011
1 parent 7fc4e34 commit 7cc2b77
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bin/features_to_collection.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,9 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
features = ARGV[0].nil? ? STDIN.read.split("\n") : File.read(ARGV[0])
puts "{'type':'FeatureCollection','features':[#{features.map { |geojson| geojson.strip}.join(',')}]}"
collection = "{\"type\":\"FeatureCollection\", \"features\":["
features = []
$stdin.each{|feature| features << feature.strip }
collection += features.join(",")
collection += "]}"
puts collection

0 comments on commit 7cc2b77

Please sign in to comment.