<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.Shkpostityyli17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.Shkpostityyli18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:3.0cm 2.0cm 3.0cm 2.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FI" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">I am sure that the accuracy of tileindex vectors does not make the trouble. The tileindex is only used for selecting which images will be needed for building the requested output image and this
is done by selecting polygons which intersect with the requested BBOX. Once the correct image files are selected the georeferencing of the images is read from the images themselves, in your case from png + WLD.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">I suppose that white lines appear when the selected images are subsampled to a non-original pixel size for the output one by one. At the image boundary when the image pixels cover less than 50% of
the output pixel area the corresponding output pixel is painted white. Let’s say this was at the upper edge of the lower tile. Normally when the same pixel is rendered from the lower edge of the upper tile there should be more than 50% image data for the pixel
and it should be rendered with color. Now for some reason also the upper tile yields white pixel and the result is “not data for this pixel in lower tile or in upper tile”.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">It is a bit heavy to try to solve the issue only by thinking. Could you put two adjacent tiles with WLD files somewhere so I could have a try with them? Tell the EPSG code as well. Meanwhile, if
you have some experience on GDAL or if you are willing to learn you can also try to make the mosaic in another way than using tileindex. Create a GDAL virtual mosaic file with gdalbuildvrt tool and use the resulting .vrt file as datasource for your layer instead
of tileindex. Read <a href="http://www.gdal.org/gdalbuildvrt.html">http://www.gdal.org/gdalbuildvrt.html</a> and
<a href="http://www.gdal.org/gdalbuildvrt.html">http://www.gdal.org/gdalbuildvrt.html</a>. As a result GDAL will take care of subsampling and it may give different results.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">On the other hand, if you could tolerate using GDAL instead of FME you can avoid all the trouble by converting your original image into tiled and compressed geotiff with overviews.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">-Jukka Rahkonen-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:FI">Lars I. Nielsen wrote:<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">For performance reasons, I've (used FME to) split a large PNG into 450 small tiles, serving them with a Mapserver tileindex as a WMS service to a web solution.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Howeever, white lines appear between some of the tile rows (not all) at some scales (not all).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I've looked deeper into the WLD files for the individual tiles, and found that the calculations are accurate to 1/10 of a nanometer. At least if one uses all 10 decimals.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Tiles are 2254 pixels high, and (as per the WLDs below) 6138899.3169212583 - 0.0204375000 * 2254 = 6138853.2507962583 (almost equal to 6138853.2507962584)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Which leads me to suspect that some sort of truncation goes on, yielding some sort of rounding error.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Do anyone know whether the tileindex calculations truncates any of the values in the WLD files ? And if so, by how much ?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Cheers.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">--<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">A typical map picture with a white line can be seen via this link:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><a href="http://hvmgo01.hvenegaard.dk/mswms/mapserv.exe?map=odensekkgd_wms.map&LAYERS=ASSISTENS&TRANSPARENT=true&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&FORMAT=image/png&SRS=epsg:25832&BBOX=586609.80952408,6138781.1015875,586686.0222225,6138857.3142859&WIDTH=256&HEIGHT=256">http://hvmgo01.hvenegaard.dk/mswms/mapserv.exe?map=odensekkgd_wms.map&LAYERS=ASSISTENS&TRANSPARENT=true&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&FORMAT=image/png&SRS=epsg:25832&BBOX=586609.80952408,6138781.1015875,586686.0222225,6138857.3142859&WIDTH=256&HEIGHT=256</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Here's the WLD of the two tiles displayed in the picture:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Upper tile WLD:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">0.0204375000<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">0.0000000000<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">0.0000000000<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">-0.0204375000<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">586620.6934394070<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">6138899.3169212583<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Lower tile WLD:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">0.0204375000<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">0.0000000000<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">0.0000000000<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">-0.0204375000<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">586620.6934394070<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">6138853.2507962584<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:DA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:DA">--<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:DA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:DA">Ps! As I wrote previously, I'm using FME to create the tiles. So I have little control over the actual coordinate and pixel values, and only specify the number of tiles I
need. So manual truncation is not really a viable option.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:DA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:DA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:DA">Kind regards / Med venlig hilsen<br>
Lars I. Nielsen<br>
----------------------------------------------------------------<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DA" style="color:#1F497D;mso-fareast-language:DA">Landinspektør, Senior GIS Programmør og Konsulent<br>
Hvenegaard Landinspektører A/S<br>
Rugaardsvej 55, DK-5000 Odense C<br>
Denmark<br>
Tel. +45 6313 5050<br>
<a href="http://www.hvenegaard.dk/">http://www.hvenegaard.dk</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DA"><o:p> </o:p></span></p>
</div>
</div>
</body>
</html>