<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Carlos,<br>
<br>
The GENBIN driver does not support file creation.<br>
You have to use the EHdr driver. I think their binary format are
equivalent.<br>
<blockquote><tt>gdal_translate -of EHdr image1.tif image1.bing</tt><br>
</blockquote>
It will produce one file<tt> image1.bing</tt> and one file <tt>image1.hdr</tt><br>
<br>
To convert all the tif files in one directory :<br>
<blockquote><tt>FOR %g in (*.tif) DO gdal_translate -of EHdr "%~nxg"
"converted\%~ng.bing"</tt><br>
</blockquote>
Good luck.<br>
<br>
Best regards,<br>
Benoît Andrieu<br>
<br>
<br>
Le 12/02/2010 22:39, Carlos Padovani a écrit :
<blockquote
cite="mid:16f071851002121439q1c6dfec0wda014fe2d9fc4fe3@mail.gmail.com"
type="cite">
<div>Please, forgot the two previous emails.</div>
<div>I got it works for convert binary to tif with this command lines:</div>
<div> </div>
<div>gdal_translate -of GTiff image1 image1.tif</div>
<div>gdal_translate -of GTiff -ot Byte -scale 0 10000 0 255 image1
image1_8bit.tif<br>
</div>
<div>But actually, I need to convert images from binary format to tif
format. As I says in the first email.</div>
<div>I sent the binary file for you to see how it looks like, and how
it need to be converted from tif.</div>
<div>Please, could you help me for the conversion of the tif files to
binary files?</div>
<div>I try to make it based in the command lines above, using now
that tif file I sent to you some emails ago and changing the
transformation like bellow:</div>
<div> </div>
<div>gdal_translate -of GENBIN image1.tif image1</div>
<div> </div>
<div>but I got a message error that I sent attached "error_GENBIN". </div>
<div>So, how could I convert tif to binary file?</div>
<div>I am sending the header file of the tif file I sent to you
before with the same name I used for the binary file I sent before, as
well "image1".<br>
</div>
<div>Thanks for your help.</div>
<div>Carlos</div>
<div> </div>
<div class="gmail_quote">On Fri, Feb 12, 2010 at 7:09 PM, Carlos
Padovani <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:carlos.padovani@gmail.com">carlos.padovani@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
<div>I am sending the image file with the reader file. Maybe
something wrong with it?</div>
<div>Carlos<font color="#888888"><br>
</font></div>
<div>
<div class="h5">
<div class="gmail_quote">On Fri, Feb 12, 2010 at 7:05 PM, Carlos
Padovani <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:carlos.padovani@gmail.com" target="_blank">carlos.padovani@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
<div>Thanks!</div>
<div>I did the reader file and applied the command line bellow in
the FWTools Shell, but it does not works.</div>
<div>I am sending a figure with the error. Could you help me on
this?</div>
<div>Carlos <font color="#888888"><br>
<br>
</font></div>
<div>
<div>
<div class="gmail_quote">On Fri, Feb 12, 2010 at 6:17 PM, Benoît
Andrieu <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:bea@ixsea.com" target="_blank">bea@ixsea.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
<div text="#000000" bgcolor="#ffffff">I managed to convert your
image to tif.<br>
You have to create a .hdr file next to your image in order to tell gdal
utilities the format of your file : <br>
<blockquote><tt>ncols 600<br>
nrows 600<br>
cellsize 0.050401<br>
xllcorner -130.128639<br>
yllcorner 20.166799<br>
nodata_value 9999.000000<br>
nbits 16<br>
pixeltype UNSIGNEDINT<br>
byteorder lsbfirst</tt><br>
</blockquote>
Then just call gdal_translate to convert your file :<br>
<blockquote><tt>gdal_translate -of GTiff image1.bing image1.tif</tt><br>
</blockquote>
This tif will be in 16bit.<br>
To have it in 8bit :<br>
<blockquote><tt>gdal_translate -of GTiff -ot Byte -scale 0
10000 0 255 image1.bing image1_8bit.tif</tt><br>
</blockquote>
<br>
I hope all your files have the same width and height.<br>
Note that <tt>cellsize</tt>, <tt>xllcorner </tt>and <tt>yllcorner </tt>will
be used to set the geographic coordinates of your tif.<br>
<br>
<br>
Le 12/02/2010 18:32, Benoît Andrieu a écrit :
<div>
<div>
<blockquote type="cite">Do not replace yourself the n and x. It
is automatically done by the command line interpretor.<br>
<br>
FOR %g in (*.bing) DO gdal_translate -of JPEG "%~nxg" "%~ng.jpg"<br>
<br>
<br>
Le 12/02/2010 18:22, Carlos Padovani a écrit :
<blockquote type="cite">
<div>I am working inside the images directory to make it
simple. </div>
<div>I tried the follow:</div>
<div> </div>
<div>FOR %g in (*.bing) DO gdal_translate -of JPEG
"%~imagem1.tifg" "%~imagem1g.jpg"<br>
</div>
<div>But it does not work as well. </div>
<div><br>
Carlos</div>
<div> </div>
<div class="gmail_quote">On Fri, Feb 12, 2010 at 3:22 PM,
Benoît Andrieu <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:bea@ixsea.com" target="_blank">bea@ixsea.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
<div text="#000000" bgcolor="#ffffff">Oups, sorry, I made
some mistakes...<br>
<br>
So, first mistake, if you are using a command line you should only have
one % and not two %%. On the contrary, if you are using a bat file, you
should have two %%.<br>
Next, I forgot a ~ in the DO syntax it should be %%~nxg and %%~ng.<br>
<br>
So, from the command line, the correct syntax is :<br>
<blockquote>FOR %g in (C:\conversion_tif_bin\*.bing) DO
gdal_translate -of JPEG "C:\conversion_tif_bin\%~nxg"
"C:\conversion_tif_bin\%~ng.jpg"<br>
<br>
</blockquote>
I haven't looked at your image at the moment...<br>
<br>
Regards,<br>
Benoît Andrieu<br>
<br>
<br>
Le 12/02/2010 16:18, Carlos Padovani a écrit :
<div>
<div>
<blockquote type="cite">
<div>Dear Benoît,</div>
<div>I am doing some thing wrong, but I do not know
what.</div>
<div>I am sending a figure "path" with the path and
another figure "FWTools_Shell_error" with the error message of the
FWTools Shell. The message of error is "%%g foi inesperado neste
momento", it is in Portuguese and means something like "%%g was
unexpected at the moment". You can see in the figure
"FWTools_Shell_error" how I typed the path and other data necessary. I
would like more help on this if possible.<br>
Sorry but I sent the wrong image. I am sending the right one now
"image1" with the data you required.</div>
<div>No. of columns: 600 <br>
No. of rows: 600<br>
No. of bands: 1 (gray)</div>
<div>Data type: Binary 16-bit integer<br>
</div>
<div class="gmail_quote">On Fri, Feb 12, 2010 at 12:39
PM, Benoît Andrieu <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:bea@ixsea.com" target="_blank">bea@ixsea.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
<div text="#000000" bgcolor="#ffffff">Dear Carlos,<br>
<br>
Yes, you should open a FWTools shell or set the FWTools path in your
PATH environment variable.<br>
And yes, the command line should be executed in the directory where
your images are but you can easily customize his behaviour :<br>
<br>
<blockquote><tt>mkdir __your_path__\converted<br>
FOR %%g in (</tt><tt>__your_path__</tt><tt>\*.tif) do gdal_translate
-of JPEG "</tt><tt>__your_path__</tt><tt>\</tt><tt>%%nxg" "</tt><tt>__your_path__\</tt><tt>converted\%%ng.jpg"<br>
</tt></blockquote>
The first line will create a new folder in your folder.<br>
<tt><br>
FOR %%g in (</tt><tt>__your_path__</tt><tt>*.tif) ===></tt> This
will select all the files in your directory and iterate with the %%g
variable<br>
<tt>"%%nxg" ===></tt> n
= name of the file without its extension, x = extension of the file, g
= the name of the variable<br>
<tt>"%%ng.jpg" ===> </tt>This
will change the extension of the file<br>
<br>
Regarding the binary format, could you tell me more about the file you
sent ?<br>
I would need its width, height, number of bands (gray, RGB, ARGB ?) and
the data type of each pixel (Byte, Int16, Float32 ?).<br>
Thanks.<br>
I would use the GenBin format too but unfortunately, GDAL is only able
to read them...<br>
<br>
<b><u>To the list :</u></b><br>
You can find the file sent by Carlos at this address<br>
<a moz-do-not-send="true"
href="http://benoit.andrieu.free.fr/00046agua.zip" target="_blank">http://benoit.andrieu.free.fr/00046agua.zip</a><br>
<br>
Best regards,<br>
Benoît Andrieu<br>
<br>
<br>
<tt><br>
</tt>Le 12/02/2010 13:06, Carlos Padovani a écrit :
<div>
<div>
<blockquote type="cite">
<div>Dear Benoît,</div>
<div>thanks very much for your fast response.</div>
<div>I am not familiar with command line
procedures, so could you explain in more details what should I do for
to convert the tif images to other format?</div>
<div>I will use this command line in the FWTools
Shell? I need to wrote this command line in a directory where the
images are? <br>
I took a look in the <a moz-do-not-send="true"
href="http://www.gdal.org/formats_list.html" target="_blank">http://www.gdal.org/formats_list.html</a> and
I guess that the binary files I need to convert from tif are the
Generic Binary (GenBin). </div>
<div>I am sending an image file for you to take a
look if you agree and maybe help me to identify if it is the same
Generic Binary of gdal format list.</div>
<div>Thanks once more.</div>
<div>Carlos<br>
</div>
<div class="gmail_quote">On Fri, Feb 12, 2010 at
10:04 AM, Benoît Andrieu <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:bea@ixsea.com" target="_blank">bea@ixsea.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
<div text="#000000" bgcolor="#ffffff">I don't
know about binary formats but you should find what you want here : <a
moz-do-not-send="true" href="http://www.gdal.org/formats_list.html"
target="_blank">http://www.gdal.org/formats_list.html</a><br>
<br>
<br>
You can use a bat file to convert all files from a folder :<br>
<blockquote><tt>mkdir converted<br>
FOR %%g in (*.tif) do gdal_translate -of JPEG "%%nxg"
"converted\%%ng.jpg"<br>
</tt></blockquote>
<br>
Regards,<br>
Benoît Andrieu<br>
<br>
<br>
<br>
Le 12/02/2010 11:00, Carlos Padovani a écrit :
<blockquote type="cite">
<div>
<div>Dear users of FWTools,<br>
I need to convert a lot of images form TIFF format to binary format. <br>
It is possible to do it in FWTools, but I do not know which is the
format available in the software that correspond to binary format.
Another thing is that in FWTools I can convert the images one by one,
and as I have a lot of images to convert, I would like a way to convert
a lot of images at once. I use Windows WP as operacional system.<br>
Could someone help me?<br>
Thanks in advance. <br clear="all">
Carlos </div>
</div>
<pre><fieldset></fieldset>
_______________________________________________
FWTools mailing list
<a moz-do-not-send="true" href="mailto:FWTools@lists.maptools.org"
target="_blank">FWTools@lists.maptools.org</a>
<a moz-do-not-send="true"
href="http://lists.maptools.org/mailman/listinfo/fwtools"
target="_blank">http://lists.maptools.org/mailman/listinfo/fwtools</a>
<a moz-do-not-send="true" href="http://fwtools.maptools.org/"
target="_blank">http://fwtools.maptools.org/</a>
</pre>
</blockquote>
</div>
<br>
_______________________________________________<br>
FWTools mailing list<br>
<a moz-do-not-send="true"
href="mailto:FWTools@lists.maptools.org" target="_blank">FWTools@lists.maptools.org</a><br>
<a moz-do-not-send="true"
href="http://lists.maptools.org/mailman/listinfo/fwtools"
target="_blank">http://lists.maptools.org/mailman/listinfo/fwtools</a><br>
<a moz-do-not-send="true"
href="http://fwtools.maptools.org/" target="_blank">http://fwtools.maptools.org/</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
Carlos Padovani<br>
Pesquisador<br>
Embrapa Pantanal<br>
<a moz-do-not-send="true"
href="http://www.cpap.embrapa.br/" target="_blank">www.cpap.embrapa.br</a><br>
SKYPE: carlos.padovani<br>
<a moz-do-not-send="true"
href="mailto:MSN%3Acrpadovani@hotmail.com" target="_blank">MSN:crpadovani@hotmail.com</a><br>
<br>
<br>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
Carlos Padovani<br>
Pesquisador<br>
Embrapa Pantanal<br>
<a moz-do-not-send="true"
href="http://www.cpap.embrapa.br/" target="_blank">www.cpap.embrapa.br</a><br>
SKYPE: carlos.padovani<br>
<a moz-do-not-send="true"
href="mailto:MSN%3Acrpadovani@hotmail.com" target="_blank">MSN:crpadovani@hotmail.com</a><br>
<br>
<br>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
Carlos Padovani<br>
Pesquisador<br>
Embrapa Pantanal<br>
<a moz-do-not-send="true" href="http://www.cpap.embrapa.br/"
target="_blank">www.cpap.embrapa.br</a><br>
SKYPE: carlos.padovani<br>
<a moz-do-not-send="true"
href="mailto:MSN%3Acrpadovani@hotmail.com" target="_blank">MSN:crpadovani@hotmail.com</a><br>
<br>
<br>
</blockquote>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
Carlos Padovani<br>
Pesquisador<br>
Embrapa Pantanal<br>
<a moz-do-not-send="true" href="http://www.cpap.embrapa.br/"
target="_blank">www.cpap.embrapa.br</a><br>
SKYPE: carlos.padovani<br>
<a moz-do-not-send="true"
href="mailto:MSN%3Acrpadovani@hotmail.com" target="_blank">MSN:crpadovani@hotmail.com</a><br>
<br>
<br>
</div>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
Carlos Padovani<br>
Pesquisador<br>
Embrapa Pantanal<br>
<a moz-do-not-send="true" href="http://www.cpap.embrapa.br/"
target="_blank">www.cpap.embrapa.br</a><br>
SKYPE: carlos.padovani<br>
<a moz-do-not-send="true" href="mailto:MSN%3Acrpadovani@hotmail.com"
target="_blank">MSN:crpadovani@hotmail.com</a><br>
<br>
<br>
</div>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
Carlos Padovani<br>
Pesquisador<br>
Embrapa Pantanal<br>
<a moz-do-not-send="true" href="http://www.cpap.embrapa.br">www.cpap.embrapa.br</a><br>
SKYPE: carlos.padovani<br>
<a moz-do-not-send="true" href="mailto:MSN%3Acrpadovani@hotmail.com">MSN:crpadovani@hotmail.com</a><br>
<br>
<br>
</blockquote>
</body>
</html>