-
-
Save rodrigosdo/4187bbe2cc8fe506cf3f2186e44ba89f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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