OpenDroneMap/PyODM

cannot pass image geolocation file (geo.txt) into project

jjrise opened this issue ยท 5 comments

very likely an ignorant question here... but when using pyodm, I am unable to pass or have odm recognize an image geolocation file (geo.txt). This works using the normal webodm and CLI approaches as long as I have it in the root of my project folder, but cannot resolve this with pyodm. When creating a task I used the --geo argument passing the geo.txt absolute path with no success either.

Any help would be much appreciated!

import glob
import os
from pyodm import Node, exceptions
 
node = Node("localhost", 3000)
try:
    # Get all JPG files in directory
    files = glob.glob("*.JPG") + glob.glob("*.jpg") + glob.glob("*.JPEG") + glob.glob("*.jpeg") + glob.glob("*.txt")
    geolist = glob.glob("*geo.txt")
 
    print("Uploading images...")
    task = node.create_task(files, {'orthophoto-resolution': 15, 'ignore-gsd': True, 'gps-accuracy': 0.05, 'use-hybrid-bundle-adjustment': True, 'fast-orthophoto': True, 'skip-3dmodel': True, 'time': True, 'geo': geolist})
    print(task.info())
 
    try:
        def print_status(task_info):
            msecs = task_info.processing_time
            seconds = int((msecs / 1000) % 60)
            minutes = int((msecs / (1000 * 60)) % 60)
            hours = int((msecs / (1000 * 60 * 60)) % 24)
            print("Task is running: %02d:%02d:%02d" % (hours, minutes, seconds), end="\r")
        task.wait_for_completion(status_callback=print_status)
 
        print("Task completed, downloading results...")
 
        # Retrieve results
        def print_download(progress):
            print("Download: %s%%" % progress, end="\r")
        task.download_assets(outputdir, progress_callback=print_download)
        print("Assets saved in output/results directory")
    except exceptions.TaskFailedError as e:
        print("\n".join(task.output()))
except exceptions.NodeConnectionError as e:
    print("Cannot connect: %s" % e)
except exceptions.OdmError as e:
    print("Error: %s" % e)

Could we move this conversation over to the forum at https://community.opendronemap.org? ๐Ÿ™ The forum is the right place to ask questions (we try to keep the GitHub issue tracker for feature requests and bugs only). Thank you! ๐Ÿ‘

yes of course, my apologies!

No worries, thank you for helping us keep the issue tracker in order.

Fixed with NodeODM#140. ๐Ÿ‘