Jq stuff: Difference between revisions
No edit summary |
|||
Line 18: | Line 18: | ||
if [ ! -z $id ]; then | if [ ! -z $id ]; then | ||
wget -qO $id.orig.tiff <nowiki>http://$ip/requestImage/?scanId=$id</nowiki> | wget -qO $id.orig.tiff <nowiki>http://$ip/requestImage/?scanId=$id</nowiki> | ||
fi</pre> | fi</pre>More interesting jq examples: | ||
== | <code>"plateCoordinates":[898, 210, 144, 44] "plateCoordinatesRelative":[898, 210, 144, 44],</code> | ||
<code>jq ".plateCoordinates | .[1]" upload_test/2023-05-12_12:08:07.txt</code> | |||
== Tiff info parsing == | |||
Parsing examples of .tiff files extracing meta data from the headers. | Parsing examples of .tiff files extracing meta data from the headers. | ||
Revision as of 13:23, 12 May 2023
Using jq
Command to return the id number of the last scan:
cnt=$(jq '.lastVehicleRecord.scans | length' heartbeat)
Fancy way to find the scanId of a selected system via bash and jq
if [ -z $1 ]; then whichIE="uvx"; else whichIE=$1; fi printf ".lastVehicleRecord.scans[] | select(.type | endswith(\""$whichIE"\"))\n" > parms.jq wget -qO heartbeat http://$ip/heartbeat cnt=$(jq '.lastVehicleRecord.scans | length' heartbeat) id=$(jq -f parms.jq heartbeat | jq '.id') if [ ! -z $id ]; then wget -qO $id.orig.tiff http://$ip/requestImage/?scanId=$id fi
More interesting jq examples:
"plateCoordinates":[898, 210, 144, 44] "plateCoordinatesRelative":[898, 210, 144, 44],
jq ".plateCoordinates | .[1]" upload_test/2023-05-12_12:08:07.txt
Tiff info parsing
Parsing examples of .tiff files extracing meta data from the headers.
tiffinfo 2023-05-07\ 13_57_17_evx_left_3845.tiff | grep 65001 | sed 's/ Tag 65001: //' | sed 's/\\//'g | jq
tiffinfo 2023-05-07\ 13_57_17_evx_left_3845.tiff | grep 65001 | sed 's/ Tag 65001: //' | sed 's/\\//'g | jq '.timestamp'
tiffinfo 2023-05-07\ 13_57_17_evx_left_3845.tiff | grep 65001 | sed 's/ Tag 65001: //' | sed 's/\\//'g | jq '.renderData.type'