예제 #1
0
    (options, args) = parser.parse_args()
    # Take care of logging
    if options.debug:
        level = logging.DEBUG
    else:
        level = logging.INFO
    logger.setLevel(level)
    ch = logging.StreamHandler()
    ch.setLevel(level)
    logger.addHandler(ch)

    if options.flytrex and ("flytrex" in available_libs):
        # This object now contains myLog.flight, which is a geojson
        # data store that can be used for syncing and printing.
        if options.force_night:
            myLog = flytrex.FlyTrexLog(args[0], options.force_night)
        else:
            myLog = flytrex.FlyTrexLog(args[0])

        if options.flyout:
            myLog.flight.write(options.flyout)
        else:
            # Default to STDOUT
            myLog.flight.write()
    elif options.offsetcalc:
        import exifread
        from datetime import datetime

        imgDate = datetime.strptime(args[0], "%Y-%m-%d %H:%M:%S")
        f = open(args[1], 'rb')
        tags = exifread.process_file(f)
예제 #2
0
                            action="store_true",
                            dest="geotag",
                            default=False,
                            help="Geotag photo(s) from GPS logfile")
    geotag_group.add_option(
        "--geoout",
        dest="format",
        help="Output Format. Options EXIF|CSV|GEOJSON. [STDOUT]")
    geotag_group.add_option(
        "--offset",
        dest="offset",
        help=
        "Offset to apply between GPS time and camera time in seconds. [0.0]")
    parser.add_option_group(geotag_group)

    (options, args) = parser.parse_args()
    # Take care of logging
    if options.debug:
        level = logging.DEBUG
    else:
        level = logging.INFO
    logger.setLevel(level)
    ch = logging.StreamHandler()
    ch.setLevel(level)
    logger.addHandler(ch)

    if options.flytrex and ("flytrex" in available_libs):
        myLog = flytrex.FlyTrexLog(args[0])
        if options.flyout:
            myLog.writeCSV(options.flyout)