<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>How to Use MR.SID raster files in mapserver 4.4.2 ?</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.2800.1498" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>
<DIV><FONT size=2>Robert,</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp; Good point.&nbsp; Hmm, the error is "Failed to load 
image", not that it couldn't find the file, but that it couldn't read the data 
in it properly.&nbsp; Could this be caused by a permissions problem or some file 
system issue?&nbsp; </FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; You may want to try Mapserver's shp2img to 
see if you can get more information on the problem.&nbsp; For 
example:</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>shp2img -all_debug 1 -m mapfile -o image.jpg</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Or perhaps there is something wrong with the MrSID file.&nbsp; 
I've found some MrSID files that look ok until you try to zoom into a specific 
location (then the viewing applicaiton will crash).&nbsp; You could try to 
convert one to jpg with gdal_translate to check.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Brent</FONT></DIV></DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=OudelohuisR@vertis.nl href="mailto:OudelohuisR@vertis.nl">Robert oude 
  Lohuis</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=bfraser@geoanalytic.com 
  href="mailto:bfraser@geoanalytic.com">'Brent Fraser'</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, June 03, 2005 1:08 AM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [UMN_MAPSERVER-USERS] How to 
  Use MR.SID raster files in mapserver 4.4.2 ?</DIV>
  <DIV><BR></DIV>
  <DIV dir=ltr align=left><SPAN class=751480107-03062005><FONT face=Arial 
  color=#0000ff size=2>tnx for the information about the coordinate 
  system.</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=751480107-03062005><FONT face=Arial 
  color=#0000ff size=2>The initial extent overlaps the Mr.SID and we do use the 
  correct zoomfactor, otherwise we could not generate the error 
  ;-(</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=751480107-03062005></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=751480107-03062005><FONT face=Arial 
  color=#0000ff size=2>When using a mapfile which has a layer pointing to the 
  MrSID file, the error in my original email occurred. It refers to a file which 
  cannot be found. I saw that for every .sid file there are two other files (a 
  .aux and a .??? file). </FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=751480107-03062005><FONT face=Arial 
  color=#0000ff size=2>For a mapfile which has a wrong data entry (the filename 
  definititely does not exists for example) no error is 
