-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inpath error #2
Comments
Hola. En el paso 2 ejecuta C:\python "D:\GPSpython.py" "ruta al archivo que contiene los datos". |
Logré obtener el archivo .gpx Ahora el problema es que al analizarlo, solo hay dos coordenadas (latitud y longitud) repetidas. El problema seguramente está en la generación del TXT con el gpsreader.exe. Podrás ayudarme con este paso? Vi que tu archivo TXT tiene coordenadas diferentes según el desplazamiento, en cambio el mio sólo tiene un par de coordenadas repetidas. Estoy haciendo lo siguiente: "C:\Program Files (x86)\Insta360Stitcher\tools\prostitcher\GPSReader.exe" "D:\GPStrack.txt". |
Comprueba el contenido del archivo GPStrack.txt con el block de notas y
mira si le pasa lo mismo, que solo hay dos coordenadas repetidas, para
confirmar que el problema está en gpsreader.exe. En ese caso siento no
poder ayudarte. Si por el contrario Gpstrack.txt contiene puntos diferentes
adjuntalo.
El lun., 1 feb. 2021 19:53, scrimaglia <[email protected]> escribió:
… Logré obtener el archivo .gpx
Ahora el problema es que al analizarlo, solo hay dos coordenadas (latitud
y longitud) repetidas.
El problema seguramente está en la generación del TXT con el
gpsreader.exe. Podrás ayudarme con este paso? Vi que tu archivo TXT tiene
coordenadas diferentes según el desplazamiento, en cambio el mio sólo tiene
un par de coordenadas repetidas.
Estoy haciendo lo siguiente:
"C:\Program Files (x86)\Insta360Stitcher\tools\prostitcher\GPSReader.exe"
"D:\GPStrack.txt".
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMIBRIMD5K7EBP2UBDBP6TS44BDTANCNFSM4W3MBASQ>
.
|
This is what i did (btw i´m no a programmer o something like that):
1) Copy and paste your code inside a GPSpython.py file (first created a notepad TXT and renamed it .PY, then pasted the code)
usage = """python insta360pro-gps PATH_TO_INPUT_FILE [PATH_TO_OUTPUT_FILE]
Converts to GPX format a file with the GPS track extracted from a Insta360 Pro
video using the GPSreader.exe tool included in the Insta360 Stitcher software."""
author = "Javier Sanchez Portero"
copyright = "Copyright 2018, Javier Sanchez Portero"
license = "GNU v3"
version = "1.0"
email = "[email protected]"
from argparse import ArgumentParser
from collections import OrderedDict
from datetime import datetime
import json
import os
sep = '\n'
tab = ' '
gpxatrs = OrderedDict()
gpxatrs['version'] = "1.1"
gpxatrs['creator'] = "insta360pro-gps"
gpxatrs['xmlns'] = "http://www.topografix.com/GPX/1/1"
gpxatrs['xmlns:xsi'] = "http://www.w3.org/2001/XMLSchema-instance"
gpxatrs['xsi:schemaLocation'] = "http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"
def read(inputfile):
with open(inputfile, 'r') as fo:
data = json.loads(fo.read())
track = data['extended_gps_info']
assert isinstance(track, (list, tuple))
return track
def writeln(fo, text, tabs=0):
for i in range(tabs):
fo.write(tab)
fo.write(text)
fo.write(sep)
def togpx(track, fo):
writeln(fo, "")
writeln(fo, '<gpx ' + ' '.join(['{}="{}"'.format(k, v)
for (k, v) in list(gpxatrs.items())]) + '>')
writeln(fo, '', 1)
writeln(fo, '', 2)
for tp in track:
lat = tp['latitude']
lon = tp['longitude']
ele = tp['altitude']
dt = datetime.fromtimestamp(tp['time_gps_epoch'])
writeln(fo, ''.format(lat, lon), 3)
writeln(fo, '{}'.format(ele), 4)
writeln(fo, '{}'.format(dt.strftime('%Y-%m-%dT%H:%M:%S.%fZ')), 4)
writeln(fo, '', 3)
writeln(fo, '', 2)
writeln(fo, '', 1)
writeln(fo, '')
if name == "main":
parser = ArgumentParser(usage=usage)
parser.add_argument('inpath', help="D:\GPStrack.txt")
parser.add_argument('outpath', nargs='?', help="D:\GPStrackGPX.gpx")
args = parser.parse_args()
try:
track = read(args.inpath)
except IOError as e:
print(e)
except (ValueError, KeyError, AssertionError) as e:
print("Bad input file")
fn = args.outpath if args.outpath else os.path.splitext(args.inpath)[0] + '.gpx'
with open(fn, 'w') as fo:
togpx(track, fo)
2) Go to command prompt and execute: C:\python "D:\GPSpython.py"
And this is what i got:
usage: python insta360pro-gps PATH_TO_INPUT_FILE [PATH_TO_OUTPUT_FILE]
Converts to GPX format a file with the GPS track extracted from a Insta360 Pro
video using the GPSreader.exe tool included in the Insta360 Stitcher software.
GPSpython.py: error: the following arguments are required: inpath
The text was updated successfully, but these errors were encountered: