I have a set of points in a csv file like this (ie. a square):
-77.63333333;-11.75
-77.63333333;-12.25
-77.3;-12.25
-77.3;-11.75
-77.63333333;-11.75
-77.63333333;-11.75
After getting rid of the semi-colon (e.g., with the nice awk), I tried to make a closed polygon with the exact shape of the six pairs of coordinates in the csv file (ie. a square) with the following call:
ogr2ogr -f "ESRI Shapefile" tmp.shp tmp.gmt -a_srs EPSG:4326 -dialect sqlite -sql "select st_concavehull(st_collect(geometry)) from tmp"
It is obvious that st_concavehull is not st_makepolygon (so, it does not produce the desired square), and there should be an extra step to first connect all points with lines for this to work (e.g., st_makeline).
Is there a way to accomplish the desired squared polygon with ogr2ogr? Any hints are welcomed.
makelinegaia-gis.it/gaia-sins/spatialite-sql-latest.html#p0 and I'm not sure if it's supported in ogr