Hello Diego,

I'm trying to do roughly the same with the Bleumarble data set. I tiled a
geotiff file using your script - very useful ! - and now I'm trying to use
the ImageMosaic plugin to display it in a layer of a JMapPanel. I was
wondering whether you managed to make it work because I'm having a weird
problem: When the tiles are read by ImageIO from some point the
createImageInputStream() method only returns nulls. (After having read
successfully 903 tiles.) The very same file can be displayed individually
though.

Wondering this might be soft/weak reference problem I tried with increased
heap sizes. Alas, with the same result. As far as I can see the .prj and
.properties files are ok.

By any chance, did you ran into a similar issue ? I'm rather new to
GeoTools, so if you have a code sample of some kind to help me out that
would be great.

Many thanks !

Jan


Diego Fdez. Durán wrote:
> 
> Step by step.
> 
>  I've done a little script[1] that chops a big GeoTIFF in tiles using
> gdal[2], and generates the .shp index file. Feel free to put it in the
> GeoTools doc if you found it interesting.
> 
>  Tomorrow I'll try using ImageMosaic to load the image (I suppose that I
> only have to load the .shp file and the plugin do the .tif loading
> itself).
> 
>  :)
> 
> [1]
> -- BEGIN SCRIPT
> #!/bin/bash
> # 
> # This script divides a GeoTIFF file in tiles and generates a .shp index
> file.
> #
> # Diego Fdez. Durán <[EMAIL PROTECTED]>
> #       AAC IAF - Universidad de León - 2007
> 
> 
> TILESIZE=256
> STORE_DIR="tiles"
> INDEX_FILE="index_tiles.shp"
> 
> usage() {
>         echo "Usage: $0 file.tif [tilesize]"
> }
> 
> if [ -n "$1" ] && [ -e $1 ]; then
>         MAP_FILE=$1
> else
>         usage
>         exit -1;
> fi
> 
> STR=( `gdalinfo $MAP_FILE | grep ^Size | cut -d' ' -f3,4 | sed  s/','/'
> '/` )
> MAP_H_RES=${STR[0]}
> MAP_V_RES=${STR[1]}
> 
> 
> if [ -n "$2" ]; then
>         TILESIZE=$2
> fi
> 
> if [ ! -d "$STORE_DIR" ]; then
>         mkdir $STORE_DIR
> fi
> 
> let "N_H_TILES=$MAP_H_RES / $TILESIZE"
> let "N_V_TILES=$MAP_V_RES / $TILESIZE"
> let "N_TILES=$N_H_TILES * $N_V_TILES"
> 
> 
> echo "File: $MAP_FILE of ${MAP_H_RES}x${MAP_V_RES}px"
> echo "Generating $N_TILES (${N_H_TILES}*${N_V_TILES}) ${TILESIZE}x
> ${TILESIZE}px tiles"
> 
> COUNT=1
> for ((i=0; i < N_H_TILES; i++))
> do
>         let "H_OFFSET=$i * $TILESIZE"
>         for ((j=0; j < N_V_TILES; j++))
>         do
>                 let "V_OFFSET=$j * $TILESIZE"
>                 let "PERCENT=(($COUNT / $N_TILES) * 100)"
>                 TILE_FILE="tile-${i}_${j}.tif"
>                 echo -ne "Working: $COUNT/$N_TILES ($PERCENT%) ::
> Creating tile $TILE_FILE\r"
>                 gdal_translate -of GTiff -co "TILED=YES" -srcwin
> $H_OFFSET $V_OFFSET $TILESIZE $TILESIZE $MAP_FILE $STORE_DIR/$TILE_FILE
>> /dev/null
>                 let "COUNT=$COUNT + 1"
>         done
> done
> 
> 
> echo "Generating tile index $INDEX_FILE"
> gdaltindex tiles_index.shp tiles/*.tif
> -- END SCRIPT
> 
> [2] http://www.gdal.org/
> 
> 
> El sáb, 01-12-2007 a las 14:21 -0800, Jody Garnett escribió:
>> They made a BigTIFF "fake specification" recently for which you may want 
>> to look around. Creatively named BIGTIFF I think.
>> 
>> Two things:
>> 1) just try it; grab the uDig tech preview
>> - http://udig.refractions.net/downloads/ECWDemo.win32.win32.x86.zip
>> - http://udig.refractions.net/downloads/jre/jre1.6.0_03.win32.zip  (in 
>> zip this JRE into the same folder; it contains imageio-ext for geotiff)
>>   (ImageIO is good about leaving the image on disk so it may be slow but 
>> you should see something)
>> 
>> 2)  image moasic (break the image up using gdal or some imageio tools 
>> and use a shapefile to keep track of this parts)
>> - http://docs.codehaus.org/display/GEOTDOC/Image+Mosaic+Plugin
>> The above page links to most of the information I could find (including 
>> a tutorial of breaking up a large bluemarble image); I have been using 
>> the result (amazing!) but have not tried breaking up an image yet.
>> 
>> Cheers,
>> Jody
>> > Hi all:
>> >
>> >    I'm trying visualize a 2GB (30000x20000px) GeoTIFF. I need to show a
>> > 1280x800px viewport of the image and be able to navigate through the
>> > full GeoTIFF.
>> >
>> >    Is there any way to do this? 
>> >    
>> >            - Directly working with the GeoTIFF.
>> >            - Dividing the GeoTIFF in small tiles of 256x256px and doing on
>> demand
>> > loading? (How can I divide the GeoTiFF?)
>> >
>> >    Can you point me in the right direction?
>> >
>> >    Thanks in advance.
>> >
>> >   
>> >
>> ------------------------------------------------------------------------
>> >
>> >
>> -------------------------------------------------------------------------
>> > SF.Net email is sponsored by: The Future of Linux Business White Paper
>> > from Novell.  From the desktop to the data center, Linux is going
>> > mainstream.  Let it simplify your IT future.
>> > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
>> >
>> ------------------------------------------------------------------------
>> >
>> > _______________________________________________
>> > Geotools-gt2-users mailing list
>> > Geotools-gt2-users@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>> >   
>> 
> -- 
> Diego Fdez. Durán <[EMAIL PROTECTED]> | http://www.goedi.net
> GPG : 925C 9A21 7A11 3B13 6E43 50DB F579 D119 90D2 66BB
> 
> 
>  
> -------------------------------------------------------------------------
> SF.Net email is sponsored by: The Future of Linux Business White Paper
> from Novell.  From the desktop to the data center, Linux is going
> mainstream.  Let it simplify your IT future.
> http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
> _______________________________________________
> Geotools-gt2-users mailing list
> Geotools-gt2-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/VERY-big-GeoTIFF-drawing-tp14109985p16452162.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to