MrSID files: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
mNo edit summary
 
Brian Wilson (talk | contribs)
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
MrSID is a proprietary compressed image file format of [[http://www.lizardtech.com/ LizardTech]]
MrSID is a proprietary compressed image file format of [http://www.lizardtech.com/ LizardTech]
It has become very popular for GIS files, especially orthophotos because it is efficient and
It has become very popular for GIS files, especially orthophotos because it is efficient and (can be) lossless.
lossless.


It is proprietary so it's not supported in GRASS.
LizardTech provides a free decoder. It is available for Windows, Linux and Solaris. It will convert MrSID images to JPG, GeoTIFF image formats. It can also scale images, extract part of an image, and a few other things. This makes it possible to use MrSID images in programs that do not support directly reading it.  


But all is not lost! The kindly folk at LizardTech supply a free decoder.
Lately I have been using GDAL a fair bit, and LizardTech also supplies a decoder that can be incorporated into GDAL at build time, so that you can read MrSID rasters with the GDAL tools. I have tested it on Linux. Works great.
It is available for Windows, Linux and Solaris. It will convert MrSID images
to JPG, GeoTIFF image formats. It can also scale images, extract part of an image,
and a few other things...


Go to the downloads area at the LizardTech site and look for "MrSID Decode"


For example, to convert a Corvallis orthophoto to a GeoTIFF
== Testing LizardTech tools ==


mrsiddecode -of tifg -i 11s5w15f_color_sw.sid -o ~/workspace/11s5w15f_color_sw.tif
=== Recompress MG4 file ===


The "-of tifg" tells it to generate a GeoTIFF not just a plain image TIFF.
2013-05-21
By default it will give a progress indicator. You can turn this off if you want.
Output for the above command looked like this:


<pre>
As input we have a MrSID file with a 25:1 compression. It's too big.  
mrsiddecode: (c) 2004 LizardTech, Inc. All rights reserved.


'''/usr/local/LizardTech/GeoExpress8/bin/mrsidgeoencoder -of mg4 -cr 75 -i /t/GISdata/OR/Corvallis/orthophoto_2012/Corvallis_2012.sid -o Corvallis_2012.sid'''
Using local license
Input file name: /t/GISdata/OR/Corvallis/orthophoto_2012/Corvallis_2012.sid
Output file name: Corvallis_2012.sid
Output format: MrSID Generation 4
Encoder version: 8.0.0.3065.Bob_3062_br
Encode start time: Mon May 20 13:49:42 2013
Encode finish time: Mon May 20 13:54:59 2013
Total encode time: 5 minutes, 17 seconds
Input image size: 139.4 GB (149714552000 bytes)
Output file size: 1.5 GB (1598160567 bytes)
Target encode ratio: 75.00:1
Actual encode ratio: 93.68:1
Data Cartridge not decremented


input:
Since the job is SID -> SID it does not decrement the data cartridge.
  width:        5501
  height:        6200
  upper-left X:  1273797.814000
  upper-left Y:  358042.349000
  X scale:      0.500000
  Y scale:      -0.500000


output:
Before size: '''5.6G'''<br>
  width:         5501
After size:  '''1.5G'''
  height:       6200
 
  upper-left X1273797.814000
Seems to have worked just fine. It was even fast.
  upper-left Y358042.349000
Now I find there is no MrSID viewer for Linux! Drat. I have to go find a Windows machine now.
  X scale:       0.500000
 
  Y scale:       -0.500000
=== Reprojection with datum shift fails ===
  format:       GeoTIFF
 
</pre>
2011-04-21
 
Input: [http://seafloor.org/MrSID_tests/11s5w34f_color_ne.sid Corvallis air photo in SID format]
 
Output: [http://seafloor.org/MrSID_tests/11s5w34f_color_ne_nad27.sid reprojected SID using mrsidgeoencoder] (21 MB) (Command runs but image is shifted.)
 
Output: [http://seafloor.org/MrSID_tests/11s5w34f_color_ne_ProjectRas.img|reprojected IMG file using ArcGIS 9.3.1] (300 MB) Raster Reproject (Works correctly.)
 
Note, ArcGIS output is in IMG format because ArcGIS cannot write SID.
 
MrSID command and output (command in '''bold'''):
 
'''/usr/local/LizardTech/GeoExpress8/bin/mrsidgeoencoder''' \
'''-of mg3 -lossless -towkt NAD_1927_StatePlane_Oregon_North_FIPS_3601.prj''' \
'''-i 11s5w34f_color_ne.sid -o  11s5w34f_color_ne_nad27.sid'''
Using local license
Input file name: 11s5w34f_color_ne.sid
Output file name: 11s5w34f_color_ne_nad27.sid
Output format: MrSID Generation 3
Estimated memory required: 33.7 MB
Encoder version: 8.0.0.3065.Bob_3062_br
Encode start time: Mon Apr 11 15:53:06 2011
Encode finish time: Mon Apr 11 15:55:46 2011
Total encode time: 2 minutes, 40 seconds
Input image size: 314.7 MB (329941728 bytes)
Output file size: 21.1 MB (22090787 bytes)
Encode ratio: 14.94:1 (lossless)
Data Cartridge not decremented
 
ArcGIS command:
 
[[image:screenshotReprojectRaster.png]]
 
I used the same WKT projection file to do both reprojections. Here is a copy of that file.
[http://seafloor.org/MrSID_tests/NAD_1927_StatePlane_Oregon_North_FIPS_3601.prj NAD_1927_StatePlane_Oregon_North_FIPS_3601.prj]
 
=== Screenshot of results ===
 
Note that in the top image, the streets do not align with the reprojected image. It appears that the image is still in NAD1983 projection.
 
[http://seafloor.org/MrSID_tests/ReprojectionTest.mxd ArcGIS ArcMAP 9.3.1 project file]
 
[http://seafloor.org/MrSID_tests/centerline.zip Street shapefile.]
 
[[image:ReprojectionTest.jpg]]
 
=== Testing a two step reprojection ===
 
Step one: NAD83 HARN to NAD83
 
'''/usr/local/LizardTech/GeoExpress8/bin/mrsidgeoencoder -of mg3 -lossless -towkt NAD_1983_StatePlane_Oregon_North_FIPS_3601.prj -i 11s5w34f_color_ne.sid -o 11s5w34f_color_ne_nad83.sid'''
Using local license
Input file name: 11s5w34f_color_ne.sid
  Output file name: 11s5w34f_color_ne_nad83.sid
Output format: MrSID Generation 3
  Estimated memory required: 33.7 MB
Encoder version: 8.0.0.3065.Bob_3062_br
Encode start time: Tue Apr 12 10:20:36 2011
Encode finish time: Tue Apr 12 10:23:09 2011
Total encode time: 2 minutes, 33 seconds
Input image size: 314.7 MB (329941728 bytes)
Output file size: 21.1 MB (22090751 bytes)
Encode ratio: 14.94:1 (lossless)
Data Cartridge not decremented
 
Step two: NAD83 to NAD27
 
'''/usr/local/LizardTech/GeoExpress8/bin/mrsidgeoencoder -of mg3 -lossless  -towkt NAD_1927_StatePlane_Oregon_North_FIPS_3601.prj -i 11s5w34f_color_ne_nad83.sid -o 11s5w34f_color_ne_nad27.sid'''
Using local license
Input file name: 11s5w34f_color_ne_nad83.sid
Output file name: 11s5w34f_color_ne_nad27.sid
Output format: MrSID Generation 3
Estimated memory required: 33.7 MB
Encoder version: 8.0.0.3065.Bob_3062_br
Encode start time: Tue Apr 12 10:23:11 2011
Encode finish time: Tue Apr 12 10:25:28 2011
Total encode time: 2 minutes, 17 seconds
Input image size: 314.7 MB (329941728 bytes)
Output file size: 21.1 MB (22090809 bytes)
Encode ratio: 14.94:1 (lossless)
Data Cartridge not decremented
 
Results: Same as one step. Still wrong.

Latest revision as of 21:01, 20 May 2013

MrSID is a proprietary compressed image file format of LizardTech It has become very popular for GIS files, especially orthophotos because it is efficient and (can be) lossless.

LizardTech provides a free decoder. It is available for Windows, Linux and Solaris. It will convert MrSID images to JPG, GeoTIFF image formats. It can also scale images, extract part of an image, and a few other things. This makes it possible to use MrSID images in programs that do not support directly reading it.

Lately I have been using GDAL a fair bit, and LizardTech also supplies a decoder that can be incorporated into GDAL at build time, so that you can read MrSID rasters with the GDAL tools. I have tested it on Linux. Works great.


Testing LizardTech tools

Recompress MG4 file

2013-05-21

As input we have a MrSID file with a 25:1 compression. It's too big.

/usr/local/LizardTech/GeoExpress8/bin/mrsidgeoencoder -of mg4 -cr 75 -i /t/GISdata/OR/Corvallis/orthophoto_2012/Corvallis_2012.sid -o Corvallis_2012.sid
Using local license
Input file name: /t/GISdata/OR/Corvallis/orthophoto_2012/Corvallis_2012.sid
Output file name: Corvallis_2012.sid
Output format: MrSID Generation 4
Encoder version: 8.0.0.3065.Bob_3062_br
Encode start time: Mon May 20 13:49:42 2013
Encode finish time: Mon May 20 13:54:59 2013
Total encode time: 5 minutes, 17 seconds
Input image size: 139.4 GB (149714552000 bytes)
Output file size: 1.5 GB (1598160567 bytes)
Target encode ratio: 75.00:1
Actual encode ratio: 93.68:1
Data Cartridge not decremented

Since the job is SID -> SID it does not decrement the data cartridge.

Before size: 5.6G
After size: 1.5G

Seems to have worked just fine. It was even fast. Now I find there is no MrSID viewer for Linux! Drat. I have to go find a Windows machine now.

Reprojection with datum shift fails

2011-04-21

Input: Corvallis air photo in SID format

Output: reprojected SID using mrsidgeoencoder (21 MB) (Command runs but image is shifted.)

Output: IMG file using ArcGIS 9.3.1 (300 MB) Raster Reproject (Works correctly.)

Note, ArcGIS output is in IMG format because ArcGIS cannot write SID.

MrSID command and output (command in bold):

/usr/local/LizardTech/GeoExpress8/bin/mrsidgeoencoder \
-of mg3 -lossless -towkt NAD_1927_StatePlane_Oregon_North_FIPS_3601.prj \
-i 11s5w34f_color_ne.sid -o  11s5w34f_color_ne_nad27.sid
Using local license
Input file name: 11s5w34f_color_ne.sid
Output file name: 11s5w34f_color_ne_nad27.sid
Output format: MrSID Generation 3
Estimated memory required: 33.7 MB
Encoder version: 8.0.0.3065.Bob_3062_br
Encode start time: Mon Apr 11 15:53:06 2011
Encode finish time: Mon Apr 11 15:55:46 2011
Total encode time: 2 minutes, 40 seconds
Input image size: 314.7 MB (329941728 bytes)
Output file size: 21.1 MB (22090787 bytes)
Encode ratio: 14.94:1 (lossless)
Data Cartridge not decremented

ArcGIS command:

I used the same WKT projection file to do both reprojections. Here is a copy of that file. NAD_1927_StatePlane_Oregon_North_FIPS_3601.prj

Screenshot of results

Note that in the top image, the streets do not align with the reprojected image. It appears that the image is still in NAD1983 projection.

ArcGIS ArcMAP 9.3.1 project file

Street shapefile.

Testing a two step reprojection

Step one: NAD83 HARN to NAD83

/usr/local/LizardTech/GeoExpress8/bin/mrsidgeoencoder -of mg3 -lossless -towkt NAD_1983_StatePlane_Oregon_North_FIPS_3601.prj -i 11s5w34f_color_ne.sid -o 11s5w34f_color_ne_nad83.sid
Using local license
Input file name: 11s5w34f_color_ne.sid
Output file name: 11s5w34f_color_ne_nad83.sid
Output format: MrSID Generation 3
Estimated memory required: 33.7 MB
Encoder version: 8.0.0.3065.Bob_3062_br
Encode start time: Tue Apr 12 10:20:36 2011
Encode finish time: Tue Apr 12 10:23:09 2011
Total encode time: 2 minutes, 33 seconds
Input image size: 314.7 MB (329941728 bytes)
Output file size: 21.1 MB (22090751 bytes)
Encode ratio: 14.94:1 (lossless)
Data Cartridge not decremented

Step two: NAD83 to NAD27

/usr/local/LizardTech/GeoExpress8/bin/mrsidgeoencoder -of mg3 -lossless  -towkt NAD_1927_StatePlane_Oregon_North_FIPS_3601.prj -i 11s5w34f_color_ne_nad83.sid -o 11s5w34f_color_ne_nad27.sid
Using local license
Input file name: 11s5w34f_color_ne_nad83.sid
Output file name: 11s5w34f_color_ne_nad27.sid
Output format: MrSID Generation 3
Estimated memory required: 33.7 MB
Encoder version: 8.0.0.3065.Bob_3062_br
Encode start time: Tue Apr 12 10:23:11 2011
Encode finish time: Tue Apr 12 10:25:28 2011
Total encode time: 2 minutes, 17 seconds
Input image size: 314.7 MB (329941728 bytes)
Output file size: 21.1 MB (22090809 bytes)
Encode ratio: 14.94:1 (lossless)
Data Cartridge not decremented

Results: Same as one step. Still wrong.