convert sid to tif image mrsidgeodecode

439 views
Skip to first unread message
Message has been deleted

karsten

unread,
Jul 21, 2009, 2:32:10 AM7/21/09
to Cascadia Users of Geospatial Open Source
Hi all,

I wrote a short python program to convert all *.sid images in a
directory on my server to *.tif format. It seems to work great exept
that the colors I get with the resulting tifs are off. I uploaded an
example to illustrate this: http://groups.google.com/group/cugos/web/map1.gif
left hand side 1 is mrsid (good colors) right hand side 2 is the tif
image with the odd colors ...

The command I am using is similar to
mrsidgeodecode -i xy1.sid -o xy1.tif -of tifg

Amy ideas what happens there and how I could fix it?
Karsten

Michael P. Gerlek

unread,
Jul 21, 2009, 12:29:36 PM7/21/09
to karsten, Cascadia Users of Geospatial Open Source
Karsten, can you get me a copy of the sid file?

-mpg


-----Original Message-----
From: cu...@googlegroups.com [mailto:cu...@googlegroups.com] On Behalf Of karsten
Sent: Monday, July 20, 2009 11:29 PM
To: Cascadia Users of Geospatial Open Source
Subject: [CUGOS] convert sid to tif image mrsidgeodecode


Hi all,

I wrote a snort python program to convert all *.sid images in a
directory on my server to *.tif format. It seems to work great expect
that the colors I get with the resulting tifs are off. I uploaded an
example to illustrate: http://groups.google.com/group/cugos/web/map1.gif
let had side 1 is mrsid (good colors) right hand side 2 is the tiff

Roger André

unread,
Jul 21, 2009, 12:50:15 PM7/21/09
to karsten, Cascadia Users of Geospatial Open Source
It looks like a color depth problem, but your command looks ok. Have
you tried converting the image with gdal_translate, just to see what
happens? I know it will be slower.

Roger
--

karsten vennemann

unread,
Jul 21, 2009, 12:55:07 PM7/21/09
to Cascadia Users of Geospatial Open Source, Roger André
No I didn't try gdal_translate because I couldn't get mrsid support to work
in the version on my ubuntu server (all work needs to be done o the server
since the resulting tifs size will be prohibitive to be uploaded there with
my household DSL...

Karsten

Michael P. Gerlek

unread,
Jul 21, 2009, 12:56:01 PM7/21/09
to karsten vennemann, Cascadia Users of Geospatial Open Source, Roger André
Roger may be on the right path. If you can't easily send me the sid, can you send the output from "mrsidinfo -meta -wkt"?

-mpg

Roger André

unread,
Jul 21, 2009, 1:03:24 PM7/21/09
to Michael P. Gerlek, karsten vennemann, Cascadia Users of Geospatial Open Source
Karsten, for a quick and dirty test, download the Linux version of
FWTools and install it. It won't conflict with any of your other
installed software, and it comes with MrSID support built-in.

I've seen the same kind of image degradation when using an incorrect
IMAGEFORMAT specifier in MapServer.
--

Roger André

unread,
Jul 21, 2009, 1:05:36 PM7/21/09
to Michael P. Gerlek, karsten vennemann, Cascadia Users of Geospatial Open Source
Correction, "OUTPUTFORMAT". I had the same problem when I had
inadvertently specified "PC256" for the "IMAGEMODE".
--

karsten vennemann

unread,
Jul 21, 2009, 1:14:19 PM7/21/09
to Roger André, Michael P. Gerlek, Cascadia Users of Geospatial Open Source
Oh wow - that mnight be an idea - actually I didn't download the resulting
tif form the server yet (due to size) , but will do that now to check
whether the output via mapserver wms is the problem... The image preview I
sent is taken straight from my screen in openlayers ...
Karsten

Karsten Vennemann
Principal

Terra GIS LTD
2119 Boyer Ave E
Seattle, WA 98112
USA
www.terragis.net

Phone 206 905 1711
Fax 925 905 1711

karsten vennemann

unread,
Jul 21, 2009, 1:23:15 PM7/21/09
to Roger André, Michael P. Gerlek, Cascadia Users of Geospatial Open Source
Roger,

Your side note about mapserver output - that was it
I had specified this
OUTPUTFORMAT
NAME 'PNG_1'
DRIVER "GD/PNG"
MIMETYPE "image/png"
IMAGEMODE PC256
EXTENSION "png"
END

Changed it to
IMAGEMODE RGB
And voila output is correct, so it no problem with the conversion at all but
with my mapserver output.

Thanks guys
Karsten

Michael P. Gerlek

unread,
Jul 21, 2009, 1:23:27 PM7/21/09
to karsten vennemann, Roger André, Cascadia Users of Geospatial Open Source
+1 to Roger.

-mpg


-----Original Message-----
From: karsten vennemann [mailto:kar...@terragis.net]
Sent: Tuesday, July 21, 2009 10:23 AM
To: 'Roger André'; Michael P. Gerlek
Cc: 'Cascadia Users of Geospatial Open Source'

Roger André

unread,
Jul 21, 2009, 2:08:28 PM7/21/09
to karsten vennemann, Michael P. Gerlek, Cascadia Users of Geospatial Open Source
Excellent! btw, on a related topic, I have been getting excellent
results using MapServer's AGG renderer with aerial photos. I use
this OUTPUTFORMAT block, and I've attached what an image looks like
that is served using it.

# OUTPUT FORMAT SPECIFICATION
OUTPUTFORMAT
NAME 'AGGA'
DRIVER 'AGG/PNG'
IMAGEMODE RGBA
EXTENSION "png"
END

Nice thing is that by using that renderer, you can get sub-pixel
aliasing for your vector linework.
--

lincoln_scrn.png
Reply all
Reply to author
Forward
0 new messages