Permalink
Browse files

revert features_to_collection.rb back to one that actually works

  • Loading branch information...
1 parent 7fc4e34 commit 7cc2b77bb3e9fe4297aaa9c4d260b6af919b56d3 @thedatachef thedatachef committed Aug 19, 2011
Showing with 8 additions and 2 deletions.
  1. +8 −2 bin/features_to_collection.rb
View
10 bin/features_to_collection.rb
@@ -1,3 +1,9 @@
#!/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.