summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/script.py b/script.py
new file mode 100644
index 0000000..9e01e0b
--- /dev/null
+++ b/script.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+
+import os
+import geojson
+
+features = []
+
+
+folder = "html/files"
+for file in os.listdir(folder):
+ print(file)
+ data=file.rsplit('-',3)
+ print(data[1], data[2],data[3])
+ typ = ""
+ if data[3].endswith(".ogg"):
+ typ = "sound"
+ if data[3].endswith(".jpeg"):
+ typ = "image"
+ features.append(geojson.Feature(geometry=geojson.Point((float(data[2]), float(data[1]))), properties={"type": typ,"file": file}))
+
+#dump = geojson.dumps(geojson.FeatureCollection(features), sort_keys=True)
+dump = geojson.dumps(features, sort_keys=True)
+print(dump)
+f = open('html/data.geojson', 'w')
+f.write(dump)
+f.close()
+