<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi,<br>
<br>
Can you please list the versions of libgdal and python-gdal that
are installed on your machine?<br>
<br>
Best,<br>
Angelos<br>
<br>
On 10/14/2016 06:41 AM, alassane toure wrote:<br>
</div>
<blockquote
cite="mid:CAC0_KadgZM2HUB14fY+K16qKYs_caWZpv-SZ+x9eYZ3y3sHEzQ@mail.gmail.com"
type="cite">
<pre wrap="">Even,
I tried the followings but the response did not change...
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install python-gdal
Any suggestions?
Thanks,
Alassane
On Thu, Sep 8, 2016 at 3:51 AM, Even Rouault <a class="moz-txt-link-rfc2396E" href="mailto:even.rouault@spatialys.com"><even.rouault@spatialys.com></a>
wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Alassane,
</pre>
<blockquote type="cite">
<pre wrap="">I developed a gdal code on my local machine and it worked. Having gdal
</pre>
</blockquote>
<pre wrap="">and
</pre>
<blockquote type="cite">
<pre wrap="">g++ working on the server my compilation of the same code resulted in the
following response...
gcc -o applymask applymask.cpp -I /usr/include/gdal -lgdal -lm
applymask.cpp: In function âint main(int, char**)â:
applymask.cpp:63:95: warning: ignoring return value of âCPLErr
GDALRasterBand::RasterIO(GDALRWFlag, int, int, int, int, void*, int,
</pre>
</blockquote>
<pre wrap="">int,
</pre>
<blockquote type="cite">
<pre wrap="">GDALDataType, GSpacing, GSpacing, GDALRasterIOExtraArg*)â, declared with
attribute warn_unused_result [-Wunused-result]
Band->RasterIO( GF_Read, 0, iLine,nXSize, 1, inScanline, nXSize,
1, GDT_Float32,0, 0 );
^
applymask.cpp:64:101: warning: ignoring return value of âCPLErr
GDALRasterBand::RasterIO(GDALRWFlag, int, int, int, int, void*, int,
</pre>
</blockquote>
<pre wrap="">int,
</pre>
<blockquote type="cite">
<pre wrap="">GDALDataType, GSpacing, GSpacing, GDALRasterIOExtraArg*)â, declared with
attribute warn_unused_result [-Wunused-result]
maskBand->RasterIO( GF_Read, 0, iLine,nXSize, 1, maskScanline,
nXSize, 1, GDT_Float32,0, 0 );
^
applymask.cpp:75:94: warning: ignoring return value of âCPLErr
GDALRasterBand::RasterIO(GDALRWFlag, int, int, int, int, void*, int,
</pre>
</blockquote>
<pre wrap="">int,
</pre>
<blockquote type="cite">
<pre wrap="">GDALDataType, GSpacing, GSpacing, GDALRasterIOExtraArg*)â, declared with
attribute warn_unused_result [-Wunused-result]
outBand->RasterIO( GF_Write, 0, iLine,nXSize, 1, outScanline, nXSize,
</pre>
</blockquote>
<pre wrap="">1,
</pre>
<blockquote type="cite">
<pre wrap="">GDT_Float32,0, 0 );
</pre>
</blockquote>
<pre wrap="">
The warning says it all. You use GDALRasterBand::RasterIO() but do not
check
the return value. You probably don't get it on your local machine since it
might use an older version of GDAL where this method wasn't tagged with the
warn_unused_result attribute.
The right fix is to check the return value and do something appropriate.
Or you
can silence the warning by enclosing the calls in CPL_IGNORE_RET_VAL(...)
</pre>
<blockquote type="cite">
<pre wrap="">
Also, my python code does not import all refered libraries including
</pre>
</blockquote>
<pre wrap="">gdal.
</pre>
<blockquote type="cite">
<pre wrap="">
File "/usr/local/bin/CD4DEM.py", line 12, in <module>
import gdalImportError: No module named gdal
</pre>
</blockquote>
<pre wrap="">
Did you install the python-gdal package ?
Even
--
Spatialys - Geospatial professional services
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
</pre>
</blockquote>
<pre wrap="">
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
UbuntuGIS mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Ubuntu@lists.osgeo.org">Ubuntu@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/ubuntu">http://lists.osgeo.org/mailman/listinfo/ubuntu</a>
<a class="moz-txt-link-freetext" href="http://trac.osgeo.org/ubuntugis/wiki">http://trac.osgeo.org/ubuntugis/wiki</a></pre>
</blockquote>
<br>
<p><br>
</p>
<pre class="moz-signature" cols="72">--
Angelos Tzotsos, PhD
OSGeo Charter Member
<a class="moz-txt-link-freetext" href="http://users.ntua.gr/tzotsos">http://users.ntua.gr/tzotsos</a></pre>
</body>
</html>