Skip to content

Instantly share code, notes, and snippets.

@brunobord
Created April 3, 2014 19:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brunobord/9961581 to your computer and use it in GitHub Desktop.
Save brunobord/9961581 to your computer and use it in GitHub Desktop.
import random
import json
places = []
for x in range(1000): # your choice here
places.append({
"name": "place %d" % x,
"lat": random.randint(-80, 80) + random.random(),
"lon": random.randint(-180, 180) + random.random(),
"address": "Fake address",
"type": "random",
"url": "http://example.com",
"power": {"available": random.choice((True, False))},
"wifi": {"available": random.choice((True, False))}
})
json.dump({'places': places}, open('locations/paris.json', 'w'), indent=4)
# to display this, I've changed the Paris defaultZoom to "1".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment