<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi again,<br>I tried yesterday the option "-ot UInt16" but the result was the same. <br><br>This is the result os executing "gdalinfo -stats":<br><br>Driver: EHdr/ESRI .hdr Labelled<br>Files: prueba.bil<br> prueba.hdr<br> prueba.stx<br>Size is 4000, 4000<br>Coordinate System is `'<br>Origin = (504815.000000000000000,4766395.000000000000000)<br>Pixel Size = (10.000000000000000,-10.000000000000000)<br>Corner Coordinates:<br>Upper Left ( 504815.000, 4766395.000)<br>Lower Left ( 504815.000, 4726395.000)<br>Upper Right ( 544815.000, 4766395.000)<br>Lower Right ( 544815.000, 4726395.000)<br>Center ( 524815.000, 4746395.000)<br>Band 1 Block=4000x1 Type=UInt16, ColorInterp=Undefined<br> Min=87.000 Max=263.000<br> Minimum=87.000, Maximum=263.000, Mean=220.726, StdDev=23.721<br><br>You gave me a great idea, I think PNG supports UInt16 but I'v tried using -ot BYTE and it works. <br>Thanks you very very much for your help. You saved my life!!<br><br>Regards. <br>Belén Muñoz.<br><br><div><hr id="stopSpelling">From: daniele.romagnoli@geo-solutions.it<br>Date: Wed, 30 Jul 2014 12:58:44 +0200<br>Subject: Re: [gdal-dev] Problem with BIL files and GDAL<br>To: beln1@hotmail.com<br>CC: gdal-dev@lists.osgeo.org<br><br><div dir="ltr"><div><div><div>Hi,<br></div>Since we are here, you could re-run gdalinfo -stats on your dataset. (Maybe you see a black image due to a dynamic concentrated on low values).<br></div><div>Moreover you may consider using the "-scale" option on gdal_translate to scale your values to byte or make sure to preserve the output type with the option "-OT UInt16".<br>
</div>Honestly, I don't remember if PNG support 16 bits (But would say "yes") and if the tool/browser/what else you will use to open it will show you correctly.<br><br></div>Hope this helps.<br>Regards,<br>
Daniele<br>
</div><div class="ecxgmail_extra"><br clear="all"><div><div dir="ltr">==<br>
GeoServer Professional Services from the experts! Visit<br>
<a href="http://goo.gl/NWWaa2" target="_blank">http://goo.gl/NWWaa2</a> for more information.<br>
==<br>
<br>Ing. Daniele Romagnoli<br>Senior Software Engineer<br><br>GeoSolutions S.A.S.<br>Via Poggio alle Viti 1187<br>55054 Massarosa (LU)<br>Italy<br>phone: +39 0584 962313<br>fax: +39 0584 1660272<br><br><a href="http://www.geo-solutions.it" target="_blank">http://www.geo-solutions.it</a><br>
<a href="http://twitter.com/geosolutions_it" target="_blank">http://twitter.com/geosolutions_it</a><br><br>-------------------------------------------------------<br></div></div>
<br><br><div class="ecxgmail_quote">On Wed, Jul 30, 2014 at 12:26 PM, Belén <span dir="ltr"><<a href="mailto:beln1@hotmail.com" target="_blank">beln1@hotmail.com</a>></span> wrote:<br><blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex;">
<div><div dir="ltr">Hi Daniele,<br>Thank you for your answer.<br>This is the output of gdalinfo:<br><br>Driver: EHdr/ESRI .hdr Labelled<br>Files: prueba.bil<br> prueba.hdr<br>Size is 4000, 4000<br>Coordinate System is `'<br>
Origin = (504815.000000000000000,4766395.000000000000000)<br>Pixel Size = (10.000000000000000,-10.000000000000000)<br>Corner Coordinates:<br>Upper Left ( 504815.000, 4766395.000)<br>Lower Left ( 504815.000, 4726395.000)<br>
Upper Right ( 544815.000, 4766395.000)<br>Lower Right ( 544815.000, 4726395.000)<br>Center ( 524815.000, 4746395.000)<br>Band 1 Block=4000x1 Type=UInt16, ColorInterp=Undefined<br><br>Thank you again!!<br><br>Regards.<br>
Belén Muñoz.<br><div class="ecxhm ecxHOEnZb"><br></div><div><div class="ecxhm ecxHOEnZb"><hr>From: <a href="mailto:daniele.romagnoli@geo-solutions.it" target="_blank">daniele.romagnoli@geo-solutions.it</a><br>Date: Wed, 30 Jul 2014 12:20:09 +0200<br>
Subject: Re: [gdal-dev] Problem with BIL files and GDAL<br>To: <a href="mailto:beln1@hotmail.com" target="_blank">beln1@hotmail.com</a><br>CC: <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a></div>
<div><div class="h5"><br><br><div dir="ltr"><div><div>Hi,<br></div>could you run a gdalinfo on your origin file and provide us the output?<br>Wondering if its datatype is float and a straight gdal_translate (without scaling applied) truncate all values when going to Byte PNG.<br>
<br></div>Cheers,<br>Daniele<br></div><div><br clear="all"><div><div dir="ltr">==<br>
GeoServer Professional Services from the experts! Visit<br>
<a href="http://goo.gl/NWWaa2" target="_blank">http://goo.gl/NWWaa2</a> for more information.<br>
==<br>
<br>Ing. Daniele Romagnoli<br>Senior Software Engineer<br><br>GeoSolutions S.A.S.<br>Via Poggio alle Viti 1187<br>55054 Massarosa (LU)<br>Italy<br>phone: <a target="_blank">+39 0584 962313</a><br>
fax: <a target="_blank">+39 0584 1660272</a><br><br><a href="http://www.geo-solutions.it" target="_blank">http://www.geo-solutions.it</a><br>
<a href="http://twitter.com/geosolutions_it" target="_blank">http://twitter.com/geosolutions_it</a><br><br>-------------------------------------------------------<br></div></div>
<br><br><div>On Wed, Jul 30, 2014 at 11:22 AM, Belén <span dir="ltr"><<a href="mailto:beln1@hotmail.com" target="_blank">beln1@hotmail.com</a>></span> wrote:<br><blockquote style="border-left:1px #ccc solid;padding-left:1ex;">
<div><div dir="ltr">Hello!<br>My name is Belén and i'm trying to convert a .bil file (.bil and .hdr) to a .png using gdal_translate, it seems to work fine, there are no error messages but when I open the .png file, I only have a big completely black square.<br>
There's some special thing I should be doing? I'd appreciate any help, because I'm completely lost.<br><br>Thank you very much in advance.<br><br>Regards.<br><br>Belén Muñoz.<br> </div></div>
<br>_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br></blockquote></div><br></div></div></div></div> </div></div>
</blockquote></div><br></div></div> </div></body>
</html>