set the number of the first segment that is likely to be an image of the lidar data, and return true iff we found one
| 168 | // set the number of the first segment that is likely to be an image |
| 169 | // of the lidar data, and return true iff we found one |
| 170 | bool NitfFileReader::locateLidarImageSegment() |
| 171 | { |
| 172 | // as per 3.2.3 (pag 19) and 3.2.4 (page 39) |
| 173 | |
| 174 | ::nitf::ListIterator iter = m_record.getImages().begin(); |
| 175 | const ::nitf::Uint32 numSegs = m_record.getNumImages(); |
| 176 | |
| 177 | for (::nitf::Uint32 segNum=0; segNum<numSegs; segNum++) |
| 178 | { |
| 179 | ::nitf::ImageSegment imseg = *iter; |
| 180 | |
| 181 | ::nitf::ImageSubheader subheader = imseg.getSubheader(); |
| 182 | |
| 183 | ::nitf::Field field = subheader.getImageId(); |
| 184 | ::nitf::Field::FieldType fieldType = field.getType(); |
| 185 | if (fieldType != (::nitf::Field::FieldType)NITF_BCS_A) |
| 186 | throw error("error reading nitf (5)"); |
| 187 | std::string iid1 = field.toString(); |
| 188 | |
| 189 | // BUG: shouldn't allow "None" here! |
| 190 | if (iid1 == "INTENSITY " || iid1 == "ELEVATION " || |
| 191 | iid1 == "None ") |
| 192 | { |
| 193 | return true; |
| 194 | } |
| 195 | |
| 196 | iter++; |
| 197 | } |
| 198 | |
| 199 | return false; |
| 200 | } |
| 201 | |
| 202 | |
| 203 | // set the number of the first segment that is likely to be the LAS |