ogr2ogr -overwrite -t_srs EPSG:3978 -f "ESRI Shapefile" -sql "SELECT * FROM 'Layer Name' WHERE FIELD_NAME = 'A CLASS'" dst.shp src.shp
help me out here - looking to 1) reproject a shape and 2) select only "A CLASS" from field named "FIELD_NAME" 3) and save it to src.shp
my output is ERROR 1: Type mismatch or improper type of arguments to = operator.
I've also tried ogr2ogr -overwrite -t_srs EPSG:3978 -f "ESRI Shapefile" -where "FIELD_NAME = 'A CLASS'" dst.shp src.shp resulting in: ERROR 1: SQL Expression Parsing Error: syntax error FAILURE: SetAttributeFilter( WHERE FIELD_NAME = 'A CLASSS') on layer 'LAYER NAME' failed.
and
ogr2ogr -overwrite -t_srs EPSG:3978 -f "ESRI Shapefile" -where "FIELD_NAME LIKE 'A CLA%'" dst.shp src.shp with the las which only produces one results, where 10,000+ records satisfy the query.
update
ogr2ogr -overwrite -t_srs EPSG:3978 -f "ESRI Shapefile" -dialect SQLite -sql "SELECT * FROM 'Layer Name' WHERE FIELD_NAME = 'A CLASS'" dst.shp src.shp
yields ERROR 1: Type mismatch or improper type of arguments to = operator. ERROR 1: In ExecuteSQL(): sqlite3_step(SELECT * FROM 'Layer Name' WHERE GIVEN_CLASS = 'Class A'): SQL logic error or missing database
one step closer though!
-dialect=SQLite
.