[Qgis-developer] Setting Up Eclipse to develop with the PyQGIS API (reason: MrSID issues)

Bob English bobengl at gmail.com
Mon Aug 8 15:58:29 EDT 2011


Dear Devs,

I mistakenly first posted this to the archive list by mistake, so please
forgive any duplication. 

I searched the archives and found nothing on this topic, so I am posting
about it.  This may save new PyQGIS developers some time if they work in
Eclipse on MSWindows. 

I couldn't open a MrSID file in a PyQGIS app I am developing using the 1.6
API.  It turned out that the problem was my system environment wasn't
properly configured.  The main QGIS application runs from qgis.bat when
running on windows.  The qgis.bat runs a cascading set of .bat files that
sets a number of environment variables for the duration that QGIS runs. 

I solved my problem by modifying qgis.bat to start eclipse.  Thus all the
needed environment variables are properly set.  The code for the modified
qgis.bat is as follows: 

-------------------------------------------------- 
@echo off 

SET OSGEO4W_ROOT=C:\PROGRA~1\QUANTU~1 
call "%OSGEO4W_ROOT%"\bin\o4w_env.bat 
call "%OSGEO4W_ROOT%"\bin\gdal17.bat 
call "%OSGEO4W_ROOT%"\bin\grass-env.bat 
@echo off 

rem add %OSGEO4W_ROOT%\apps\qgis\bin for Copiapo only; Wroclaw has this
setting 
path %PATH%;%GISBASE%\bin;%OSGEO4W_ROOT%\apps\qgis\bin 
  
start "Eclipse" /B C:\eclipse-SDK-3.6.1-win32\eclipse\eclipse.exe %* 

rem start "Quantum GIS" /B "%OSGEO4W_ROOT%"\apps\qgis\bin\qgis.exe %* 
rem old eclipse Target C:\eclipse-SDK-3.6.1-win32\eclipse\eclipse.exe 
rem new eclipse Target C:\eclipse-SDK-3.6.1-win32\eclipse_qgis.bat 

--------------------------------------------------------------------------- 
So, just copy qgis.bat to your eclipse directory, rename it as
"eclipse_qgis.bat" and modify it as above (of course edit the path as
necessary to point to your eclipse.exe).  Then set the properties of your
application startup shortcut so that Target points to eclipse_qgis.bat as
indicated in the last 2 rem statements above. 

You still need to configure your project settings and python settings in
Eclipse, but the above should help. 

Thanks to Tim Sutton and Martin Dobias for pointing me in the right
direction! 
...Bob 


-----
Daystar
...computing and research services
367 Four Mile Brook Rd.
Northfield, MA 01360
Phone: (413)834-2076
Fax: (978)882-0243
bobengl at gmail.com
Check out the updated CV/Resume:
http://edaystar.com
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Setting-Up-Eclipse-to-develop-with-the-PyQGIS-API-reason-MrSID-issues-tp6665656p6665656.html
Sent from the qgis-developer mailing list archive at Nabble.com.


More information about the Qgis-developer mailing list