Hot answers tagged

64 votes
Accepted

GRASS not working with QGIS says This algorithm cannot be run

If I open QGIS with the shortcut "QGIS Desktop 3.6.0 with GRASS 7.6.0" everything works fine. If I open QGIS with the shortcut "QGIS Desktop 3.6.0" I get the same error as you. ...
user avatar
  • 1,231
52 votes

Installing File Geodatabase (*.gdb) support in QGIS

If you have QGIS running and compiled against GDAL 1.11.0, it now has native FileGDB support via the OpenFileGDB driver. To open a geodatabase in QGIS, be sure to choose "Add vector layer", "Source ...
user avatar
  • 9,941
48 votes
Accepted

What is OSGeo4W?

OSGeo: OSGeo is an umbrella organisation (Foundation) that supports many Open Source GIS Projects. Some of the more well known ones are: QGIS, GeoServer, and OpenLayers. Being part of OSGeo gives a ...
user avatar
37 votes

Using OSGeo4W shell with Python 3

There's no need to edit batch files (and break python 2.7 in the process) or set environment variables manually. Just run py3_env which sets the shell up for Python 3 automatically, then run python3. ...
user avatar
  • 52.6k
30 votes

Merging all tiles from one directory using GDAL

You could create a virtual mosaic from all Tiff files: gdalbuildvrt mosaic.vrt c:\data\....\*.tif and convert it afterwards: gdal_translate -of GTiff -co "COMPRESS=JPEG" -co "PHOTOMETRIC=YCBCR" -co ...
user avatar
  • 3,653
18 votes
Accepted

Using OSGeo4W shell with Python 3

There is a not well documented command build into OSGeo4W Shell which sets the shell up to python3 as Luke mentions py3_env Basically it sets your PYTHONHOME and the correct PATH. Then you can call ...
user avatar
  • 2,039
13 votes
Accepted

User Interface file compilation using OSGeo4W shell during qgis plugin creation

I will write a quick explanation of the pyuic4 and pyrcc4 commands for future reference. Most tutorials simply tell you to copy some code, but no one explains exactly what you are about to do. It is ...
user avatar
  • 6,249
12 votes
Accepted

Downgrade to long term release QGIS with OSGeo4W?

