| 1102 | } |
| 1103 | |
| 1104 | bool reopen(PJ_CONTEXT *ctx) override { |
| 1105 | pj_log(ctx, PJ_LOG_DEBUG, "Grid %s has changed. Re-loading it", |
| 1106 | m_name.c_str()); |
| 1107 | m_grids.clear(); |
| 1108 | m_GTiffDataset.reset(); |
| 1109 | auto fp = FileManager::open_resource_file(ctx, m_name.c_str()); |
| 1110 | if (!fp) { |
| 1111 | return false; |
| 1112 | } |
| 1113 | auto newGS = open(ctx, std::move(fp), m_name); |
| 1114 | if (newGS) { |
| 1115 | m_grids = std::move(newGS->m_grids); |
| 1116 | m_GTiffDataset = std::move(newGS->m_GTiffDataset); |
| 1117 | } |
| 1118 | return !m_grids.empty(); |
| 1119 | } |
| 1120 | }; |
| 1121 | |
| 1122 | #endif // TIFF_ENABLED |