You are trying to specify two output drivers, KML and LIBKML. Don't. Just specify LIBKML.
Make sure your OGR_STYLE field has the literal text:
So your command would look like:
ogr2ogr -f libkml output.kml input.shp
Which results in the below for my test data:
Dont know much about ogr2ogr, but another options is to use FDW. With that, you can link data from one database directly to another. Then you can access these data as if they are in target database, without man in the middle software. This is much cleaner, because it uses plain sql, without extra hassle of ogr2ogr. It is more complicated for first setup (...
If it were a single feature to export you could use an action with canvas scope (i.e., interacting with the canvas), but since you may export several features, an action with layer scope fits better.
from qgis.utils import iface
from qgis.core import QgsProject, QgsVectorFileWriter, QgsCoordinateReferenceSystem
path = "/tmp/gpx/sample....
It does definitely work for me. My steps follow:
GDAL version 3.0.4
PostgreSQL version 12.4
PostGIS version 3.0
I created a new schema "lidar" into an existing db. I concluded that your aim is to write table "test_dem" into schema "lidar" in db "lidar" so I tested the same.
I took your command and modified it a bit
You can. You already found out most of the solution. You just need to ask for the geometry field e.g
ogr2ogr -f geojson -dialect sqlite -sql "SELECT ID as aid, min as amin, max as amax, geometry FROM contour WHERE amax >4 and amax <10" contour-pt5-middle.geojson contour-pt5-min4-max10.geojson
See the GDAL related doc https://gdal.org/user/...
Here's the way I do this, it doesn't require using ogr or shapely or anything outside of the core json library. This script is set up to crawl geojson with mixed geometries (point, linestring, polygon) but will work on single feature types too. It abstracts all coordinate pairs from their features, sticks them in a list, and then uses python's built-in ...