| 275 | |
| 276 | |
| 277 | void NitfFileWriter::setBounds(const BOX3D& bounds) |
| 278 | { |
| 279 | m_bounds = bounds; |
| 280 | |
| 281 | //NITF decimal degree values for corner coordinates only has a |
| 282 | // precision of 3 after the decimal. This may cause an invalid |
| 283 | // polygon due to rounding errors with a small tile. Therefore |
| 284 | // instead of rounding min values will use the floor value and |
| 285 | // max values will use the ceiling values. |
| 286 | m_bounds.minx = (floor(m_bounds.minx * 1000)) / 1000.0; |
| 287 | m_bounds.miny = (floor(m_bounds.miny * 1000)) / 1000.0; |
| 288 | m_bounds.maxx = (ceil(m_bounds.maxx * 1000)) / 1000.0; |
| 289 | m_bounds.maxy = (ceil(m_bounds.maxy * 1000)) / 1000.0; |
| 290 | } |
| 291 | |
| 292 | |
| 293 | void NitfFileWriter::wrapData(const char *buf, size_t size) |