2
votes
2answers
110 views

Can I use the LEFT (string) operator in ExecuteSQL()?

In QGIS I can use the LEFT operator on a dataset like this: LEFT( "Name2",3) ='031' What is the syntax for using this expression with ogr in python? Isn't this the right syntax? ...
3
votes
1answer
69 views

New attribute creation using ogr and regex

I've got a folder full of dxf files with elevation values included as part of a long text attribute. I've written a regex expression to extract the elevation value, and would like to add it as a new ...
5
votes
1answer
183 views

ogr2ogr selecting features by attributes

I am writing a shapefile after some processing; however, in the final step I need to do some selection by attributes from the the shapefile. I am using the command in a shell with the aim of using it ...
3
votes
2answers
508 views

GDAL SQL syntax to add field an put values

I try to make a new field in my attribute table and put in values from another field after converting from character to integer but can't get the right syntax. I run this as shell-script in MSYS. cd ...
1
vote
4answers
399 views

Get vector features inside a specific extent

The problem: I have a very large vector layer with many features and a much smaller raster layer in a defined region. I want to get only those vector features which are within the raster layers ...
4
votes
2answers
324 views

how to cast integer to float in an ogrinfo sql statement?

I have a shapefile for which I would like to add the values in a column. As the sum exceed the capacity of an integer, I need to cast values to a float. I tried the following: ogrinfo -sql "SELECT ...
4
votes
1answer
235 views

ogrinfo SQL GROUP BY Clause

Does ogrinfo support a GROUP BY clauses? I could not find any good documentation of all the SQL syntax features it supports. I tried the following: ogrinfo . -geom=no -sql 'SELECT lsad FROM ...
6
votes
1answer
810 views

Spatial joins in OGR SQL

I have seen that OGR supports it's own form of SQL, I was wondering if it's possible to do spatial joins. Something like select all objects where one intersects the other. I did have a look around ...