New answers tagged

1

My issue was that the data was being sourced from a view. this prevented the software from exporting with the correct data types. I fixed the problem by sourcing the data from a table instead


2

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: BRUSH(fc:#0000FF);PEN(c:#000000) Not OGR_STYLE: BRUSH(fc:#0000FF);PEN(c:#000000) So your command would look like: ogr2ogr -f libkml output.kml input.shp Which results in the below for my test data: <?xml version=...


0

This works for me (for Windows): SET NLS_LANG=.CL8MSWIN1251 ogr2ogr [...]


0

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 (...


10

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. Action's code: from qgis.utils import iface from qgis.core import QgsProject, QgsVectorFileWriter, QgsCoordinateReferenceSystem path = "/tmp/gpx/sample....


2

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 ...


3

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/...


0

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 ...


0

Turns out that M values are not supported by the OCI driver https://github.com/OSGeo/gdal/issues/2687


Top 50 recent answers are included