<div dir="ltr">Excellent, thanks so much it's definitely not GDAL-related, a surprising problem in the way I'm getting the strings out. <div><br></div><div>Appreciate the very fast response!</div><div><br></div><div>Best, Mike</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 31, 2021 at 8:14 PM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div>
    <p>Michael,</p>
    <p>apart your code not using the same GDAL version as the one of
      gdalinfo (but I can't recall versions having such issues), or a
      flow in your code, I don't see why you'd this.</p>
    <p>Even<br>
    </p>
    <div>Le 31/08/2021 à 12:07, Michael Sumner a
      écrit :<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">Hello, I'm having trouble getting subdataset names
        programatically from the WMTS/OGC Web Map Tile Service<br>
        <div><br>
        </div>
        <div>Using </div>
        <div><br>
        </div>
        <div>/vsicurl/<a href="https://gibs.earthdata.nasa.gov/wmts/epsg3031/best/1.0.0/WMTSCapabilities.xml" target="_blank">https://gibs.earthdata.nasa.gov/wmts/epsg3031/best/1.0.0/WMTSCapabilities.xml</a><br>
          <div><br>
          </div>
          <div>I see many well named SDS sources from gdalinfo, i.e.
            listed below. </div>
          <div><br>
          </div>
          <div>But when I try to obtain these programatically I only get
            repeated values : literally</div>
          <div><br>
          </div>
          <div>"WMTS:/vsicurl/<a href="https://gibs.earthdata.nasa.gov/wmts/epsg3031/best/1.0.0/WMTSCapabilities.xml,layer" target="_blank">https://gibs.earthdata.nasa.gov/wmts/epsg3031/best/1.0.0/WMTSCapabilities.xml,layer</a>"</div>
          <div><br>
          </div>
          <div>I'm using (effectively) </div>
          <div><br>
          </div>
          <div>char **SDS = poDataset->GetMetadata("SUBDATASETS");<br>
          </div>
          <div><br>
          </div>
          <div>and that gives me the same value for every SDS, i.e. no
            layer name. </div>
          <div><br>
          </div>
          <div>Is there something extra that needs to be done especially
            for WMTS? I can't figure it out from the sources. </div>
          <div><br>
          </div>
          <div>Thanks for any help!</div>
          <div><br>
          </div>
          <div>Best, Mike</div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div>gdalinfo  /vsicurl/<a href="https://gibs.earthdata.nasa.gov/wmts/epsg3031/best/1.0.0/WMTSCapabilities.xml" target="_blank">https://gibs.earthdata.nasa.gov/wmts/epsg3031/best/1.0.0/WMTSCapabilities.xml</a><br>
            Driver: WMTS/OGC Web Map Tile Service<br>
            Files: /vsicurl/<a href="https://gibs.earthdata.nasa.gov/wmts/epsg3031/best/1.0.0/WMTSCapabilities.xml" target="_blank">https://gibs.earthdata.nasa.gov/wmts/epsg3031/best/1.0.0/WMTSCapabilities.xml</a><br>
            Size is 512, 512<br>
            Origin = (0.000000000000000,0.000000000000000)<br>
            Pixel Size = (1.000000000000000,1.000000000000000)<br>
            Subdatasets:<br>
              SUBDATASET_1_NAME=WMTS:/vsicurl/<a href="https://gibs.earthdata.nasa.gov/wmts/epsg3031/best/1.0.0/WMTSCapabilities.xml,layer=AMSRE_Sea_Ice_Concentration_12km" target="_blank">https://gibs.earthdata.nasa.gov/wmts/epsg3031/best/1.0.0/WMTSCapabilities.xml,layer=AMSRE_Sea_Ice_Concentration_12km</a><br>
              SUBDATASET_1_DESC=Layer Sea Ice Concentration (12 km,
            AMSR-E, Aqua)<br>
              SUBDATASET_2_NAME=WMTS:/vsicurl/<a href="https://gibs.earthdata.nasa.gov/wmts/epsg3031/best/1.0.0/WMTSCapabilities.xml,layer=AMSRE_Snow_Depth_Over_Ice" target="_blank">https://gibs.earthdata.nasa.gov/wmts/epsg3031/best/1.0.0/WMTSCapabilities.xml,layer=AMSRE_Snow_Depth_Over_Ice</a><br>
              SUBDATASET_2_DESC=Layer Snow Depth Over Ice (12 km,
            AMSR-E, Aqua)<br>
              SUBDATASET_3_NAME=WMTS:/vsicurl/<a href="https://gibs.earthdata.nasa.gov/wmts/epsg3031/best/1.0.0/WMTSCapabilities.xml,layer=AMSRE_Sea_Ice_Concentration_25km" target="_blank">https://gibs.earthdata.nasa.gov/wmts/epsg3031/best/1.0.0/WMTSCapabilities.xml,layer=AMSRE_Sea_Ice_Concentration_25km</a><br>
              S<br>
          </div>
          <div><br>
          </div>
          -- <br>
          <div dir="ltr">Michael Sumner<br>
            Software and Database Engineer<br>
            Australian Antarctic Division<br>
            Hobart, Australia<br>
            e-mail: <a href="mailto:mdsumner@gmail.com" target="_blank">mdsumner@gmail.com</a></div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
gdal-dev mailing list
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
    </blockquote>
    <pre cols="72">-- 
<a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
  </div>

</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Michael Sumner<br>Software and Database Engineer<br>Australian Antarctic Division<br>Hobart, Australia<br>e-mail: <a href="mailto:mdsumner@gmail.com" target="_blank">mdsumner@gmail.com</a></div>