Changeset ceea8c5 in git


Ignore:
Timestamp:
13/03/15 11:28:44 (5 years ago)
Author:
Olly Betts <olly@…>
Branches:
line_contents, master, stereo, travis-osx
Children:
2595419
Parents:
322bee9
Message:

src/findentrances.cc: If the 3d file specifies the coordinate system,
use it.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r322bee9 rceea8c5  
     1Fri Mar 13 11:27:54 GMT 2015  Olly Betts <olly@survex.com>
     2
     3        * src/findentrances.cc: If the 3d file specifies the coordinate system,
     4          use it.
     5
    16Fri Mar 13 03:49:45 GMT 2015  Olly Betts <olly@survex.com>
    27
  • src/findentrances.cc

    r322bee9 rceea8c5  
    33 *
    44 * Copyright (C) 2012 Olaf Kähler
    5  * Copyright (C) 2012,2013 Olly Betts
     5 * Copyright (C) 2012,2013,2015 Olly Betts
    66 *
    77 * This program is free software; you can redistribute it and/or modify
     
    2828 *
    2929 * Usage:
    30  *   findentrances -d <+proj +datum +string> <input.3d>
     30 *   findentrances [-d <+proj +datum +string>] <input.3d>
    3131 *
    3232 * Example for data given in BMN M31 (Totes Gebirge, Austria):
     
    6363
    6464static void
    65 read_survey(const char *filename, vector<Point> & points)
     65read_survey(const char *filename, vector<Point> & points, const char ** p_proj)
    6666{
    6767    img *survey = img_open_survey(filename, NULL);
    6868    if (!survey) {
    6969        fatalerror(img_error2msg(img_error()), filename);
     70    }
     71
     72    if (survey->cs) {
     73        if (*p_proj) {
     74            fprintf(stderr, "3d file specifies the coordinate system, ignoring datum specified on command line\n");
     75        }
     76        *p_proj = osstrdup(survey->cs);
     77    } else if (!*p_proj) {
     78        cmdline_syntax();
     79        fprintf(stderr, "3d file does not specify the coordinate system - you need to specify the datum on the command line\n");
     80        exit(1);
    7081    }
    7182
     
    164175    }
    165176
    166     if (!datum_string) {
    167         cmdline_syntax();
    168         exit(1);
    169     }
    170 
    171177    const char *survey_filename = argv[optind];
    172178
    173179    vector<Point> points;
    174     read_survey(survey_filename, points);
     180    read_survey(survey_filename, points, &datum_string);
    175181    convert_coordinates(points, datum_string, WGS84_DATUM_STRING);
    176182    sort_points(points);
Note: See TracChangeset for help on using the changeset viewer.