Hot answers tagged

190

Update December 2017 Now you can simply drag&drop .gdb file (directory) into QGIS. This is read access to File Geodatabases only. If you require write access please read further. Update July 2015 It is time to bring this answer a bit more current as some elements of FileGDB support in QGIS have changed. I am now running QGIS 2.10.0 - Pisa. It was ...


43

OSGEO4W and all standalone QGIS installers come with a OSGEO4W Shell. Start that, and type gdalinfo --version and read the result. You may have different versions on the disk: Standalone, OSGEO4W and also from gisinternals if you want the latest GDAL build, but every package sets its environment so that it is using the version it was delivered with. ...


43

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 Type = Directory" and source should be either "OpenFileGDB" or "ESRI FileGDB". Then just browse to the *.gdb folder of choice, press "Open" and the layers will ...


40

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 project some support, through assistance with governance, and potentially funding. But it also gives a project some legitimacy and assurance. Being part of ...


40

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


26

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. From a OSGeo4W shell with just python 2 & 3 installed: C:\> o-help -={ OSGeo4W Shell Commands }=- dllupdate pip3 ...


20

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 "TILED=YES" mosaic.vrt mosaic.tif Keep an eye on all the GDAL creation parameters to compress your mosaic and use gdaladdo to add overviews. More info here: ...


18

Why would you want install Fiona if you can use PyQGIS to read the shapefile attributes ? Fiona is for reading geometries and attributes of a shapefile file (as PyShp), therefore you don't need dbfpy (look at Python Script examples for geoprocessing shapefiles without using arcpy). Fiona is a Python module so you must install it as any Python module in the ...


16

If you are on a Mac you can compile the filegdb driver from scratch using these instructions. UPDATE: It has been 2 years since this answer, you may want to try this now: https://github.com/OSGeo/homebrew-osgeo4mac Also, as many say now, you can use the OpenFileGDB driver which does not use the ESRI binaries to accomplish this. Please be mindful that it is ...


13

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 quite simple actually, but beginners might still struggle with it. The Plugin Builder generates a fairly 'empty' plugin template. The two files that are of ...


13

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 Python3 with python3. C:\>py3_env C:\>SET PYTHONPATH= C:\>SET PYTHONHOME=C:\OSGEO4~1\apps\Python36 C:\>PATH C:\OSGEO4~1\apps\Python36;C:\OSGEO4~1\...


12

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 and qgis-dev can). Double-clicking on a project file will open it with only one of them. You can change the version with doubleclicking on C:\OSGeo4W\apps\qgis\...


9

[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 PostGIS another approach could be something like this: ogr2ogr -f "FileGDB" mygdb.gdb PG:"host=my_host user=my_user_name dbname=my_db_name password=...


9

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 values to your output you can write the output to stdout then pipe to grep/findstr to filter it before writing to your csv: gdal_translate -q -of xyz -co ...


8

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://download.osgeo.org/qgis/windows/. It will not interfere with or delete the OSGEO4W installation you already have.


7

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 you can download 32 and 64 bit GDAL/OGR from http://www.gisinternals.com/sdk/ I did because I wanted the lib and include files but find that version works well ...


7

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 ...), Geospatial Libraries (GDAL/OGR, GEOS, PostGIS,...) , ... OSGeo4W is simply a binary distribution of these libraries/softwares for Windows environments (OSGeo4W ...


7

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 saw that the type was Numeric(8,0). Those tables and primary keys were created by a third-party app some time ago. I changed the type to Integer and all ...


7

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:\Testi2\own.SHP'.own WHERE Owner like 'Harr%'" D:\Testi2\own.shp D:\Testi2\All.SHP Which will print: ogr2ogr -sql "SELECT * FROM 'D:\Testi2\own.SHP'.own WHERE ...


6

PosgresSQL 9.3.2.3 shouldn't be using GDAL, since it is just a database without no dependencies on it. PostGIS 2.1.1.1 doesn't require the latest GDAL (recommends at least 1.9), but if you installed it using OSGEO4W, then it is probably linked to the latest GDAL (1.10). QGIS 2.0.1 is probably linked to GDAL 1.10. QGIS 1.7 is probably linked to GDAL 1.8 or ...


6

Download and run OSGEO4W setup (I'd suggest the 32 bit version) Run it once using the Desktop Installation option, to install QGIS (and whatever other desktop programs you want). After that's all done, run OSGEO4W setup again from the Start menu, choose Advanced installation, and proceed to the part of setup where you select packages. Scroll down to the "...


6

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 probably have to grab the 32-bit OSGeo4W installer and install Apache from there instead. Or install httpd Apache from http://httpd.apache.org/ and enable any ...


6

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


6

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, such as the Apache http server). But not all features require admin rights, so the workaround is the create a little batch file with the following to run the ...


5

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 file geodatabase issues discribed in my question. unfortunately without beeing successfully. what i've figured out since then is: there still seems to be a ...


5

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 paragraph 7.3.2 GetMap request overview, table 8 the Styles parameter is mandatory. The mandatory STYLES parameter lists the style in which each layer is to be ...


5

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 end up with two QGIS installations. You will notice that the installation size for qgis-ltr-full is 1 KB. That's because it's just a metapackage, not the package ...


5

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 DLLs and cause problems. You need to statically point to the absolute location of shp2pgsql, in the case of OSGeo4W and with your example, I believe it's C:\...


5

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 is a shapefile speciality. If you want show the ogrinfo output for multiple files, maybe including subdirectories, you will have to use a small tool/script to ...


5

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 files in the directory on Windows as for %1 in (*.*) do ogrinfo %1 >>total_ogrinfo.txt The total_ogrinfo.txt file may contain lots of messages like ...


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