How to get the center point of a line using ogr2ogr command line?
I am unable to get a proper script to get this work.
In theory it can be done by using ogr2ogr with SQL and SQLite dialect. Here is a test command for ogrinfo but the same -sql works also in ogr2ogr.
ogrinfo osm.sqlite -dialect sqlite -sql "select Line_Interpolate_Point(geometry,0.5) from lines limit 10"
Unfortunately the Line_Interpolate_Point function is very new in Spatialite and if GDAL is compiled with older spatialite version the result will be
ERROR 1: In ExecuteSQL(): sqlite3_prepare(select Line_Interpolate_Point(geometry,0.5) from lines lim it 10): no such function: Line_Interpolate_Point
if you do not manage to get a GDAL build that has built with a new enough spatialite you can convert your data into spatialite and run that SELECT with spatilite-gui v1.7.1.