Skip to main content
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 ...
Antònia's user avatar
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 ...
Ben W's user avatar
  • 23.1k
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 ...
Theo F's user avatar
  • 1,859
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 ...
mikewatt's user avatar
  • 5,198
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: ...
Mark Ireland's user avatar
  • 13.2k
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....
Zoltan's user avatar
  • 7,450
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:\...
Michael Stimson's user avatar
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 ...
Hicham Zouarhi's user avatar
1 vote

Opening PDF w/ action based on variable crashes QGIS

getting rid of process.wait() solved the issue!
simon's user avatar
  • 21
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
Pierrick Rambaud's user avatar
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 ...
GHRF's user avatar
  • 615
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 ...
PEL's user avatar
  • 374
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 ...
AndreJ's user avatar
  • 77.1k

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