<div dir="ltr">Angelos,<div>Adding the following to the code works...</div><div><br></div><div><h2 class="gmail-color_black gmail-normal gmail-bold gmail-fontSize_3 gmail-margin12 gmail-onlyBottomMargin" tabindex="-1" style="box-sizing:inherit;background-repeat:no-repeat;margin:0px 0px 12px;font-weight:400;font-family:neuehaasgrotesktextbold,arial,helvetica,sans-serif;color:rgb(0,0,0)"><font size="2">sys.path.insert(0,"/usr/lib/python2.7/dist-packages")</font></h2></div><div><font size="2">is there any other way to avoid adding this line?</font></div><div><font size="2"><br></font></div><div><font size="2">Regards,</font></div><div><font size="2">Alassane</font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 24, 2016 at 9:03 AM, Angelos Tzotsos <span dir="ltr"><<a href="mailto:gcpp.kalxas@gmail.com" target="_blank">gcpp.kalxas@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Sorry for the delayed response.<br>
Is this issue still open?<br>
<br>
Best,<br>
Angelos<div><div class="h5"><br>
<br>
On 10/14/2016 03:23 PM, alassane toure wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Not sure how to obtain the installed version for python-gdal but here is<br>
how i installed it (if that can help)<br>
<br>
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstab<wbr>le<br>
sudo apt-get update<br>
sudo apt-get install python-gdal<br>
<br>
Thanks for your suggestions<br>
<br>
Alassane<br>
<br>
On Fri, Oct 14, 2016 at 8:16 AM, alassane toure <<a href="mailto:atourej@gmail.com" target="_blank">atourej@gmail.com</a>> wrote:<br>
<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
GDAL is 1.11.2 as I had other issues with 2.1.0. and python-gdal has to be<br>
the most recent one. I will let you know as soon i get on the server.<br>
<br>
Thanks.<br>
<br>
Alassane<br>
<br>
On Fri, Oct 14, 2016 at 4:28 AM, Angelos Tzotsos <<a href="mailto:gcpp.kalxas@gmail.com" target="_blank">gcpp.kalxas@gmail.com</a>><br>
wrote:<br>
<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Hi,<br>
<br>
Can you please list the versions of libgdal and python-gdal that are<br>
installed on your machine?<br>
<br>
Best,<br>
Angelos<br>
<br>
<br>
On 10/14/2016 06:41 AM, alassane toure wrote:<br>
<br>
Even,<br>
<br>
I tried the followings but the response did not change...<br>
<br>
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstab<wbr>le<br>
sudo apt-get update<br>
sudo apt-get install python-gdal<br>
<br>
Any suggestions?<br>
Thanks,<br>
Alassane<br>
<br></div></div>
On Thu, Sep 8, 2016 at 3:51 AM, Even Rouault <<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>> <<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>><div><div class="h5"><br>
wrote:<br>
<br>
<br>
Alassane,<br>
<br>
<br>
I developed a gdal code on my local machine and it worked. Having gdal<br>
<br>
and<br>
<br>
g++ working on the server my compilation of the same code resulted in the<br>
following response...<br>
<br>
gcc -o applymask applymask.cpp -I /usr/include/gdal -lgdal -lm<br>
applymask.cpp: In function âint main(int, char**)â:<br>
applymask.cpp:63:95: warning: ignoring return value of âCPLErr<br>
GDALRasterBand::RasterIO(GDALR<wbr>WFlag, int, int, int, int, void*, int,<br>
<br>
int,<br>
<br>
GDALDataType, GSpacing, GSpacing, GDALRasterIOExtraArg*)â, declared with<br>
attribute warn_unused_result [-Wunused-result]<br>
Band->RasterIO( GF_Read, 0, iLine,nXSize, 1, inScanline, nXSize,<br>
1, GDT_Float32,0, 0 );<br>
<br>
^<br>
applymask.cpp:64:101: warning: ignoring return value of âCPLErr<br>
GDALRasterBand::RasterIO(GDALR<wbr>WFlag, int, int, int, int, void*, int,<br>
<br>
int,<br>
<br>
GDALDataType, GSpacing, GSpacing, GDALRasterIOExtraArg*)â, declared with<br>
attribute warn_unused_result [-Wunused-result]<br>
maskBand->RasterIO( GF_Read, 0, iLine,nXSize, 1, maskScanline,<br>
nXSize, 1, GDT_Float32,0, 0 );<br>
<br>
^<br>
applymask.cpp:75:94: warning: ignoring return value of âCPLErr<br>
GDALRasterBand::RasterIO(GDALR<wbr>WFlag, int, int, int, int, void*, int,<br>
<br>
int,<br>
<br>
GDALDataType, GSpacing, GSpacing, GDALRasterIOExtraArg*)â, declared with<br>
attribute warn_unused_result [-Wunused-result]<br>
outBand->RasterIO( GF_Write, 0, iLine,nXSize, 1, outScanline, nXSize,<br>
<br>
1,<br>
<br>
GDT_Float32,0, 0 );<br>
<br>
<br>
The warning says it all. You use GDALRasterBand::RasterIO() but do not<br>
check<br>
the return value. You probably don't get it on your local machine since it<br>
might use an older version of GDAL where this method wasn't tagged with the<br>
warn_unused_result attribute.<br>
<br>
The right fix is to check the return value and do something appropriate.<br>
Or you<br>
can silence the warning by enclosing the calls in CPL_IGNORE_RET_VAL(...)<br>
<br>
<br>
Also, my python code does not import all refered libraries including<br>
<br>
gdal.<br>
<br>
File "/usr/local/bin/CD4DEM.py", line 12, in <module><br>
import gdalImportError: No module named gdal<br>
<br>
Did you install the python-gdal package ?<br>
<br>
Even<br>
<br>
--<br>
Spatialys - Geospatial professional serviceshttp://<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">www.spatialys.c<wbr>om</a><br>
<br>
<br>
<br>
______________________________<wbr>_________________<br></div></div>
UbuntuGIS mailing listUbuntu@lists.osgeo.orghttp<wbr>://<a href="http://lists.osgeo.org/mailman/listinfo/ubuntuhttp://trac.osgeo.org/ubuntugis/wiki" rel="noreferrer" target="_blank">lists.osgeo.org/mailman/<wbr>listinfo/ubuntuhttp://trac.<wbr>osgeo.org/ubuntugis/wiki</a><span class=""><br>
<br>
<br>
<br>
--<br>
Angelos Tzotsos, PhD<br>
OSGeo Charter Memberhttp://<a href="http://users.ntua.gr/tzotsos" rel="noreferrer" target="_blank">users.ntua.gr/tzo<wbr>tsos</a><br>
<br>
<br>
</span></blockquote></blockquote></blockquote><div class="HOEnZb"><div class="h5">
<br>
<br>
-- <br>
Angelos Tzotsos, PhD<br>
OSGeo Charter Member<br>
<a href="http://users.ntua.gr/tzotsos" rel="noreferrer" target="_blank">http://users.ntua.gr/tzotsos</a><br>
<br>
</div></div></blockquote></div><br></div>