Changes between Version 52 and Version 53 of rfc24_progressive_data_support


Ignore:
Timestamp:
Sep 2, 2008, 4:29:00 PM (16 years ago)
Author:
normanb
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • rfc24_progressive_data_support

    v52 v53  
    1717To provide an interface to a streaming data source in a convenient manner for RasterIO operations within GDAL and to expose this interface via swig.
    1818
    19 Note this RFC originally explored using an Observer pattern as per implementations in Java [http://java.sun.com/j2se/1.4.2/docs/api/javax/imageio/event/IIOReadUpdateListener.html imageio update].  The RFC then also discussed the [http://www.gtk.org/api/2.6/glib/glib-Asynchronous-Queues.html Asynchronous Message Queue pattern], but after detailed discussions with [http://thread.gmane.org/gmane.comp.gis.gdal.devel/16409/focus=16630 Tamas Szekeres, Even Rouault, Adam Nowacki and Frank Warmerdam] an even simpler interface is proposed which wraps the more unpleasant developer tasks of operating with the streaming protocol but allows the user greater flexibility in interacting with the stream in their preferred language.  This is implemented by using a context object to act as an intermediary between the user layer and the format driver.  The approach recommended in the RFC is a half-way abstraction of the protocol as it requires some knowledge that this is a streaming format and how to optimise the driver from the user interface.  This is an acceptable, and actually desirable trade-off, since it allows the swig wrappers to implement high speed data access / display in a pattern suitable for the language.
     19Note this RFC originally explored using an Observer pattern as per implementations in Java [http://java.sun.com/j2se/1.4.2/docs/api/javax/imageio/event/IIOReadUpdateListener.html imageio update].  The RFC then also discussed the [http://www.gtk.org/api/2.6/glib/glib-Asynchronous-Queues.html Asynchronous Message Queue pattern], but after detailed discussions with [http://thread.gmane.org/gmane.comp.gis.gdal.devel/16409/focus=16630 Tamas Szekeres, Even Rouault, Adam Nowacki and Frank Warmerdam] an even simpler interface is proposed which wraps the more unpleasant developer tasks of operating with the streaming protocol but allows the user greater flexibility in interacting with the stream in their preferred language.  This is implemented by using a context object to act as an intermediary between the user layer and the format driver.  The approach recommended in the RFC is a half-way abstraction of the protocol as it requires some knowledge that this is a streaming format and how to optimise the driver from the user interface.  This is an acceptable, and actually desirable trade-off, since it allows the swig wrappers to implement high speed data access / display in a pattern suitable for the language.  The protocol may support a finer level of messaging than is available through this layer.
     20
     21Note that we may wish to revisit the name the classes within this RFC since with this proposal the the RasterIO, and block methods are blocking, hence there is not any  asynchronous communication in the format driver and this is delegated to the user code layer.
    2022 
    2123
     
    2729== Pseudo-Code ==
    2830
     31'' interaction with the driver, the Definition below should be used for function names, not the pseudo-code''
     32
     33{{{
     34   GDALDataset *ds = GDALOpen(name, Access.GA_ReadOnly);
     35   
     36   // create an IO context for interaction with the remote server
     37   // the driver will initiate communication to the server and the context status to IO_PENDING
     38   // similar interaction with RasterBand
     39
     40   GDALRasterIOContext *ctx = ds->CreateRasterIOContext(GF_Read, nDSXOff, nDSYOff, nDSXSize, nDSYSize, nBXSize, nBYSize, GDT_Byte, nBandCount, panBandMap, nPixelSpace, nLineSpace, nBandSpace);
     41
     42   // optional : invoke a thread to execute communication to the server, and update the window when the thread terminates
     43
     44   while (ctx-> status != IO_COMPLETE)
     45   {
     46      // Update the buffer with the next stage of data.  The driver is allowed to modify
     47      // the buffer within ReadNextBlock only
     48      // ReadNextBlock will wait for the next data response from the server
     49      ctx->ReadNextBlock(buffer, options);
     50
     51      // check has the view updated, is the request cancelled
     52      if (bCancel || viewChanged)
     53      {
     54         ctx -> CancelIO();
     55         break;
     56      }
     57   }
     58
     59   if (!viewChanged)
     60     updateDisplay()
     61     
     62}}}
    2963
    3064== Definition ==