Aha, cool, I was not aware of that.
I am using SRTM DEM data, so subsampling is not an option, I need full res.
I should check if they are inner tiled (although I don't assume so). Is 
that something that gdal can help me with, to perform the tiling? Any 
hint welcome.

Thanks for bearing with me!
M.


On 5/5/2010 10:16 AM, Andrea Aime wrote:
> Martin Tomko ha scritto:
>> Thanks Andrea,
>> I really don't know enough how the mechanisms work behind the scenes, 
>> hence my question.
>> I understand that if you have a tiled source of coverage, only the 
>> relevant tiles can be read. (btw, I only played with tiled tiffs a 
>> long time ago - would have been 2.4 or so, and had troubles. Is there 
>> a nice snipped of code available somewhere, showing how to start with 
>> the GeoTIFF reader and an index shapefile?)
>
> You're talking about mosaics there. TIFFs can be inner tiled.
>
>> But is it really so that there is no way to read in only the 
>> appropriate portion?
>> Imagine a tiff+world fiel, or a geotiff - IFF we could read just the 
>> "metadata", we can reconstruct the Envelope (in the latter case even 
>> referenced envelope), and do an intersect operation with any other 
>> envelope, for instance coming from a geometry. The result of the 
>> intersection could then be transformed into the grid coordinates of 
>> the coverage (knowing the dimensions and the starting pixel), and 
>> only read these in, with the new envelope set.
>
> No, it's not possible. Coverages are read by blocks.
> A PNG/JPEG is laid out so that you have to uncompress the whole to 
> read, so it's not possible to do any cropping while reading.
> A inner tiled TIFF instead is structured so that the file is split into
> smaller blocks, and you read those instead (but each tile, you read
> fullh).
> If it's not tiled it's usually striped, so you can read one row at a 
> time (and afaik, the row is the minimum unit that we can read).
> That said, assuming it's not compressed, if it is, it's just like
> a PNG/JPEG.
>
> When tiles/stripes are not compressed in theory it should be possible
> to read only parts of it, not sure what happens in that case (e.g.,
> I know we can set subsampling, which will read one pixel out of
> every n as a cheap way to reduce the resolution, but not sure
> what happens about the ROI when reading).
>
> Cheers
> Andrea
>
>


------------------------------------------------------------------------------
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to