Using advanced install of the OSGEO4W installer, you can choose the package qgis-ltr. This will bring you the long term release qgis 2.8.x. QGIS 2.10.1 and ltr can be installed together (same as QGIS ...
user avatar
  • 75k
11 votes
Accepted

Convert raster to a CSV values and lat long based on raster value in QGIS

As GDAL supports writing to X,Y,Z (CSV) ascii, you could use gdal_translate: gdal_translate -of xyz -co ADD_HEADER_LINE=YES -co COLUMN_SEPARATOR="," input_raster output.csv To avoid writing NoData ...
user avatar
  • 52.6k
9 votes
Accepted

Can ogr2ogr write data to a file geodatabase feature dataset?

[Edited] If your feature classes are saved as *.shp, you could try: ogr2ogr -f "FileGDB" mygdb.gdb ~/PathTo/MyFeatureClass.shp -lco FEATURE_DATASET=my_features However, since you are exporting from ...
user avatar
  • 424
9 votes

What is OSGeo4W?

Look at the OSGeo: Open Source Geospatial Foundation site. You will see that they support Desktop applications (GRASS GIS, QGIS,...), Web Mapping projects (OpenLayers, GeoServer,MapServer ...), ...
user avatar
  • 51k
8 votes

How to install OSGeo4W libraries in older version of QGIS (2.16)?

OSGEO4W only offers the current point release, the one before (currently 2.18.3), and the dev and LTR version. For older Windows versions, you can still grab the standalone installer from http://...
user avatar
  • 75k
8 votes

Using OSGeo4W shell with Python 3

If you want to make the change permanent you can modify the batch file OSGeo4W.bat located in your QGIS (or OSGEO) directory and just add: call "py3_env" below the line calling call "%~dp0\bin\...
user avatar
  • 351
8 votes

GRASS not working with QGIS says This algorithm cannot be run

I had the same problem but I managed to solve it by renaming my grass folder from "grass76" to grass-7.6.0".
user avatar
7 votes
Accepted

Installing Apache Web Server from OSGeo4W

Unfortunately, Apache is not bundled with the 64-bit OSGeo4W installer. You can still select qgis-server from the Web category in the 64-bit installer though, so you should do that. But you would ...
user avatar
  • 9,941
7 votes

Using gdal functions from OSGeo4W out of their shell?

I rarely use the OSGEO4W shell, although I have it because I used it to download some utilities. If you have QGIS you have most of the GDAL tools in the QGIS install directory already. If you prefer ...
user avatar
7 votes

QGIS Server sending UPDATE... WHERE NULL to postgis in a WFS layer

Finally, Matthias Kuhn, one of the developers of QGIS gave me the key. The WHERE clause is built checking the type of the primary key of the table. It should be an Integer and in some of my tables I ...
user avatar
  • 3,500
7 votes
Accepted

ogr2ogr commands with cmd

To debug the command, it can be helpful to echo it instead of running it, to see if any special characters are throwing things off. From inside a bat file, do: echo ogr2ogr -sql "SELECT * FROM 'D:\...
user avatar
  • 4,098
6 votes

Installing File Geodatabase (*.gdb) support in QGIS

It is nice, in 2019, you do not need do above, it is already supported in qgis 3.6. Simple and easy by 3 steps: Step 1: click the add vector button (red circle) Step 2: select directory, ...
user avatar
  • 1,432
6 votes

Installing File Geodatabase (*.gdb) support in QGIS

i had a related problem/question some 3 months ago (see: qgis 2.8.1 arcgis filegdb incomplete list in win-version) a few days ago i've switched from 2.8.x to 2.10.1-Pisa hoping to get rid of the ...
user avatar
6 votes

Installing qgis-ltr or qgis-ltr-full with OSGeo4W or both?

qgis-ltr-full is a metapackage. I don't know exactly what packages it selects, but I believe it might select things like qgis-globe-plugin and qgis-grass-plugin in addition to qgis-ltr. You will not ...
user avatar
6 votes
Accepted

No module named 'osgeo'

This sounds like you have multiple python installations, and GDAL is installed on one and not the other. Try the following (which I have based upon this). Create a text file within your python ...
user avatar
  • 2,238
6 votes

No module named 'osgeo'

Try this, pip install --global-option=build_ext --global-option="-I/usr/include/gdal" GDAL==`gdal-config --version`
user avatar
  • 229
6 votes
Accepted

OSGeo4W does not add bin directory to Windows PATH

is not recognized as an internal or external command, operable program or batch file OSGeo4W specifically has closed the ticket to add this to the system path. The DLLS may conflict with other system ...
user avatar
  • 6,701
6 votes
Accepted

Why is osgeo4w (w QGIS 3.6.2) asking for admin rights?

The osgeo4w installer requiring admin rights is a long-standing issue. The installer requests admin rights because some features really do need to be installed as admin (they create Windows services, ...
user avatar
  • 52.6k
6 votes
Accepted

Compiling resources.qrc with QGIS 3.20 (could not find qt5_env.bat)

You no longer need to run qt5_env.bat and py3_env.bat (I guess). Just run pyrcc5 -o pathtoplugin\resources.py pathtoplugin\resources.qrc
user avatar
5 votes
Accepted

Loading WMS with PyQGIS

Apparently it needs a styles& in the URL, even when there is no style defined. As the document OpenGIS Web Map Service (WMS) Implementation Specification states on www.opengeospatial.org in ...
user avatar
  • 372
5 votes

Convert raster to a CSV values and lat long based on raster value in QGIS

Try this way with GDAL: import os, sys from osgeo import gdal from osgeo import gdalconst # get the arguments InRaster = sys.argv[1] OutCSV = sys.argv[2] # open the raster and get some ...
user avatar
5 votes
Accepted

Reading various (non-.shp) vector types using ogrinfo

ogrinfo is meant to be used on single datasets. GDAL's Shapefile driver "treats a whole directory of shapefiles as a dataset, and a single shapefile within that directory as a layer" but that really ...
user avatar
  • 8,341
5 votes

Reading various (non-.shp) vector types using ogrinfo

Directory of shapefiles is a special case for GDAL/OGR and it behaves like a datastore with many layers as you have noticed. As far as I know no other driver has similar behavior. You can test all ...
user avatar
  • 52.3k

Only top scored, non community-wiki answers of a minimum length are eligible