I need to make simple operaitons/calculations on WKT on command line. I get a WKT string for a single polygon from jq, and I want to get the bounding box of this polygon.
$ cat details.json | jq -r '. | .geom'
POLYGON ((121 7076, 126 7083, 115 7092, 109 7086, 121 7076))
I want to get the boundring rectangle of that polygon, preferably also in WKT notation. Is that possible? I was hoping for something like:
$ cat details.json | jq -r '. | .geom' | fio bounds # does not work