given</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=751480107-03062005><FONT face=Arial 
  color=#0000ff size=2>For a mapfile which has a correct entry pointing to a 
  .sid file an error is given about a file that cannot be 
  found.</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=751480107-03062005><FONT face=Arial 
  color=#0000ff size=2>this is a bit strange. I can only explain this in the 
  context of the two other files ?</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=751480107-03062005><FONT face=Arial 
  color=#0000ff size=2>Or am I wrong here ?</FONT></SPAN></DIV><BR>
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> Brent Fraser 
  [mailto:bfraser@geoanalytic.com] <BR><B>Sent:</B> Thursday, June 02, 2005 5:45 
  PM<BR><B>To:</B> Robert oude Lohuis<BR><B>Subject:</B> Re: 
  [UMN_MAPSERVER-USERS] How to Use MR.SID raster files in mapserver 4.4.2 
  ?<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV><FONT size=2>It looks like there is no coordinate system defined 
  in&nbsp;your MrSID file.&nbsp; It's not strictly necessary for Mapserver if 
  you plan to use the same coordinate system for display as your source data 
  (and all your source data has the same coordinate system).&nbsp;&nbsp; 
  </FONT><FONT size=2>There&nbsp;IS registration coordinate information 
  (IMAGE__XY_ORIGIN=109999.500000,425000.500000, IMAGE__X_RESOLUTION=1.000000, 
  IMAGE__Y_RESOLUTION=1.000000) which is required by MapServer, so that's good. 
  What is the intial EXTENT&nbsp;in your map file?&nbsp; You need to make sure 
  your EXTENT overlaps your image extent if you want to see any of the 
  data.</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>Also, set STATUS DEFAULT for the layer to make sure 
  Mapserver uses it.&nbsp; And you may want to comment out the MINSCALE and 
  MAXSCALE settings until you get things working.</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>Brent</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <BLOCKQUOTE dir=ltr 
  style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
    <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
    <DIV 
    style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
    <A title=OudelohuisR@vertis.nl href="mailto:OudelohuisR@vertis.nl">Robert 
    oude Lohuis</A> </DIV>
    <DIV style="FONT: 10pt arial"><B>To:</B> <A title=bfraser@geoanalytic.com 
    href="mailto:bfraser@geoanalytic.com">'Brent Fraser'</A> </DIV>
    <DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, June 02, 2005 9:10 
    AM</DIV>
    <DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [UMN_MAPSERVER-USERS] How 
    to Use MR.SID raster files in mapserver 4.4.2 ?</DIV>
    <DIV><BR></DIV>
    <DIV dir=ltr align=left><SPAN class=370295214-02062005><FONT face=Arial 
    color=#0000ff size=2>Thanks for the reply,</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN class=370295214-02062005><FONT face=Arial 
    color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=ltr align=left><SPAN class=370295214-02062005><FONT face=Arial 
    color=#0000ff size=2>In answer to your question,&nbsp;</FONT></SPAN><SPAN 
    class=370295214-02062005><FONT face=Arial color=#0000ff size=2>an example of 
    the output gdalinfo for one of the&nbsp;mrSID files:</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN class=370295214-02062005><FONT face=Arial 
    color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=ltr align=left><SPAN class=370295214-02062005><FONT face=Arial 
    color=#0000ff size=2>Driver: MrSID/Multi-resolution Seamless Image Database 
    (MrSID)<BR>Size is 20002, 20002<BR>Coordinate System is `'<BR>Origin = 
    (109999.000000,425001.000000)<BR>Pixel Size = 
    (1.00000000,-1.00000000)<BR>Metadata:<BR>&nbsp; 
    IMAGE__INPUT_NAME=E:\Lufo2000\1x1m\Tiff\423112_1.tif, 
    E:\Lufo2000\1x1m\Tiff\423116_1.tif, E:\Lufo2000\1x1m\Tiff\423120_1.tif, 
    E:\Lufo2000\1x1m\Tiff\423124_1.tif, E:\Lufo2000\1x1m\Tiff\423128_1.tif, 
    E:\Lufo2000\1x1m\Tiff\419112_1.tif, E:\Lufo2000\1x1m\Tiff\419116_1.tif, 
    E:\Lufo2000\1x1m\Tiff\419120_1.tif, E:\Lufo2000\1x1m\Tiff\419124_1.tif, 
    E:\Lufo2000\1x1m\Tiff\419128_1.tif, E:\Lufo2000\1x1m\Tiff\415112_1.tif, 
    E:\Lufo2000\1x1m\Tiff\415116_1.tif, E:\Lufo2000\1x1m\Tiff\415120_1.tif, 
    E:\Lufo2000\1x1m\Tiff\415124_1.tif, E:\Lufo2000\1x1m\Tiff\415128_1.tif, 
    E:\Lufo2000\1x1m\Tiff\411112_1.tif, E:\Lufo2000\1x1m\Tiff\411116_1.tif, 
    E:\Lufo2000\1x1m\Tiff\411120_1.tif, E:\Lufo2000\1x1m\Tiff\411124_1.tif, 
    E:\Lufo2000\1x1m\Tiff\411128_1.tif, E:\Lufo2000\1x1m\Tiff\407112_1.tif, 
    E:\Lufo2000\1x1m\Tiff\407116_1.tif, E:\Lufo2000\1x1m\Tiff\407120_1.tif, 
    E:\Lufo2000\1x1m\Tiff\407124_1.tif, 
    E:\Lufo2000\1x1m\Tiff\407128_1.tif<BR>&nbsp; 
    IMAGE__INPUT_FILE_SIZE=1202009775.000000<BR>&nbsp; 
    IMAGE__BITS_PER_SAMPLE=8<BR>&nbsp; 
    IMAGE__COMPRESSION_VERSION=1,6,1<BR>&nbsp; 
    IMAGE__TARGET_COMPRESSION_RATIO=10.000000<BR>&nbsp; 
    IMAGE__COMPRESSION_NLEV=6<BR>&nbsp; 
    IMAGE__COMPRESSION_WEIGHT=4.000000<BR>&nbsp; 
    IMAGE__COMPRESSION_GAMMA=2.000000<BR>&nbsp; 
    IMAGE__COMPRESSION_BLOCK_SIZE=2048<BR>&nbsp; IMAGE__CREATION_DATE=Mon Nov 12 
    16:47:36 2001</FONT></SPAN></DIV>
    <DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
    <DIV dir=ltr align=left><SPAN class=370295214-02062005><FONT face=Arial 
    color=#0000ff size=2>&nbsp; IMAGE__WIDTH=20002<BR>&nbsp; 
    IMAGE__HEIGHT=20002<BR>&nbsp; IMAGE__NO_DATA_VALUE=255,255,255<BR>&nbsp; 
    IMAGE__COLOR_SCHEME=0<BR>&nbsp; IMAGE__DATA_TYPE=0<BR>&nbsp; 
    IMAGE__XY_ORIGIN=109999.500000,425000.500000<BR>&nbsp; 
    IMAGE__X_RESOLUTION=1.000000<BR>&nbsp; 
    IMAGE__Y_RESOLUTION=1.000000<BR>Corner Coordinates:<BR>Upper Left&nbsp; 
    (&nbsp; 109999.000,&nbsp; 425001.000) <BR>Lower Left&nbsp; (&nbsp; 
    109999.000,&nbsp; 404999.000) <BR>Upper Right (&nbsp; 130001.000,&nbsp; 
    425001.000) <BR>Lower Right (&nbsp; 130001.000,&nbsp; 404999.000) 
    <BR>Center&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (&nbsp; 120000.000,&nbsp; 
    415000.000) <BR>Band 1 Block=1024x128 Type=Byte, ColorInterp=Red<BR>&nbsp; 
    Overviews: 10001x10001, 5001x5001, 2501x2501, 1251x1251, 626x626<BR>Band 2 
    Block=1024x128 Type=Byte, ColorInterp=Green<BR>&nbsp; Overviews: 
    10001x10001, 5001x5001, 2501x2501, 1251x1251, 626x626<BR>Band 3 
    Block=1024x128 Type=Byte, ColorInterp=Blue<BR>&nbsp; Overviews: 10001x10001, 
    5001x5001, 2501x2501, 1251x1251, 626x626</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN class=370295214-02062005><FONT face=Arial 
    color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=ltr align=left><SPAN class=370295214-02062005><FONT face=Arial 
    color=#0000ff size=2>Could you give an example what the mapfile should look 
    like, to create al layer for a MrSID file ?</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN class=370295214-02062005><FONT face=Arial 
    color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=ltr align=left><SPAN class=370295214-02062005><FONT face=Arial 
    color=#0000ff size=2>in our mapfile the following section was 
    made:</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN class=370295214-02062005><FONT face=Arial 
    color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=ltr align=left><SPAN class=370295214-02062005><FONT face=Arial 
    color=#0000ff size=2>LAYER<BR>&nbsp; NAME&nbsp;&lt;...&gt;<BR>&nbsp; 
    METADATA<BR>&nbsp;&nbsp;&nbsp; "DESCRIPTION" "&lt;...&gt;"<BR>&nbsp; 
    END<BR>&nbsp; TYPE RASTER<BR>&nbsp;# PROCESSING "BANDS=1,2,3"<BR>&nbsp; 
    STATUS OFF<BR>&nbsp; CLASS<BR>&nbsp;&nbsp;&nbsp; NAME luchtfoto<BR>&nbsp; 
    END<BR>&nbsp; DATA "/data1/dvd/dvd1/mosaic/x020y375_1m_mos.sid"<BR>#&nbsp; 
    TILEINDEX "/data1/dvd/luchtfoto.shp"<BR># TILEITEM "location"<BR>&nbsp; 
    MINSCALE 10001<BR>&nbsp; MAXSCALE 5000000<BR>END</FONT></SPAN></DIV><FONT 
    face=Arial color=#0000ff size=2></FONT><FONT face=Arial color=#0000ff 
    size=2></FONT><BR>
    <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
    <HR tabIndex=-1>
    <FONT face=Tahoma size=2><B>From:</B> Brent Fraser 
    [mailto:bfraser@geoanalytic.com] <BR><B>Sent:</B> Thursday, June 02, 2005 
    4:52 PM<BR><B>To:</B> Robert oude Lohuis; 
    MAPSERVER-USERS@LISTS.UMN.EDU<BR><B>Subject:</B> Re: [UMN_MAPSERVER-USERS] 
    How to Use MR.SID raster files in mapserver 4.4.2 ?<BR></FONT><BR></DIV>
    <DIV></DIV>
    <DIV><FONT size=2>Robert,</FONT></DIV>
    <DIV><FONT size=2></FONT>&nbsp;</DIV>
    <DIV><FONT size=2>&nbsp; It is possible to use MrSID files as a data source 
    for MapServer.&nbsp; Personally, I don't recommend it due to the poor 
    decompression performance of MrSID.&nbsp; If you have the disk space convert 
    the MrSID files to uncompressed TIF instead (you can use GDAL's 
    gdal_translate utility).&nbsp; If disk space is not available use ECW 
    (although I'm not sure of the compilation status on unix).</FONT></DIV>
    <DIV><FONT size=2></FONT>&nbsp;</DIV>
    <DIV><FONT size=2>&nbsp; What do you get when you run GDAL's gdalinfo 
    utility on the MrSID file?</FONT></DIV>
    <DIV><FONT size=2></FONT>&nbsp;</DIV>
    <DIV><FONT size=2>Brent Fraser</FONT></DIV>
    <BLOCKQUOTE dir=ltr 
    style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
      <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
      <DIV 
      style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
      <A title=OudelohuisR@VERTIS.NL href="mailto:OudelohuisR@VERTIS.NL">Robert 
      oude Lohuis</A> </DIV>
      <DIV style="FONT: 10pt arial"><B>To:</B> <A 
      title=MAPSERVER-USERS@LISTS.UMN.EDU 
      href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU">MAPSERVER-USERS@LISTS.UMN.EDU</A> 
      </DIV>
      <DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, June 02, 2005 6:32 
      AM</DIV>
      <DIV style="FONT: 10pt arial"><B>Subject:</B> [UMN_MAPSERVER-USERS] How to 
      Use MR.SID raster files in mapserver 4.4.2 ?</DIV>
      <DIV><BR></DIV><BR>
      <P><FONT face=Arial size=2>Hello,</FONT> </P>
      <P><FONT face=Arial size=2>We have compiled version 4.4.2 of mapserver 
      (and the necessary libraries) from the sources on a unix box.</FONT> 
      <BR><FONT face=Arial size=2>It is now configured and working. There is 
      however one problem. </FONT><BR><FONT face=Arial size=2>We have a couple 
      of Mr. SID files and want to use these as a layer.</FONT> <BR><FONT 
      face=Arial size=2>We downloaded the libraries from lizardtech and 
      recompiled GDAL with support for Mr.SID</FONT> </P>
      <P><FONT face=Arial size=2>We did tiled the Mr. SID files and configured a 
      layer. There are no error messages, but I see no data in the map.</FONT> 
      <BR><FONT face=Arial size=2>We tried to look at an individual Mr. SID 
      file, but then we got the following error :</FONT> </P>
      <P><FONT face=Arial>MrSIDRasterBand::IRasterIO(): Failed to load image. 
      scene magnifGDALRasterIO() failed: drawGDAL(): Unable to access file. 
      GDALRasterIO() failed: drawGDAL() </FONT></P>
      <P><FONT face=Arial size=2>A recompile of mapserver had no effect.</FONT> 
      </P>
      <P><FONT face=Arial size=2>The first question is: Is it possible to look 
      at Mr.SID rasters through mapserver ?</FONT> <BR><FONT face=Arial 
      size=2>And the second question is, if so,&nbsp; what's the trick ?</FONT> 
      </P>
      <P><FONT face=Arial size=2>Does anyone have knowledge on this subject and 
      willing to share his/her information ?</FONT> </P>
      <P><FONT face=Arial size=2>Thanks in advance,</FONT> </P>
      <P><FONT face=Arial size=2>Robert oude Lohuis</FONT> 
  </P></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>