Skip to content

Instantly share code, notes, and snippets.

@cristiangreco
Created July 7, 2015 02:00
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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.
#!/usr/bin/env python
import json
with open("data.geojson") as file:
j = json.load(file)
for feature in j["features"]:
id = feature["id"]
name = "h:" + id[5:]
coords = feature["geometry"]["coordinates"]
print "set " + name + " '" + json.dumps(feature) + "'"
print "geoadd hotels " + str(coords[0]) + " " + str(coords[1]) + " " + name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment