<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Michael,<br>
    </p>
    <div class="moz-cite-prefix">Le 15/03/2022 à 06:06, Michael Sumner a
      écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:CAAcGz98BDCBRC+=U6UC9A7LhrQGdO=pfUd5pt5Od=+i2_VmMDA@mail.gmail.com">
      <div dir="ltr">Hi, 
        <div><br>
        </div>
        <div>these files don't present to GDAL with a CRS, but it seems
          not out of place to assume that they can use
          'oSRS.SetWellKnownGeogCS("WGS84")', when no other indication
          is found and there are dimensions 'lon,lat' or
          'longitude,latitude'</div>
        <div><br>
        </div>
        <div><a
href="https://www.ncei.noaa.gov/data/sea-surface-temperature-optimum-interpolation/v2.1/access/avhrr/"
            moz-do-not-send="true" class="moz-txt-link-freetext">https://www.ncei.noaa.gov/data/sea-surface-temperature-optimum-interpolation/v2.1/access/avhrr/</a><br>
          <div><br>
          </div>
          <div>An example sds specifically: </div>
          <div><br>
          </div>
          <div>/vsicurl/NETCDF:"/vsicurl/<a
href="https://www.ncei.noaa.gov/data/sea-surface-temperature-optimum-interpolation/v2.1/access/avhrr/202202/oisst-avhrr-v02r01.20220201.nc"
              moz-do-not-send="true" class="moz-txt-link-freetext">https://www.ncei.noaa.gov/data/sea-surface-temperature-optimum-interpolation/v2.1/access/avhrr/202202/oisst-avhrr-v02r01.20220201.nc</a>":sst</div>
          <div><br>
          </div>
          <div>Would that be reasonable? Perhaps controlled by an env
            var? Is there an established control for this I'm missing?
            (I'm not looking for '-a_srs' or VRT, I want the
            auto-detection to work for these and many other similar file
            sources without augmentation). <br>
          </div>
        </div>
      </div>
    </blockquote>
    <p>I wouldn't expose WGS84 by default, because it might be another
      Earth geographic CRS, or even a non-Earth geographic CRS.</p>
    <p>Potential solution:</p>
    <p>- add a GDAL_NETCDF_DEFAULT_GEOGRAPHIC_CRS configuration option
      (that could be set to EPSG:4326 e.g) that would be used in the
      situation where the netCDF CF attributes to define a geographic
      CRS, but without the actual CRS definition, are not set.</p>
    <p>- or, more involved but more powerful, add a configuration file
      in data/ , let's say a netcdf_product_conf.json or whatever, where
      you would define a set of product types, with matching global
      attributes and their values and the corresponding CRS.</p>
    <p>e.g (not sure my set of "matching_attributes" is appropriate for
      your use case)<br>
    </p>
    {<br>
        "product_type": {<br>
            "noaa_ncei_oisst": {  // the id of the product here is
    completely arbitrary<br>
                "defining_global_attributes": {<br>
                    "title": "NOAA/NCEI 1/4 Degree Daily Optimum
    Interpolation Sea Surface Temperature (OISST) Analysis, Version 2.1
    - Final",<br>
                    "geospatial_lat_units": "degrees_north",<br>
                    "geospatial_lon_units": "degrees_east"<br>
                },<br>
                "default_values": {<br>
                    "crs": "EPSG:4326"<br>
                }<br>
            }<br>
        }<br>
    <p>}</p>
    <p>- or, both the easiest and hardest one, convince the data
      producer to just use the netCDF CF conventions to their full
      capabilities.<br>
    </p>
    <p>Even<br>
    </p>
    <blockquote type="cite"
cite="mid:CAAcGz98BDCBRC+=U6UC9A7LhrQGdO=pfUd5pt5Od=+i2_VmMDA@mail.gmail.com">
      <div dir="ltr">
        <div>
          <div><br>
          </div>
          <div>(It's not out of the question that I could submit a PR
            for this, just flagging discussion in case I'm missing
            something.)</div>
          <div><br>
          </div>
          <div>Thanks. </div>
          <div><br>
          </div>
          <div>Best, Mike</div>
          <div><br>
          </div>
          <div><br>
          </div>
          -- <br>
          <div dir="ltr" class="gmail_signature"
            data-smartmail="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"
              moz-do-not-send="true" class="moz-txt-link-freetext">mdsumner@gmail.com</a></div>
        </div>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
  </body>
</html>