Opened 15 years ago
Closed 15 years ago
#120 closed defect (invalid)
gdal_polygonize missing
Reported by: | lutra | Owned by: | warmerdam |
---|---|---|---|
Priority: | major | Component: | Package |
Version: | 1.0 | Keywords: | pkg-gdal16 |
Cc: |
Description
it seems that actually the installer do not install the gdal_polygonize script when choosing the gdal 1.6 version.
The lack of this tool do not allow the use of the "polygonize" tool in the "gdal tools" qgis plugin.
Change History (7)
comment:1 by , 15 years ago
Keywords: | pkg-gdal16 added |
---|---|
Owner: | changed from | to
follow-up: 3 comment:2 by , 15 years ago
Status: | new → assigned |
---|
comment:3 by , 15 years ago
Hi,
However, since GDAL 1.6 is not the primary GDAL version it is only put in C:\OSGeo4W\apps\gdal-16\bin which is only in the path after you run the gdal16.bat script.
strange, I cannot find gdal_poligonize anywhere in my osgeo4w installation that includes gdal-16
follow-up: 5 comment:4 by , 15 years ago
Short diagnostic:
- The batch files used to spawn qgis call
gdal16.bat
gdal_polygonize(.bat)
is a batch file inapps/gdal-16/bin
- calling
gdal_polygonize
from the QGIS' GRASS shell (just for the environment) gives:Traceback (most recent call last): File "C:\OSGeo4W\apps\gdal-16\bin\gdal_polygonize.py", line 34, in <module> import gdal, ogr, osr File "C:\OSGeo4W\apps\Python25\lib\site-packages\gdal.py", line 2, in <module> File "C:\OSGeo4W\apps\Python25\lib\site-packages\osgeo\gdal.py", line 7, in <module> ImportError: No module named _gdal
- Looks like the
PYTHONPATH
is messed up somehow%OSGEO4W_ROOT%\apps\gdal-16\pymod
is missing. Interestingly%OSGEO4W_ROOT%\apps\gdal-16\bin
is in thePATH
. - running
gdal16.bat
again prepends it to thePYTHONPATH
andgdal_polygonize
works.
comment:5 by , 15 years ago
Replying to jef:
- Looks like the
PYTHONPATH
is messed up somehow%OSGEO4W_ROOT%\apps\gdal-16\pymod
is missing. Interestingly%OSGEO4W_ROOT%\apps\gdal-16\bin
is in thePATH
.
Hm, but import gdal
works in the python console as sys.path
contains %OSGEO4W_ROOT%\apps\gdal-16\pymod
.
comment:6 by , 15 years ago
I see gdal_polygonize.py and gdal_polygonize.bat in the gdal-16-python tar file. I trust this package is installed?
From the above comments it appears the problem is related to transporting the right environment to qgis on startup.
comment:7 by , 15 years ago
Resolution: | → invalid |
---|---|
Status: | assigned → closed |
In OsGEO4W installation, the gdal_polygonize.bat is in the gdal-16-python package.
If the gdal-16-python package is installed, running either qgis-dev.bat (after installing the qgis-dev package) or qgis.bat (after running gdal16.bat to set env vars), the polygonize tool works fine.
On review, it appears gdal_polygonize is being installed as part of the gdal16 package.
However, since GDAL 1.6 is not the primary GDAL version it is only put in C:\OSGeo4W\apps\gdal-16\bin which is only in the path after you run the gdal16.bat script.
I think if QGIS's gdal tools intend to run the 1.6 tools, this bin directory should be prepended to the path in some fashion for qgis.