52North / IlwisCore

Integrated Land and Water Information System (ILWIS) is a remote sensing and GIS software. ILWIS Core is the functional center of ilwis4..
http://52north.org/communities/ilwis/
35 stars 13 forks source link

Funciton of [ ] for a PixelIterator with a Box #65

Open johko opened 10 years ago

johko commented 10 years ago

The function of the '[ ]' operator for a Pixel Iterator with a custom box isn't really clear and thus not really working. We need a decision on wether the indexes should be in relation to the whole raster or if the first pixel of the box has the index 0 (which would probably be most intuitive), no matter where in the raster the box is located.

MartinSchouwenburg commented 10 years ago

probably correct. The pixeliterator works fine in respect to the boxes and ++ operator and such ( the main use). Some other methods have been implemented due to compatibility with similar interfaces in other c++ containers. But I question that decision now, The '[]' operator is questionable. I dont believe that people have a clear idea what the 334312 'ed pixel in a map is. If the 334312 pixel is the result of an iteration ( e.g. using the for(int i=0; ...; ++i) construct) that I would advice using the ++ operator which is much faster. Also due to the semantics of the origin location of this operations it is clear that the meaning of this operation isa bit questionable.