diff --git a/README.md b/README.md index 963726e..fa2af16 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ In short: ## Device message converter script -converts messages to **JSON, KML, GPX, GEOJSON, CSV** +Converts messages to **KML, GPX, GEOJSON, CSV** * [NodeJS](message-converter/nodejs) * [Python](message-converter/python) diff --git a/message-converter/README.md b/message-converter/README.md new file mode 100644 index 0000000..528f473 --- /dev/null +++ b/message-converter/README.md @@ -0,0 +1,6 @@ +# Device message converter script + +Converts messages to **KML, GPX, GEOJSON, CSV** + +* [NodeJS](message-converter/nodejs) +* [Python](message-converter/python) diff --git a/message-converter/nodejs/README.md b/message-converter/nodejs/README.md index bfc112f..cd83222 100644 --- a/message-converter/nodejs/README.md +++ b/message-converter/nodejs/README.md @@ -1,6 +1,6 @@ # message converter -Script to convert flespi device messages to **JSON, KML, GPX, GEOJSON, CSV** formats +Script to convert flespi device messages to **KML, GPX, GEOJSON, CSV** formats ## Install the dependencies ```bash diff --git a/message-converter/python/README.md b/message-converter/python/README.md index 85e4eda..e262689 100644 --- a/message-converter/python/README.md +++ b/message-converter/python/README.md @@ -1,6 +1,6 @@ # message converter -Script to convert flespi device messages to **JSON, KML, GPX, GEOJSON, CSV** formats +Script to convert flespi device messages to **KML, GPX, GEOJSON, CSV** formats ### Run script ```bash diff --git a/message-converter/python/convert.py b/message-converter/python/convert.py index 5c0c2ae..545eacb 100644 --- a/message-converter/python/convert.py +++ b/message-converter/python/convert.py @@ -3,8 +3,6 @@ import sys import time from datetime import datetime -from xml.etree.ElementTree import Element, SubElement, tostring -from xml.dom import minidom def main(): # Read command line arguments @@ -58,8 +56,8 @@ def convert_kml(data, device_id, from_timestamp, to_timestamp): #{device_id} - {format_unix_utc(from_timestamp)} - {format_unix_utc(to_timestamp)} + {format_unix_utc(int(from_timestamp))} + {format_unix_utc(int(to_timestamp))} {coordinates}