[gdal-dev] [gdal Python] Exceptions not reset correctly if gdal.UseExceptions() is used
Hi all, I suspect there is a bug in gdal.UseExceptions() in python binding. I noticed that if a RuntimeError has been generated, following gdal instructions *raise the same exception*. It seems that a gdal.ErrorReset() is necessary to reset it. An example with ipython: In [2]: from osgeo import gdal In [3]: gdal.UseExceptions() In [4]: dataset = gdal.Open('./filename.wrongformat') --- RuntimeError Traceback (most recent call last) /home/fasano/Desktop/test/ipython console in module() RuntimeError: `./filename.wrongformat' not recognised as a supported file format. In [5]: gdal.GetCacheMax() --- RuntimeError Traceback (most recent call last) /home/fasano/Desktop/test/ipython console in module() RuntimeError: `./filename.wrongformat' not recognised as a supported file format. In [6]: gdal.ErrorReset() In [7]: gdal.GetCacheMax() Out[7]: 41943040 (My gdal version is 1.5.4) ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] Setting GDAL Http Fetcher
Can I programatically change the http fetcher that GDAL uses for WMS without recompiling GDAL? Thanks! -- http://giscoder.blogspot.com/ ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
RE: [gdal-dev] Errors in compiling GDAL on a 64bits Linux
Hi Limei I used the following to build GDAL library on a 64-bit Linux Server. setenv CFLAGS -fPIC ./configure --prefix=/home/sgong/build_openev2/dist --with-png=internal --with-libtiff=internal --with-gif=internal --with-geotiff=internal --with-libz=/home/sgong/build_openev2/dist --with-jpeg=/home/sgong/build_openev2/dist --with-netcdf=/home/sgong/build_openev2/dist --with-hdf4=/home/sgong/build_openev2/dist --with-hdf5=/home/sgong/build_openev2/dist --without-ogdi --without-jasper --without-ecw --without-curl --without-expat --without-dwgdirect --without-mrsid --without-jp2mrsid --without-mysql --without-odbc --without-grib --without-pg --with-python basically, try to exclude as many as possible (like curl, expat, ogdi) thanks, Shawn -Original Message- From: gdal-dev-boun...@lists.osgeo.org [mailto:gdal-dev-boun...@lists.osgeo.org] On Behalf Of Limei Ran Sent: Thursday, June 18, 2009 12:18 PM To: gdal-dev@lists.osgeo.org Subject: [gdal-dev] Errors in compiling GDAL on a 64bits Linux Hi: I am compiling GDAL library on a 64bits Linux Server for our applications (we compiled correctly on a 32bits Linux Server). But, I ran into errors in compiling GDAL on the 64bits Linux. Could you check for me to see how I can solve the problem? I configured it using: ./configure --prefix=/nas/uncch/depts/cep/emc/lran/mims/sa_06_2009/src/libs/gdal-1.6 .1/local --with-static-proj4=/nas/uncch/depts/cep/emc/lran/mims/sa_06_2009/src/li bs/proj-4.6.1/local --with-hdf5=/nas/uncch/depts/cep/emc/lran/mims/sa_06_2009/src/libs/hdf5- 1.8.3/local --with-libtiff=internal Then, I type make and got the following error message after a long compiling: = ... libtool: link: warning: library `/afs/isis.unc.edu/pkg/oracle-1020/client//lib/libexpat.la' was moved. libtool: link: creating GNU ld script: .libs/libgdal.la.lnkscript libtool: link: g++ -shared -nostdlib /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.1.2/crtbeginS.o .libs/libgdal.la.lnkscript -Wl,-rpath -Wl,/nas/uncch/depts/cep/emc/lran/mims/sa_06_2009/src/libs/proj-4.6.1/lo cal/lib -Wl,-rpath -Wl,/afs/isis.unc.edu/pkg/oracle-1020/client//lib -Wl,-rpath -Wl,/nas/uncch/depts/cep/emc/lran/mims/sa_06_2009/src/libs/hdf5-1.8.3/lo cal/lib -Wl,-rpath -Wl,/nas/uncch/depts/cep/emc/lran/mims/sa_06_2009/src/libs/szip-2.1/loca l/lib -Wl,-rpath -Wl,/nas/uncch/depts/cep/emc/lran/mims/sa_06_2009/src/libs/proj-4.6.1/lo cal/lib -Wl,-rpath -Wl,/afs/isis.unc.edu/pkg/oracle-1020/client//lib -Wl,-rpath -Wl,/nas/uncch/depts/cep/emc/lran/mims/sa_06_2009/src/libs/hdf5-1.8.3/lo cal/lib -Wl,-rpath -Wl,/nas/uncch/depts/cep/emc/lran/mims/sa_06_2009/src/libs/szip-2.1/loca l/lib -L/nas/uncch/depts/cep/emc/lran/mims/sa_06_2009/src/libs/proj-4.6.1/loca l/lib /nas/uncch/depts/cep/emc/lran/mims/sa_06_2009/src/libs/proj-4.6.1/local/ lib/libproj.so -lsqlite3 -L/afs/isis.unc.edu/pkg/oracle-1020/client//lib -lclntsh -lnnz10 -L/usr/lib /afs/isis.unc.edu/pkg/oracle-1020/client//lib/libexpat.so -L/nas/uncch/depts/cep/emc/lran/mims/sa_06_2009/src/libs/hdf5-1.8.3/loca l/lib /nas/uncch/depts/cep/emc/lran/mims/sa_06_2009/src/libs/hdf5-1.8.3/local/ lib/libhdf5.so -L/nas/uncch/depts/cep/emc/lran/mims/sa_06_2009/src/libs/szip-2.1/local/ lib /nas/uncch/depts/cep/emc/lran/mims/sa_06_2009/src/libs/szip-2.1/local/li b/libsz.so -lgif -ljpeg -lpng -lz -lrt -ldl -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-redhat-linux/4.1.2/crtendS.o /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crtn.o -Wl,-soname -Wl,libgdal.so.1 -o .libs/libgdal.so.1.13.1 /afs/isis.unc.edu/pkg/oracle-1020/client//lib/libexpat.so: could not read symbols: File in wrong format collect2: ld returned 1 exit status make[1]: *** [libgdal.la] Error 1 make[1]: Leaving directory `/nas/uncch/depts/cep/emc/lran/mims/sa_06_2009/src/libs/gdal-1.6.1' make: *** [check-lib] Error 2 === Thank you, Limei ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] gdaladdo
Hi, I am trying to tile and create overviews for a TIFF image dataset I have, but I keep getting strange errors when attempting to add overviews. 1st I created a copy of the original image (same format and all, but wanted to keep the original around in case I had problems). gdal_translate -ot Float32 -of GTiff Av.MaxNDVI.2000.2009.Week.19.tif trans/week19.tif cd trans Then I tiled the image (I guess I could have done this in one step by adding -co TILED=YES to the previous step): gdal_translate -ot Float32 -of GTiff -co TILED=YES week19.tif week19_tiled.tif Then I tried to add the overviews: gdaladdo -r average -ro week19_tiled.tif 2 4 8 16 I get the following (I've added some whitespace for clarity): 0...10...20...30...40...50...60...70... Warning 1: TIFFReadDirectory:week19_tiled.tif.ovr: Wrong StripByteCounts field, ignoring and calculating from imagelength Warning 1: TIFFReadDirectory:week19_tiled.tif.ovr: Wrong StripByteCounts field, ignoring and calculating from imagelength ERROR 1: week19_tiled.tif.ovr:DumpModeDecode: Not enough data for scanline 0 ERROR 1: TIFFReadEncodedTile() failed. ERROR 1: IReadBlock failed at X offset 0, Y offset 3 ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 3 I get effectively the same error when I run this without the -ro option. Any idea's what is going wrong. Regards, Craig Dillabaugh ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
RE: [gdal-dev] Errors in compiling GDAL on a 64bits Linux
/afs/isis.unc.edu/pkg/oracle-1020/client//lib/libexpat.so: could not read symbols: File in wrong format collect2: ld returned 1 exit status make[1]: *** [libgdal.la] Error 1 [Chandra ] it looks like it is getting linked against 32-bit libexpat.so Can you check the same by file path-to-libexpat/libexpat.so and let me know the result of the same ? ** This communication contains information which is confidential and may also be legally privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s), disclosure, copying, distribution, or other use of, or action taken or omitted to be taken in reliance upon, this communication or the information in it is prohibited and maybe unlawful. If you have received this communication in error please notify the sender by return email, delete it from your system and destroy any copies. ** ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] gdaladdo
Craig, This should work. Are you using an older GDAL version ? Are you using external libtiff ? If so, try again with newer GDAL and internal libtiff (although I wouldn't older GDAL to fail on a simple case like yours that doesn't involve TIFF compression) Le Thursday 18 June 2009 21:50:25 Dillabough, Craig, vous avez écrit : Hi, I am trying to tile and create overviews for a TIFF image dataset I have, but I keep getting strange errors when attempting to add overviews. 1st I created a copy of the original image (same format and all, but wanted to keep the original around in case I had problems). gdal_translate -ot Float32 -of GTiff Av.MaxNDVI.2000.2009.Week.19.tif trans/week19.tif cd trans Then I tiled the image (I guess I could have done this in one step by adding -co TILED=YES to the previous step): gdal_translate -ot Float32 -of GTiff -co TILED=YES week19.tif week19_tiled.tif Then I tried to add the overviews: gdaladdo -r average -ro week19_tiled.tif 2 4 8 16 I get the following (I've added some whitespace for clarity): 0...10...20...30...40...50...60...70... Warning 1: TIFFReadDirectory:week19_tiled.tif.ovr: Wrong StripByteCounts field, ignoring and calculating from imagelength Warning 1: TIFFReadDirectory:week19_tiled.tif.ovr: Wrong StripByteCounts field, ignoring and calculating from imagelength ERROR 1: week19_tiled.tif.ovr:DumpModeDecode: Not enough data for scanline 0 ERROR 1: TIFFReadEncodedTile() failed. ERROR 1: IReadBlock failed at X offset 0, Y offset 3 ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 3 I get effectively the same error when I run this without the -ro option. Any idea's what is going wrong. Regards, Craig Dillabaugh ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] Build OGR with Oracle support
Normand, Just a quick complimentary reference: Instant Client allows you to run your applications without installing the standard Oracle client or having an ORACLE_HOME. OCI, OCCI, Pro*C, ODBC, and JDBC applications work without modification, while using significantly less disk space than before. Even SQL*Plus can be used with Instant Client. No recompile, no hassle. [http://www.oracle.com/technology/tech/oci/instantclient/index.html] But of course, running is one thing, compiling is another. Regards, Ivan Normand Savard wrote: Mateusz Loskot wrote: ./configure generates a log file called config.log. If something goes wrong, there should be some diagnostic in this file. It would be helpful if you could share it, for instance, here: http://pastebin.com/ This will help to find what's the problem. Maateusz, You were right, this help a lot. I succeeded to build OGR with Oracle 10g and 11g but for those who may come on a similar issue in the future, I'm posting the process I went through. I downloaded oracle-instantclient-basic-10.2.0.4-1.i386.zip (library) oracle-instantclient-devel-10.2.0.4-1.i386.zip (headers) or instantclient-basic-linux32-11.1.0.7.zip (library) instantclient-sdk-linux32-11.1.0.7.zip (headers) As suggested I checked the config.log (see 1) and noticed that there was a link problem (-lclntsh). I went to the instantclient directory to check for libclntsh.so, but it was not there. So I added a link to libclntsh.so.11.1. I redid the configure and checked the config.log again (see 2). I noticed that libnnz11.so library was not found. I went to the instantclient directory but the library was present. Since I use the fgs-dev environment the libraries are not in a traditional path so the linker could not find it. To solve this issue, I added the path to where the library was installed to $LD_LIBRARY_PATH. There was a problem with libaio.so.1 library. For this particular issue I had to install libaio-dev on my system (Ubuntu: apt-get install). It works fine after that. Thank you to both of you. Norm 1)config.log configure:23653: checking for Oracle OCI headers in /home/fgs/fgs-dev/built/ins\ tantclient_11_1/sdk/include configure:23696: g++ -c -fPIC -g -DDEBUG -I/home/fgs/fgs-dev/built/instantcli\ ent_11_1/sdk/include conftest.cpp 5 configure:23702: $? = 0 configure:23715: result: yes configure:23740: checking for Oracle OCI libraries in /home/fgs/fgs-dev/built/i\ nstantclient_11_1 configure:23743: result: norm: -L/home/fgs/fgs-dev/built/instantclient_11_1 -lc\ lntsh configure:23745: result: norm: -I/home/fgs/fgs-dev/built/instantclient_11_1/sdk\ /include configure:23781: g++ -o conftest -fPIC -g -DDEBUG -I/home/fgs/fgs-dev/built/i\ nstantclient_11_1/sdk/include -L/home/fgs/fgs-dev/built/instantclient_11_1 -lc\ lntsh conftest.cpp -L/home/fgs/fgs-dev/built/jpeg -L/home/fgs/fgs-dev/built/jpe\ g/lib -ljpeg -L/home/fgs/fgs-dev/built/libgeotiff/lib -lgeotiff -L/home/fgs/fgs\ -dev/built/tiff/lib -ltiff -L/home/fgs/fgs-dev/built/libpng -L/home/fgs/fgs-dev\ /built/libpng/lib -lpng -lpq -L/home/fgs/fgs-dev/built/postgresql/lib -lpq -lz \ -L/home/fgs/fgs-dev/built/zlib -L/home/fgs/fgs-dev/built/zlib/lib -lm -lrt -ld\ l 5 /usr/bin/ld: cannot find -lclntsh collect2: ld returned 1 exit status configure:23787: $? = 1 configure: failed program was: | | /* confdefs.h. */ | #define PACKAGE_NAME | #define PACKAGE_TARNAME 2) config.log configure:23740: checking for Oracle OCI libraries in /home/fgs/fgs-dev/built/i\ nstantclient_11_1 configure:23743: result: norm: -L/home/fgs/fgs-dev/built/instantclient_11_1 -lc\ lntsh configure:23745: result: norm: -I/home/fgs/fgs-dev/built/instantclient_11_1/sdk\ /include configure:23781: g++ -o conftest -fPIC -g -DDEBUG -I/home/fgs/fgs-dev/built/i\ nstantclient_11_1/sdk/include -L/home/fgs/fgs-dev/built/instantclient_11_1 -lc\ lntsh conftest.cpp -L/home/fgs/fgs-dev/built/jpeg -L/home/fgs/fgs-dev/built/jpe\ g/lib -ljpeg -L/home/fgs/fgs-dev/built/libgeotiff/lib -lgeotiff -L/home/fgs/fgs\ -dev/built/tiff/lib -ltiff -L/home/fgs/fgs-dev/built/libpng -L/home/fgs/fgs-dev\ /built/libpng/lib -lpng -lpq -L/home/fgs/fgs-dev/built/postgresql/lib -lpq -lz \ -L/home/fgs/fgs-dev/built/zlib -L/home/fgs/fgs-dev/built/zlib/lib -lm -lrt -ld\ l 5 /usr/bin/ld: warning: libnnz11.so, needed by /home/fgs/fgs-dev/built/instantcli\ ent_11_1/libclntsh.so, not found (try using -rpath or -rpath-link) /usr/bin/ld: warning: libaio.so.1, needed by /home/fgs/fgs-dev/built/instantcli\ ent_11_1/libclntsh.so, not found (try using -rpath or -rpath-link) /home/fgs/fgs-dev/built/instantclient_11_1/libclntsh.so: undefined reference to\ `nzos_ServiceWriteQueue' /home/fgs/fgs-dev/built/instantclient_11_1/libclntsh.so: undefined reference to\ `nzosCipherSpecToStr' /home/fgs/fgs-dev/built/instantclient_11_1/libclntsh.so: undefined reference to\ `C_SetCRLBER'
Re: [gdal-dev] Setting GDAL Http Fetcher
I don't understand your question. You should provide more details on what you want to do exactly Le Thursday 18 June 2009 18:31:20 Joel Odom, vous avez écrit : Can I programatically change the http fetcher that GDAL uses for WMS without recompiling GDAL? Thanks! ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] Setting GDAL Http Fetcher
No mind readers here? :-) Let me explain. The WMS data source uses libcurl to fetch http requests. I'd like to put a different engine in to fetch http requests so that I can handle some other protocols (actually I'm using libcurl myself with some helper functions). I was wondering if I could instruct the WMS data source to use the methods that I have to fetch http requests instead of using its internal handlers. Thanks! On Thu, Jun 18, 2009 at 4:47 PM, Even Rouault even.roua...@mines-paris.orgwrote: I don't understand your question. You should provide more details on what you want to do exactly Le Thursday 18 June 2009 18:31:20 Joel Odom, vous avez écrit : Can I programatically change the http fetcher that GDAL uses for WMS without recompiling GDAL? Thanks! -- http://giscoder.blogspot.com/ ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] Re: GDAL/ArcObjects based app crashes with newer GDAL versions (was How to delete shapefile)
Clay, Bruce wrote: If I try to link to the gdal_i.lib then the program does not crash but it does not let me step into any of the methods even though it is a debug library and no GDAL functions work. This is unrelated to GDAL. You better refer MSDN to solve this kind of problems. This should help too: http://www.wintellect.com/CS/blogs/jrobbins/archive/2009/05/11/pdb-files-what-every-developer-must-know.aspx You mentioned configuration. Does GDAL 1.6 and new code require some configuration on Windows XP that was not required before? I meant configuration of your environment: installation of GDAL, building configuration of you program, ensure you are linking against binaries you are expecting and you are including coresponsding headers in case you host more than one version of GDAL on your machine, etc. Meaning, factors unrelated to GDAL, but your system, that may cause problems. Best regards, -- Mateusz Loskot, http://mateusz.loskot.net Charter Member of OSGeo, http://osgeo.org ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] Setting GDAL Http Fetcher
You need to hack into GDAL itself then. Le Thursday 18 June 2009 23:42:44 Joel Odom, vous avez écrit : No mind readers here? :-) Let me explain. The WMS data source uses libcurl to fetch http requests. I'd like to put a different engine in to fetch http requests so that I can handle some other protocols (actually I'm using libcurl myself with some helper functions). I was wondering if I could instruct the WMS data source to use the methods that I have to fetch http requests instead of using its internal handlers. Thanks! On Thu, Jun 18, 2009 at 4:47 PM, Even Rouault even.roua...@mines-paris.orgwrote: I don't understand your question. You should provide more details on what you want to do exactly Le Thursday 18 June 2009 18:31:20 Joel Odom, vous avez écrit : Can I programatically change the http fetcher that GDAL uses for WMS without recompiling GDAL? Thanks! ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev