| 41 | #endif |
| 42 | |
| 43 | BOOL LASreaderBIL::open(const CHAR* file_name) |
| 44 | { |
| 45 | if (file_name == 0) |
| 46 | { |
| 47 | laserror("file name pointer is zero"); |
| 48 | return FALSE; |
| 49 | } |
| 50 | |
| 51 | // clean header |
| 52 | |
| 53 | clean(); |
| 54 | |
| 55 | // read the mandatory hdr file |
| 56 | |
| 57 | if (!read_hdr_file(file_name)) |
| 58 | { |
| 59 | laserror("reading the *.hdr file for '%s'", file_name); |
| 60 | return FALSE; |
| 61 | } |
| 62 | |
| 63 | // read the optional bwl file |
| 64 | |
| 65 | if (!read_blw_file(file_name)) |
| 66 | { |
| 67 | LASMessage(LAS_WARNING, "reading the *.blw file for '%s'", file_name); |
| 68 | } |
| 69 | |
| 70 | // check that we have all the needed info |
| 71 | |
| 72 | if (xdim <= 0) |
| 73 | { |
| 74 | xdim = 1; |
| 75 | LASMessage(LAS_WARNING, "xdim was not set. setting to %g", xdim); |
| 76 | } |
| 77 | |
| 78 | if (ydim <= 0) |
| 79 | { |
| 80 | ydim = 1; |
| 81 | LASMessage(LAS_WARNING, "ydim was not set. setting to %g", ydim); |
| 82 | } |
| 83 | |
| 84 | if (ulxcenter == F64_MAX) |
| 85 | { |
| 86 | ulxcenter = 0.5*xdim; |
| 87 | LASMessage(LAS_WARNING, "ulxcenter was not set. setting to %g", ulxcenter); |
| 88 | } |
| 89 | |
| 90 | if (ulycenter == F64_MAX) |
| 91 | { |
| 92 | ulycenter = (-0.5+nrows)*ydim; |
| 93 | LASMessage(LAS_WARNING, "ulycenter was not set. setting to %g", ulycenter); |
| 94 | } |
| 95 | |
| 96 | // open the BIL file |
| 97 | file = LASfopen(file_name, "rb"); |
| 98 | if (file == 0) |
| 99 | { |
| 100 | laserror("cannot open file '%s'", file_name); |
nothing calls this directly
no test coverage detected