| 80 | [http://thread.gmane.org/gmane.comp.gis.gdal.devel/16409/focus=16630 Even Rouault - thread on gmane] |
| 81 | |
| 82 | ''Question'': |
| 83 | |
| 84 | I would like that the dataset object to be added as the first argument of the callback, and a void* user_data to be added as the last argument |
| 85 | |
| 86 | ''Response'': |
| 87 | |
| 88 | Agreed. |
| 89 | |
| 90 | ''Question'': |
| 91 | |
| 92 | Is the extended version of the RasterIO() call still blocking as the current version? |
| 93 | |
| 94 | ''Response'': |
| 95 | |
| 96 | This version of the RasterIO call is not blocking, the progress function is a callback which will be called when the buffer has new data. Effectively we are adding an observer (listener) to the format driver when requesting a particular window of data. |
| 97 | |
| 98 | ''Question'': |
| 99 | |
| 100 | What happens if the user specifies a not NULL argument as the output buffer ( in (1) ) ? What happens if the user specifies GF_Write ? |
| 101 | It is probably an argument for a name change, something like ProgressiveRasterIO. |
| 102 | |
| 103 | ''Response'': |
| 104 | |
| 105 | Agree with the name change for clarification. There is an argument to drop the buffer and GF_READ from the function call if we are giving it a new name and not just overloading RasterIO. |
| 106 | |
| 107 | ''Question'': |
| 108 | |
| 109 | Maybe it can make sense to add some way of cancelling the whole RasterIO call by providing a callback, like the standard progress callback (GDALProgressFunc in gdal.h) mechanism do ? Because the RasterIO() will spend most of the time waiting for data. It could resume from time to time to call that callback and see if the user still wants the request to be continued. It would be nice if the mechanism could provide some percentage of the total progress as it might be tedious for the user to compute that ? But that's probably not easy to define if you first update the whole request area with a low resolution, and then at higher resolutions. |
| 110 | |
| 111 | |
| 112 | ''Response'': |
| 113 | |
| 114 | Fully agree, adding a stop, amount of data transferred metadata would be very useful. The driver will use GDALProgressFunc (or will now, I hadn't thought of it until you mentioned it). |
| 115 | |
| 116 | ''Question'': |
| 117 | |
| 118 | What happens if the user issues another call to RasterIO(), traditionnal version and/or your extended version, in the pfnProgressIO callback |
| 119 | |
| 120 | ''Response'': |
| 121 | |
| 122 | The callback and the RasterIO function are in the same thread, so there are no synchronization issues here. The callback function is carrying the state (so region, res, buffer etc.) so that the display thread always has knowledge of the buffer contents. When updating the communication thread to the server, synchronization within the format driver is required. |
| 123 | |
| 124 | ''Question'': |
| 125 | |
| 126 | how will that work with the block cache mechanism? |
| 127 | |
| 128 | ''Response'': |
| 129 | |
| 130 | iat the moment I am not planning to integrate with the block cache, the format driver will have to implement its own (wavelet) cache this is important so that the format driver can communicate to the server the contents of its cache. |
| 131 | |
| 132 | |
| 133 | |
| 134 | |