10
votes
Accepted
QGIS Linux: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found
Solution:
os.environ["QT_QPA_PLATFORM"] = "offscreen"
8
votes
Accepted
Calling PyQGIS functions from external editors (Linux)
I use following intro for stand-alone applications:
# the_app.py
import os
import sys
from qgis.core import *
from PyQt4.QtGui import *
def main():
QgsApplication.setPrefixPath(os.environ['...
8
votes
Is it possible to change default encoding for QGIS?
Go to the "Settings -> Options -> Data Sources" menu,
and look for the checkbox "Ignore shapefile encoding declaration",
when you uncheck it, the default encoding (for shapefiles) will be 'set to' ...
8
votes
GeoServer Keeps Stopping Service
You are running GeoServer as a foreground process, so when you log out it is terminated. A quick and dirty way to avoid this is to use nohup (no hang up) like this:
nohup sh startup.sh &
But you ...
7
votes
Call QGIS geoprocessing tools from command line (terminal, bash-script)
Starting with the release of QGIS 3.14 there is a real QGIS command line mode to use QGIS Processing Algorithms (including GDAL, SAGA and GRASS). It's called qgis_process. See the change log and ...
6
votes
Storing result from gdallocationinfo as variable in Python
You can capture standard out this way:
from subprocess import Popen, PIPE
cmd = ['gdallocationinfo', '-geoloc', '-valonly', src, lng, lat]
p = Popen(cmd, stdout=PIPE)
p.wait()
val = p.stdout.read()
6
votes
Accepted
JPEG Creation error in gdal
Assuming you really do need a JPEG output file, not a GeoTIFF with internal JPEG compression...
The JPEG driver supports the CreateCopy but not the Create method. It's not mentioned specifically in ...
6
votes
JPEG Creation error in gdal
I'm late to the party and don't have enough reputation to comment on the accepted answer, but I want to add a bonus. You can avoid the two-step process with the intermediate VRT file by using the /...
6
votes
Running QGIS on command-line alone?
Starting with the release of QGIS 3.14 there is a real QGIS command line mode to use processing algorithms It's called qgis_process. See the change log and search for the new feature: New standalone ...
6
votes
Installing QGIS LTR instead of latest version on Ubuntu
QGIS 3.16 LTR will be installed when you change
https://qgis.org/ubuntu
into
https://qgis.org/ubuntu-ltr
in line
sudo add-apt-repository "deb https://qgis.org/ubuntu $(lsb_release -c -s) main&...
5
votes
Accepted
Automated clearing /tmp using QGIS batch processing?
You could create a custom script in your model to clear the '/tmp' folder at the end of each run. There's numerous ways to delete files but I like to use shutil.rmtree which deletes all files/folders ...
5
votes
Accepted
Batch load multiple shapefiles to Postgis
If you are able to use ogr2ogr it will ignore create options when appending, and ignore append options when creating.
for shp in $(ls *.shp);
do
ogr2ogr -f "PostgreSQL" PG:dbname=databasename -...
5
votes
Loading Esri ArcGrid export file (e00) in R?
It appears you are dealing with an ArcInfo Exchange file - check this out How To: Import an ArcInfo interchange file (E00) in ArcGIS. Your trying to do this using R.
If you wanted to use a command-...
5
votes
Execute GRASS modules in bash or python
In bash, you could do something like the following. I don't have your shapefile so I can't test that these are the exact commands that will work, but the approximate workflow may help you.
# create ...
5
votes
Aggregate Lines Based on Distance between Segments
You could try looking int this OS option, Skeletron, it:
generalizes collections of lines to a specific spherical mercator
zoom level and pixel precision, using a polygon buffer and voronoi ...
5
votes
Passing GDAL commands in Python using subprocess: errors
If its a relative path, you need a period in front of the file path, such as
gdalinfo './Path/to/my/file.shp'
or for the whole path you would specify with tilde such as
gdalinfo '~/home//Path/to/my/...
4
votes
Linux alternatives to visualize and analyze LiDAR datasets?
SPDlib provides a very comprehensive line tools for processing Laser Scanning data (both Terrestrial and Airborne data). It is available for Linux and can be easily installed using Anaconda. SPDlib ...
Community wiki
4
votes
Fixing ogr2ogr without spatialite support?
I'd just like to add that checking for Spatialite support via
ogrinfo --formats sqlite | grep 'spatialite' -i
and an output of SQLite -vector- (rw+v): SQLite / Spatialite does not guarantee support. ...
4
votes
running geoserver as background process in linux
If you are running GeoServer from the command line then you are only testing it and so should leave it running in a spare console window until done.
In a production environment you need to use the ....
4
votes
Aggregate Lines Based on Distance between Segments
ArcGIS is the simplest if it is at all an option. I know the OP specifies OS but I mention this as the OS options just don't look very helpful compared to :
http://resources.arcgis.com/en/help/main/10....
4
votes
Accepted
Is there any existing postgis package for Ubuntu 16.04 (xenial) compiled against GDAL 2.0+?
The Ubuntu GIS team has GDAL 2.2.1 for Xenial and has PostGIS 2.3.3 compiled against it. From the PostGIS build logs
checking for gdal-config... /usr/bin/gdal-config
checking GDAL version... 2.1.3
...
4
votes
Installing QGIS on Fedora?
Found libsz.so.2 in a local library used by another software on my machine (FME Desktop). Copied this file to /usr/lib and ran ldconfig. This solved my issue this time....
4
votes
QGIS not available in Pop! Linux repo so how do I install it
Pop! is based on Ubuntu 18.04 so QGIS 2.18 is available by default and can be installed from the command line (or synaptic):
sudo apt install qgis python-qgis qgis-plugin-grass
QGIS is not available ...
4
votes
Cannot create PostGIS extension with Ubuntu 18.04
If you are in Ubuntu, you can install it from packages!
Instead of compiling them from source, you can just execute this command and all the required packages will be installed.
sudo apt-get install ...
4
votes
Accepted
Call QGIS geoprocessing tools from command line (terminal, bash-script)
If you run a QGIS Processing tool from the toolbox, you can then open the Processing History dialog from the Processing menu. Clicking any item in the history will show you an equivalent Python ...
4
votes
Running QGIS on command-line alone?
Assuming you want to use PyQGIS python scripts to automate your workflow, you could do something like the following (roughly based on what I do for automated testing of a QGIS 3 python plugin in my ...
4
votes
How to make PROJ work via Anaconda in Google Colab?
After some stressful fight I managed to patch up a solution. I post the answer below because I believe a lot of people will hit the same problem trying to do geospatial work with Conda in Google Colab:...
4
votes
Accepted
Font "liberation sans" not available on system
If you cant or dont want to install new font on either operating system you may use an expression to set the font depending on the operating system. As there is a variable that return the curent OS ...
3
votes
Accepted
Converting Python script for QGIS?
This should work:
##Database=group
##Access.mdb to SqLite=name
##inputmdb= input file
##outputsqlite = output file
import sys, subprocess, os, sqlite3 as sql
mdb_name = inputmdb
sql_name = ...
3
votes
Linux Tool to visualize CityGML file
Aristoteles 3D (requires Java) is working on current versions of Ubuntu.
From memory, the link I used was from https://www.citygmlwiki.org/index.php/Freeware, pointing to http://www.geo-kiosk.net/...
Community wiki
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
linux × 347qgis × 96
gdal × 58
installation × 47
ubuntu × 41
python × 34
postgis × 27
postgresql × 22
arcgis-server × 20
grass-gis × 19
pyqgis × 15
geoserver × 13
qgis-3 × 13
openstreetmap × 13
windows × 12
raster × 10
coordinate-system × 10
shapefile × 8
file-geodatabase × 8
arcpy × 7
centos × 7
debian × 7
r × 6
arcgis-10.1 × 6
qgis-plugins × 6