Skip to content

Instantly share code, notes, and snippets.

@thephw
Last active December 29, 2015 01:49
Show Gist options
  • Save thephw/7595760 to your computer and use it in GitHub Desktop.
Save thephw/7595760 to your computer and use it in GitHub Desktop.
Men's Roller Derby Teams
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
require 'csv'
require 'json'
data = CSV.parse(File.read('mens_derby_ilcs.csv'))
features = data[1..-1].map do |row|
{ geometry: { type: 'Point', coordinates: [row[11],row[10]]}, type: 'Feature', properties: Hash[*data[0].zip(row).flatten]}
end
feature_collection = {type: "FeatureCollection", features: features}
puts feature_collection.to_json
@thephw
Copy link
Author

thephw commented Nov 22, 2013

@sshirokov What does my map hate me?

@thephw
Copy link
Author

thephw commented Nov 22, 2013

Nevermind, I apparently just can't read documentation at 2am.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment