Re: [gdal-dev] Problem with GDAL Python bindings and ECW format under Windows

2011-01-25 Thread Ivan Lucena
Alain,

Do you have the GDAL_DRIVER_PATH environment variable set on your Windows 
system?

C:\echo %GDAL_DRIVER_PATH%
C:\Apps\GDAL\bin\gdalplugins

That is what going to make the GDAL dll inside the Python process to find the 
plugins. GDAL command line tools doesn't need that because they get it from a 
default path relative to where they are installed .\gdalplugins.

Regards,

Ivan


  ---Original Message---
  From: Alain Cembro acem...@yahoo.com
  To: gdal-dev@lists.osgeo.org
  Subject: [gdal-dev] Problem with GDAL Python bindings and ECW format under 
 Windows
  Sent: Jan 25 '11 10:25
  
  Hello list,
  I have written a Python program to create ECW files. It is working fine 
 under Linux, but not under Windows XP.
  I have installed :
  - Python 2.6.6 (the official version)
  - gdal-18-1500-core.msi
  - gdal-18-1500-ecw.msi
  - GDAL-1.8.0.win32-py2.6.exe
  I downloaded the last three files at http://vbkto.dyndns.org/sdk/
  
  GDAL is working :
  - gdalinfo lists the ECW format as available (rw).
  - I can create ECW files with gdal_translate.
  
  But in a Python console, osgeo.gdal.getDriverByName(ECW) return None.
  Is it a known problem, or is there something wrong in my installation ?
  
  Thanks for any help.
  
  
  
    
  ___
  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] Problem with GDAL Python bindings and ECW format under Windows

2011-01-25 Thread Alain Cembro
--- On Tue, 1/25/11, Ivan Lucena ivan.luc...@pmldnet.com wrote:

 Do you have the GDAL_DRIVER_PATH environment variable set
 on your Windows system?
 
 C:\echo %GDAL_DRIVER_PATH%
 C:\Apps\GDAL\bin\gdalplugins

Ivan,
You are right, I forgot to set that variable. Now it is working. Thank you very 
much !

Tamas,
Could you improve the Windows GDAL installer, so that it automatically sets the 
environment variables (GDAL_DATA and GDAL_DRIVER_PATH), and adds the GDAL 
binaries path to the PATH environment variable ?

Thanks !


  
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


RE: [gdal-dev] Problem with GDAL Python bindings and ECW format under Windows

2011-01-25 Thread Jason Roberts
Alain

I think the solution that Tamas proposed for that problem is not to
automatically set the environment variables, but instead to modify the GDAL
core installer to store the installation location in the registry and then
have the Python bindings read it and initialize GDAL by calling appropriate
GDAL functions. This solution would eliminate the need to set the
environment variables. For more information, review the long discussion on
the gdal-dev list for this from a couple of weeks ago.

(Tamas, correct me if I'm wrong about your proposal. And sorry I have not
had time to test it myself yet...)

Jason

-Original Message-
From: gdal-dev-boun...@lists.osgeo.org
[mailto:gdal-dev-boun...@lists.osgeo.org] On Behalf Of Alain Cembro
Sent: Tuesday, January 25, 2011 11:31 AM
To: gdal-dev@lists.osgeo.org
Subject: Re: [gdal-dev] Problem with GDAL Python bindings and ECW format
under Windows

--- On Tue, 1/25/11, Ivan Lucena ivan.luc...@pmldnet.com wrote:

 Do you have the GDAL_DRIVER_PATH environment variable set
 on your Windows system?
 
 C:\echo %GDAL_DRIVER_PATH%
 C:\Apps\GDAL\bin\gdalplugins

Ivan,
You are right, I forgot to set that variable. Now it is working. Thank you
very much !

Tamas,
Could you improve the Windows GDAL installer, so that it automatically sets
the environment variables (GDAL_DATA and GDAL_DRIVER_PATH), and adds the
GDAL binaries path to the PATH environment variable ?

Thanks !


  
___
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] Problem with GDAL Python bindings and ECW format under Windows

2011-01-25 Thread Tamas Szekeres
2011/1/25 Jason Roberts jason.robe...@duke.edu

 Tamas,
 Could you improve the Windows GDAL installer, so that it automatically sets
 the environment variables (GDAL_DATA and GDAL_DRIVER_PATH), and adds the
 GDAL binaries path to the PATH environment variable ?



I will  do some improvements in the installers to make the things easier.
Modifying the environment should only be happen upon the user's request and
shouldn't be done automatically in my opinion. I would create a custom
dialog in the installer where the user can allow this setting to be happen.

Best regards,

Tamas
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

RE: [gdal-dev] Problem with GDAL Python bindings and ECW format under Windows

2011-01-25 Thread Jason Roberts
Tamas,

 

Are you still planning to implement the registry-based approach? I ask because 
you seemed in favor of avoiding modifying PATH, if at all possible (a position 
I agree with), and the registry approach would eliminate that need while still 
making GDAL + bindings “just work”.

 

Thanks,

jason

 

From: Tamas Szekeres [mailto:szeker...@gmail.com] 
Sent: Tuesday, January 25, 2011 3:03 PM
To: Jason Roberts
Cc: Alain Cembro; gdal-dev@lists.osgeo.org
Subject: Re: [gdal-dev] Problem with GDAL Python bindings and ECW format under 
Windows

 

 

2011/1/25 Jason Roberts jason.robe...@duke.edu

Tamas,
Could you improve the Windows GDAL installer, so that it automatically sets
the environment variables (GDAL_DATA and GDAL_DRIVER_PATH), and adds the
GDAL binaries path to the PATH environment variable ?



I will  do some improvements in the installers to make the things easier. 
Modifying the environment should only be happen upon the user's request and 
shouldn't be done automatically in my opinion. I would create a custom dialog 
in the installer where the user can allow this setting to be happen.

Best regards,

Tamas



___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] Problem with GDAL Python bindings and ECW format under Windows

2011-01-25 Thread Tamas Szekeres
2011/1/25 Jason Roberts jason.robe...@duke.edu

 Tamas,



 Are you still planning to implement the registry-based approach? I ask
 because you seemed in favor of avoiding modifying PATH, if at all possible
 (a position I agree with), and the registry approach would eliminate that
 need while still making GDAL + bindings “just work”.



Jason,

As the time permits, I'll do some tests in this regard. Since not only the
PATH, but other environment settings should also be applied, I consider a
bootstrap dll to be implemented for all bindings. The only issue is that
where to place this dll file to make it available for all for all bindings
to load. May be into the system directory (?)

Best regards,

Tamas
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

RE: [gdal-dev] Problem with GDAL Python bindings and ECW format under Windows

2011-01-25 Thread Jason Roberts
Rather than introduce a DLL into the system directory, why not statically link 
the code into the bindings themselves, when possible? Or document the 
appropriate logic for doing it with win32 functions (registry functions, 
LoadLibrary, GetProcAddress) and allow the bindings to make those calls 
themselves? Most languages have a way to access win32 functions. It just seems 
unnecessarily risky and complicated to create a new DLL and put it in the 
system directory, IMHO.

 

Jason

 

From: Tamas Szekeres [mailto:szeker...@gmail.com] 
Sent: Tuesday, January 25, 2011 5:30 PM
To: Jason Roberts
Cc: gdal-dev@lists.osgeo.org
Subject: Re: [gdal-dev] Problem with GDAL Python bindings and ECW format under 
Windows

 

2011/1/25 Jason Roberts jason.robe...@duke.edu

Tamas,

 

Are you still planning to implement the registry-based approach? I ask because 
you seemed in favor of avoiding modifying PATH, if at all possible (a position 
I agree with), and the registry approach would eliminate that need while still 
making GDAL + bindings “just work”.

 

Jason,

As the time permits, I'll do some tests in this regard. Since not only the 
PATH, but other environment settings should also be applied, I consider a 
bootstrap dll to be implemented for all bindings. The only issue is that where 
to place this dll file to make it available for all for all bindings to load. 
May be into the system directory (?)

Best regards,

Tamas

 

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] Problem with GDAL Python bindings and ECW format under Windows

2011-01-25 Thread Christopher Barker

On 1/25/11 2:57 PM, Jason Roberts wrote:

Rather than introduce a DLL into the system directory, why not
statically link the code into the bindings themselves, when possible?


we did go through that, and it's one option, but for those of us that 
use gdal with C programs, python, with the utilities, all -- it's nice 
to know that you're using the exact same version for everything.



document the appropriate logic for doing it with win32 functions
(registry functions, LoadLibrary, GetProcAddress) and allow the bindings
to make those calls themselves? Most languages have a way to access
win32 functions.


yeah, but ugly and platform dependent. (of course, I just have a 
distaste for the registry)


I thought we had more or less come up with a consensus that the language 
bindings (Python, anyway) would take care of finding gdal and setting up 
the environment, and that we would facility things just working by 
using standard install locations.


This would let casual users have a simple run the installers and it 
works experience, but more sophisticated users could easily customize 
their systems, have multiple versions installed, etc.


And no installers would set anything up system wide.

(though I have no problem with a check this if you want the Environment 
set up box in the gdal installer)





It just seems unnecessarily risky and complicated to
create a new DLL and put it in the system directory, IMHO.


agreed.

-Chris



--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/ORR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev