8
votes
Accepted
ogr2ogr can't append shapefile to existing Postgres table
I had the same problem. I solved it removing any reference to the layer creation options (-lco): include them only in the first call. The following calls should look like this:
command = r'ogr2ogr -f ...
5
votes
Accepted
pushMessage (interact with widgets) from QgsTask
The approach I would suggest would be using custom PyQt signals. The example below is based on the example for extending QgsTask in the PyQGIS Developer Cookbook, modified to emit custom signals from ...
3
votes
ogr2ogr can't append shapefile to existing Postgres table
Expanding on Antonia's answer where yes: removing -lco SCHEMA=schema1 and instead refer to the schema in the -nln tag, ie: -nln schema.table works...
We can improve on the whole process by iterating ...
2
votes
Accepted
Setting different GDAL configuration folder when calling ogr2ogr with Python subprocess
To set the GDAL_CONFIG_FILE environment variable for only that process you can pass the env arg to subprocess.run().
This expects a dict containing the complete set of vars to be used, so you should ...
2
votes
Run FME with subprocess Modul
Yes, as you noticed, you use
--[parameter name] [value]
In fact, if you run the workspace in FME Workbench, the first lines of the log window give you the full command to use with all parameters:
...
2
votes
Accepted
Catching shp2psql errors from python's subprocess module
I suppose you use Python 2.7.
You can change to check_call method of subprocess and you can redirect stdin, stdout and stderr, see: https://docs.python.org/2.7/library/subprocess.html
Using Python 3....
2
votes
Accepted
Using Python to send arguments to LAStools basics
Now that your question is open again I can provide some code. In your linked answer I wrote a batch file then called the batch file, that works, but to call directly from python:
lasheight = r"c:\...
2
votes
Accepted
Call external programmes from python plugin in QGIS on windows
you could also try subprocess.call
subprocess.call(["TeighaFileConverter"])
and make sure that you have the path to your TeighaFileConverter installation in you path variable
EDIT:
I tested the ...
1
vote
Opening PDF w/ action based on variable crashes QGIS
getting rid of
process.wait()
solved the issue!
1
vote
Accepted
Cannot execute gdalwarp in a Python notebook
for those who may fall here, rasterio and gdal python bindiing are not supposed to live in the same notebook ref. So rasterio was changing my PROJ_LIB env variable
1
vote
Using Python Subprocess module to import shapefile into postgres
I have had this sort of problem before, but with raster2pgsql, although from some light reading of the documentation, it seems like the similarities are numerous.
I hope my solution also works with ...
1
vote
Python subprocess.call gdaldem module
I did not tried with gdaldem but with gdal_translate and gdalwarp.
Depending of your goal:
Single call on the os
Multiprocessing
Single call : os.system should be also used.
Single call or ...
1
vote
gdal_polygonize creating empty line file instead of polygon
Using the QGIS GUI, it works for me with this command line:
gdal_polygonize.bat F:/path/to/MyRast/MyRast.tif -f "ESRI Shapefile" G:/test.shp test DN
Your codes misses the output field name which ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
subprocess × 38python × 26
gdal × 9
arcpy × 7
qgis × 6
pyqgis × 6
postgresql × 4
postgis × 3
arcgis-10.0 × 3
ogr2ogr × 3
python-2.7 × 3
parallel-processing × 3
arcgis-desktop × 2
qgis-plugins × 2
polygonize × 2
memory × 2
jupyter-notebook × 2
shp2pgsql × 2
raster × 1
shapefile × 1
r × 1
arcgis-10.1 × 1
arcgis-server × 1
arcgis-pro × 1
sql × 1