<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi Even,<o:p></o:p></p>
<p class="MsoNormal">    <o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt">My main question is :<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">Why... ? Why the netCDF driver on a netCDF v4 / HDF5 file doesn't do the job already ? I'm quite concerned by the CF logic being duplicated in several drivers.<o:p></o:p></p>
<p class="MsoNormal" style="-qt-paragraph-type:empty;-qt-block-indent:0"><o:p> </o:p></p>
<p class="MsoNormal">Ans: Unfortunately, we have a data volume problem with handling large SAR datasets. HDF5 allows us to work with float16 and one-bit/ two-bit masks while using a single file with hierarchical organization within it. Currently, we just append
 the .nc extension and test the code with the netcdf driver when not using any of the custom HDF5 features. We would have to use the advanced HDF5 features for managing data volumes moving ahead.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p style="margin:0in;margin-bottom:.0001pt">I love your optimism :-)<o:p></o:p></p>
<p class="MsoNormal" style="-qt-paragraph-type:empty;-qt-block-indent:0"><o:p> </o:p></p>
<p class="MsoNormal">Ans: Fingers crossed. I could be digging myself a hole here. But thanks to Julien and David B., we were able to get netcdf group support in. Hoping that the amount of effort is roughly the same.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p style="margin:0in;margin-bottom:.0001pt">Constants are only one part of the equation. The whole logic to build the OGRSpatialReference object from attributes is also something that would be great to have coded just once. To reuse it in multiple drivers would
 require to abstract the way to query attributes. Which brings me to thinking that the new multidim API could potentially be of use to have a driver-independent CF CRS decoding logic.<o:p></o:p></p>
<p class="MsoNormal" style="-qt-paragraph-type:empty;-qt-block-indent:0"><o:p> </o:p></p>
<p class="MsoNormal">Ans: I agree. A simplified structure that holds the current dataset id, group id and root id could potentially be specified for netcdf and HDF5? This simplified structure could reside within CF.h and be specialized  in the netcdf and hdf5
 dataset cpp files. The logic for searching the groups / traversing the tree could all be local to the CF.h / CF.cpp file then.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Will issue a separate PR for “crs_wkt”. This will make the datasets generated using pyproj.CRS.to_cf() readable with GDAL.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Piyush<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">Even Rouault <even.rouault@spatialys.com><br>
<b>Date: </b>Tuesday, March 31, 2020 at 10:34 AM<br>
<b>To: </b>"gdal-dev@lists.osgeo.org" <gdal-dev@lists.osgeo.org><br>
<b>Cc: </b>"Agram, Piyush S (US 334K)" <piyush.agram@jpl.nasa.gov><br>
<b>Subject: </b>[EXTERNAL] Re: [gdal-dev] HDF5 and CF conventions<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">Piyush,<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0">
 <o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">> We are considering extending the HDF5 driver to support CF conventions.<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0">
 <o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">My main question is :<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">Why... ? Why the netCDF driver on a netCDF v4 / HDF5 file doesn't do the job already ? I'm quite concerned by the CF logic being duplicated in several drivers.<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0">
 <o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">> All the logic exists as part of the netcdf driver (pretty much) and it should not take a really long time to add that support to HDF5 driver as well.<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0">
 <o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">I love your optimism :-)<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0">
 <o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">> 1. Working towards this, would it be ok to move the “CF_*” defines / constants to its own CF.h header file? That will then let us use it in other drivers as well.<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0">
 <o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">Constants are only one part of the equation. The whole logic to build the OGRSpatialReference object from attributes is also something that would be great to have coded just once.
 To reuse it in multiple drivers would require to abstract the way to query attributes. Which brings me to thinking that the new multidim API could potentially be of use to have a driver-independent CF CRS decoding logic.<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0">
 <o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">> 2. CF conventions 1.7+ supports an attribute<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">> called “crs_wkt”. GDAL has traditionally referred to this attribute as<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">> “spatial_ref”. Would it be ok to update netcdf driver to look for crs_wkt<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">> first and then fall back to usual spatial_ref attribute when it is not<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">> found?<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0">
 <o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">Sounds good to me. Could/should be a separate pull request.<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0">
 <o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">> 3. If one were to add CF support for HDF5, would it be preferable<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">> to make this its own driver like KEA/BAG (say H5CF) or part of the<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">> HDF5imagedataset core like CosmoSkymed / KompSAT products?
<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0">
 <o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">I'd say more in the existing HDF5 driver to limit the amount of new code.<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">KEA & BAG are really very specialized profiles of HDF5.<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0">
 <o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">Even<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0">
 <o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0">
 <o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">--
<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">Spatialys - Geospatial professional services<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0">http://www.spatialys.com<o:p></o:p></p>
</div>
</body>
</html>