I am following this question with the first answer Dissolve/aggregate polygons with ogr2ogr or gpc? where I am trying to dissolve my shapefile down to 1 row by the geometry field
ogr2ogr C:\Users\name\Desktop\output.shp C:\Users\name\Desktop\All_constraints_v5.shp -dialect sqlite -sql "SELECT ST_Union(geometry) FROM input"
ERROR 1: In ExecuteSQL(): sqlite3_prepare(SELECT ST_Union(geometry) FROM input):
no such table: input
right so then I did
C:\Program Files\GDAL>ogrinfo -so C:\Users\rizagha\Desktop\All_constraints_v5.shp
INFO: Open of `C:\Users\rizagha\Desktop\All_constraints_v5.shp'
using driver `ESRI Shapefile' successful.
1: All_constraints_v5 (Polygon)
So my question is
"SELECT ST_Union(geometry) FROM input"does input need to be my shp full path variable? what is the exact syntaxI cannot find out what the geometry column is called.
I ran this:
C:\Program Files\GDAL>ogrinfo -geomfield -fields=YES C:\Users\rizagha\Desktop\All_constraints_v5.shp
INFO: Open of `C:\Users\rizagha\Desktop\All_constraints_v5.shp'
using driver `ESRI Shapefile' successful.
1: All_constraints_v5 (Polygon)
but it doesn't tell me what column name the geom is
All_constraints_v5and that is what you will use for FROM. Geometry field is "geometry" for the SQLite dialect. – user30184 Dec 20 '17 at 16:03