Hi Ammar,
I've done similar recently so hopefully can help. I've got about 3,500
tiles which all form a single GeoTIFF. I used Image Mosiac because the
resulting file will be too large, but I doubt that would be the case with
you as your outputs are significantly less than 10GB. You should be able to
use the normal GeoTIFF driver .
Anyway, I create the following batchfile (Windows) which does everything in
a single step:
set THIS_DIR=%1
>
> cd %THIS_DIR%
> dir /b /s *.tif > tiff_list.txt
> REM Builds a VRT. A VRT is basically just a XML file saying what all the
> source tif files are.
> gdalbuildvrt -srcnodata 255 -vrtnodata 255 -a_srs EPSG:27700
> -input_file_list tiff_list.txt %THIS_DIR%.vrt
>
> REM This is what actually does the mosaicing.
> gdal_translate -of GTiff -co TILED=YES -co BIGTIFF=YES -co COMPRESS=JPEG
> -co JPEG_QUALITY=80 -co BLOCKXSIZE=512 -co BLOCKYSIZE=512 -co
> PHOTOMETRIC=YCBCR %THIS_DIR%.vrt %THIS_DIR%.tif
> Echo "Created"
>
> REM Now creating pyramids.
> gdaladdo %THIS_DIR%.tif -r average --config COMPRESS_OVERVIEW JPEG
> --config JPEG_QUALITY_OVERVIEW 60 --config INTERLEAVE_OVERVIEW PIXEL
> --config PHOTOMETRIC_OVERVIEW YCBCR 2 4 8 16 32 64 128 256 512
> Echo "Tiled"
> cd ..
To run the batch file:
> run_me.bat *SP02*
The SP02 is the name of the directory that has all the TIFFs that need to
be mosaiced together. The result is super-small (highly compressed JPEG,
but no real loss of quality), and optimised for GeoServer.
The output is a file in the directory called "SP02.tif".
You'll want to take off a few levels of pyramids, but this will probably
work as-is otherwise.
Use this equation to figure out how many levels of pyramids you need:
http://docs.geoserver.org/stable/en/user/tutorials/imagemosaic-jdbc/imagemosaic-jdbc_tutorial.html#how-many-pyramids-are-needed
===
As you need to do this 100 times, I'd suggest splitting up your TIFF's into
different directories (one directory for each output tiff you want), then
running a batch file which in turn runs the above batch file 100 times.
That batch file can simply be:
> FOR /D %%G in ("S*") DO call run_me.bat %%G
Although running 100 at once may kill your computer. :-)
====
And on the issue of resampling - if it's orthophotography I stick with
average; it doesn't make much difference because of the nature of the
product. It's more important when doing thematic maps.
Regards,
Jonathan
On 6 December 2013 10:36, Ammar <[email protected]> wrote:
> Hello list,
>
> I have 20,000 of TIFF+TFW files that I want to serve in GeoServer 2.4.1 as
> WMS. I have followed the GeoServer on
> Steroids<http://elogeo.nottingham.ac.uk/xmlui/bitstream/handle/url/226/gs_steroids_sgiannec_foss4g2013_01.03.pdf?sequence=1>notes
> and I did the following:
>
> 1. Added projection using gdal_translate
> 2. Added inner-tiles (512 x 512) using gdal_translate
> 3. Added overviews (2 4 8 16 32) using gdal_addo
> 4. Compressed the dataset with LZW method using gdal_translate
> 5. Created one big GeoTIFF file using gdal_merge.py
>
> I have tested the above on a small set of 150 TIFFs and the result was one
> big GeoTIFF of 10.8 GB size. I have 10,000 TIFFs and this way I will end up
> with roughly 100 GeoTIFF files having a size of 10GB each which is far more
> than the original size of all the TIFF files!
>
> I have a couple of questions:
>
> 1. What compression method do you recommend? (I am currently testing with
> LZW predictor=1, LZW predictor=2, Deflate predictor=1 and Deflate
> predictor=2).
> 2. Are the overviews enough? Do I need to generate more overviews? (e.g 64
> 128)
> 3. What resampling algorithms are most recommended? Where can I read about
> resampling algorithms?
> 4.
> 5. Any tips or recommendations?
>
> Best regards,
> //Ammar
>
>
> ------------------------------------------------------------------------------
> Sponsored by Intel(R) XDK
> Develop, test and display web and hybrid apps with a single code base.
> Download it for free now!
>
> http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
--
This transmission is intended for the named addressee(s) only and may
contain sensitive or protectively marked material up to RESTRICTED and
should be handled accordingly. Unless you are the named addressee (or
authorised to receive it for the addressee) you may not copy or use it, or
disclose it to anyone else. If you have received this transmission in error
please notify the sender immediately. All email traffic sent to or from us,
including without limitation all GCSX traffic, may be subject to recording
and/or monitoring in accordance with relevant legislation.
------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users