How to Use MR.SID raster files in mapserver 4.4.2 ?

Brent Fraser bfraser at GEOANALYTIC.COM
Fri Jun 3 10:02:23 EDT 2005


How to Use MR.SID raster files in mapserver 4.4.2 ?Robert,

  Good point.  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.  Could this be caused by a permissions problem or some file system issue?  

    You may want to try Mapserver's shp2img to see if you can get more information on the problem.  For example:

shp2img -all_debug 1 -m mapfile -o image.jpg

Or perhaps there is something wrong with the MrSID file.  I've found some MrSID files that look ok until you try to zoom into a specific location (then the viewing applicaiton will crash).  You could try to convert one to jpg with gdal_translate to check.

Brent
  ----- Original Message ----- 
  From: Robert oude Lohuis 
  To: 'Brent Fraser' 
  Sent: Friday, June 03, 2005 1:08 AM
  Subject: RE: [UMN_MAPSERVER-USERS] How to Use MR.SID raster files in mapserver 4.4.2 ?


  tnx for the information about the coordinate system.
  The initial extent overlaps the Mr.SID and we do use the correct zoomfactor, otherwise we could not generate the error ;-(

  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). 
  For a mapfile which has a wrong data entry (the filename definititely does not exists for example) no error is given
  For a mapfile which has a correct entry pointing to a .sid file an error is given about a file that cannot be found.
  this is a bit strange. I can only explain this in the context of the two other files ?
  Or am I wrong here ?



------------------------------------------------------------------------------
  From: Brent Fraser [mailto:bfraser at geoanalytic.com] 
  Sent: Thursday, June 02, 2005 5:45 PM
  To: Robert oude Lohuis
  Subject: Re: [UMN_MAPSERVER-USERS] How to Use MR.SID raster files in mapserver 4.4.2 ?


  It looks like there is no coordinate system defined in your MrSID file.  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).   There 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 in your map file?  You need to make sure your EXTENT overlaps your image extent if you want to see any of the data.

  Also, set STATUS DEFAULT for the layer to make sure Mapserver uses it.  And you may want to comment out the MINSCALE and MAXSCALE settings until you get things working.

  Brent




    ----- Original Message ----- 
    From: Robert oude Lohuis 
    To: 'Brent Fraser' 
    Sent: Thursday, June 02, 2005 9:10 AM
    Subject: RE: [UMN_MAPSERVER-USERS] How to Use MR.SID raster files in mapserver 4.4.2 ?


    Thanks for the reply,

    In answer to your question, an example of the output gdalinfo for one of the mrSID files:

    Driver: MrSID/Multi-resolution Seamless Image Database (MrSID)
    Size is 20002, 20002
    Coordinate System is `'
    Origin = (109999.000000,425001.000000)
    Pixel Size = (1.00000000,-1.00000000)
    Metadata:
      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
      IMAGE__INPUT_FILE_SIZE=1202009775.000000
      IMAGE__BITS_PER_SAMPLE=8
      IMAGE__COMPRESSION_VERSION=1,6,1
      IMAGE__TARGET_COMPRESSION_RATIO=10.000000
      IMAGE__COMPRESSION_NLEV=6
      IMAGE__COMPRESSION_WEIGHT=4.000000
      IMAGE__COMPRESSION_GAMMA=2.000000
      IMAGE__COMPRESSION_BLOCK_SIZE=2048
      IMAGE__CREATION_DATE=Mon Nov 12 16:47:36 2001

      IMAGE__WIDTH=20002
      IMAGE__HEIGHT=20002
      IMAGE__NO_DATA_VALUE=255,255,255
      IMAGE__COLOR_SCHEME=0
      IMAGE__DATA_TYPE=0
      IMAGE__XY_ORIGIN=109999.500000,425000.500000
      IMAGE__X_RESOLUTION=1.000000
      IMAGE__Y_RESOLUTION=1.000000
    Corner Coordinates:
    Upper Left  (  109999.000,  425001.000) 
    Lower Left  (  109999.000,  404999.000) 
    Upper Right (  130001.000,  425001.000) 
    Lower Right (  130001.000,  404999.000) 
    Center      (  120000.000,  415000.000) 
    Band 1 Block=1024x128 Type=Byte, ColorInterp=Red
      Overviews: 10001x10001, 5001x5001, 2501x2501, 1251x1251, 626x626
    Band 2 Block=1024x128 Type=Byte, ColorInterp=Green
      Overviews: 10001x10001, 5001x5001, 2501x2501, 1251x1251, 626x626
    Band 3 Block=1024x128 Type=Byte, ColorInterp=Blue
      Overviews: 10001x10001, 5001x5001, 2501x2501, 1251x1251, 626x626

    Could you give an example what the mapfile should look like, to create al layer for a MrSID file ?

    in our mapfile the following section was made:

    LAYER
      NAME <...>
      METADATA
        "DESCRIPTION" "<...>"
      END
      TYPE RASTER
     # PROCESSING "BANDS=1,2,3"
      STATUS OFF
      CLASS
        NAME luchtfoto
      END
      DATA "/data1/dvd/dvd1/mosaic/x020y375_1m_mos.sid"
    #  TILEINDEX "/data1/dvd/luchtfoto.shp"
    # TILEITEM "location"
      MINSCALE 10001
      MAXSCALE 5000000
    END



----------------------------------------------------------------------------
    From: Brent Fraser [mailto:bfraser at geoanalytic.com] 
    Sent: Thursday, June 02, 2005 4:52 PM
    To: Robert oude Lohuis; MAPSERVER-USERS at LISTS.UMN.EDU
    Subject: Re: [UMN_MAPSERVER-USERS] How to Use MR.SID raster files in mapserver 4.4.2 ?


    Robert,

      It is possible to use MrSID files as a data source for MapServer.  Personally, I don't recommend it due to the poor decompression performance of MrSID.  If you have the disk space convert the MrSID files to uncompressed TIF instead (you can use GDAL's gdal_translate utility).  If disk space is not available use ECW (although I'm not sure of the compilation status on unix).

      What do you get when you run GDAL's gdalinfo utility on the MrSID file?

    Brent Fraser
      ----- Original Message ----- 
      From: Robert oude Lohuis 
      To: MAPSERVER-USERS at LISTS.UMN.EDU 
      Sent: Thursday, June 02, 2005 6:32 AM
      Subject: [UMN_MAPSERVER-USERS] How to Use MR.SID raster files in mapserver 4.4.2 ?




      Hello, 

      We have compiled version 4.4.2 of mapserver (and the necessary libraries) from the sources on a unix box. 
      It is now configured and working. There is however one problem. 
      We have a couple of Mr. SID files and want to use these as a layer. 
      We downloaded the libraries from lizardtech and recompiled GDAL with support for Mr.SID 

      We did tiled the Mr. SID files and configured a layer. There are no error messages, but I see no data in the map. 
      We tried to look at an individual Mr. SID file, but then we got the following error : 

      MrSIDRasterBand::IRasterIO(): Failed to load image. scene magnifGDALRasterIO() failed: drawGDAL(): Unable to access file. GDALRasterIO() failed: drawGDAL() 

      A recompile of mapserver had no effect. 

      The first question is: Is it possible to look at Mr.SID rasters through mapserver ? 
      And the second question is, if so,  what's the trick ? 

      Does anyone have knowledge on this subject and willing to share his/her information ? 

      Thanks in advance, 

      Robert oude Lohuis 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050603/cf14637d/attachment.html


More information about the mapserver-users mailing list