I've a point ESRI shapefile in ESPG32632 spatial reference.
I need to add X and Y column to it and I'd like to use something from command line like ogr2ogr but I don't know the syntax.
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
Use the OGR SQL http://www.gdal.org/ogr_sql.html and add X and Y columns with
ogrinfo foo.shp -sql "alter table foo add column X double" ogrinfo foo.shp -sql "alter table foo add column Y double"
Then switch to SQLite dialect http://www.gdal.org/ogr_sql_sqlite.html
ogrinfo foo.shp -dialect SQLite -sql "update foo set X=ST_X(geometry)" ogrinfo foo.shp -dialect SQLite -sql "update foo set Y=ST_Y(geometry)"