On Tue, Dec 1, 2020 at 3:08 PM 1520 gis
<[email protected]> wrote:
> From: 1520 gis <[email protected]>
> Date: Fri, Nov 27, 2020 at 3:14 PM
> Subject: Grep gdalinfo subdataset
> To: <[email protected]>
>
>
> Hi all,
>
> I am trying to grep the SUBDATASET_X_NAME in gdalinfo.
> I only need the WCS:url
>
> If I grep the subdataset [1], the string slice "SUBDATASET_5_NAME" comes 
> together. I would like to know if I can get only WCS:url by using any 
> gdalinfo options.
>
> I tried running [2] , but no success.

Just a wild guess:
maybe it is easier to use the `-json` output and parse it (here: quick
Sentinel-2 example, not very elegant):

gdalinfo S2A_MSIL2A_20190912T025541_N0213_R032_T48MYT_20190912T065935.zip
-json | jq ".metadata" | jq ".SUBDATASETS" | jq ".SUBDATASET_2_NAME"
"SENTINEL2_L2A:/vsizip/S2A_MSIL2A_20190912T025541_N0213_R032_T48MYT_20190912T065935.zip/S2A_MSIL2A_20190912T025541_N0213_R032_T48MYT_20190912T065935.SAFE/MTD_MSIL2A.xml:20m:EPSG_32748"

cheers,
Markus
_______________________________________________
gdal-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to