<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div>
<div dir="auto">Thanks this may be a good option 2 if I can't get even's solution to work. Seems straightforward, agreed on mask!</div>
</div>
<div><br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Sat, Feb 1, 2020 at 15:52 Markus Metz <<a href="mailto:markus.metz.giswork@gmail.com">markus.metz.giswork@gmail.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div style="background-color:#ffeb9c;width:100%;border-style:solid;border-color:#9c6500;border-width:1pt;padding:2pt;font-size:10pt;line-height:12pt;font-family:'Calibri';color:Black;text-align:left">
<span style="color:#9c6500">CAUTION:</span> This email originated from outside of the University of Saskatchewan. Do not click links or open attachments unless you recognize the sender and know the content is safe. If in doubt, please forward suspicious emails
 to <a href="mailto:phishing@usask.ca" target="_blank">phishing@usask.ca</a></div>
<br>
<div>
<div dir="ltr">Regarding this EASE-2 grid (<a href="https://nsidc.org/ease/ease-grid-projection-gt" target="_blank">https://nsidc.org/ease/ease-grid-projection-gt</a>), I found that<br>
<br>
On Sat, Feb 1, 2020 at 1:22 PM Even Rouault <<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>> wrote:<br>
<div><br>
</div>
<div>> - the spacing of the lat variable is not constant</div>
<div><br>
</div>
<div>the spacing of the lat variable increases drastically towards the poles.</div>
<div><br>
</div>
<div>You could convert the netcdf file to xyz text format, then treat it as vector points and interpolate a grid surface from these points with appropriate parameters. This should preserve the original values at the original xy locations and should take care
 of the increasing spacing of the lat variable towards the poles. Regarding your use case of snow depth, a land mask could speed up the interpolation step, skipping oceans.<br>
</div>
</div>
</div>
</div>
<div>
<div>
<div dir="ltr">
<div><br>
</div>
<div>></div>
> I've a somewhat complicated workflow to propose to create a georeferenced<br>
> GeoTIFF file. It assumes you are running GDAL master 3.1.0dev to be able to<br>
> use the gdalmdimtranslate utility<br>
><br>
> 1) Create a tiled geotiff<br>
><br>
> gdal_translate NETCDF:"SD_20160901.nc":snd_upd out.tif -co TILED=YES<br>
><br>
> 2) Transpose it, and also mirror the values in the x and y directions. I'm not<br>
> sure why this mirroring is needed at all (at least the one in the horizontal<br>
> direction. The one in the version direction might perhaps be explained by a<br>
> north-up vs south-up convention difference between netCDF and GeoTIFF)<br>
><br>
> gdalmdimtranslate out.tif out2.tif -co TILED=YES \<br>
>     -array band=1,transpose=[1,0],view=[::-1,::-1]<br>
><br>
> (in theory 1. and 2. could be merged in a single step, but doing the<br>
> transposition on the initial netCDF file will be very inefficient. Doing it on<br>
> a source tiled file is the best)<br>
><br>
> 3) Create a out2.tif.aux.xml file with the following content<br>
><br>
> <PAMDataset><br>
>   <Metadata domain="GEOLOCATION"><br>
>     <MDI key="LINE_OFFSET">0</MDI><br>
>     <MDI key="LINE_STEP">1</MDI><br>
>     <MDI key="PIXEL_OFFSET">0</MDI><br>
>     <MDI key="PIXEL_STEP">1</MDI><br>
>     <MDI key="SRS">EPSG:4326</MDI><br>
>     <MDI key="X_BAND">1</MDI><br>
>     <MDI key="X_DATASET">NETCDF:"SD_20160901.nc":lon</MDI><br>
>     <MDI key="Y_BAND">1</MDI><br>
>     <MDI key="Y_DATASET">NETCDF:"SD_20160901.nc":lat</MDI><br>
>   </Metadata><br>
> </PAMDataset><br>
><br>
> 4) Warp it:<br>
><br>
> gdalwarp out2.tif out3.tif -overwrite -co TILED=YES<br>
><br>
> Even<br>
><br>
> --<br>
> Spatialys - Geospatial professional services<br>
> <a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a><br>
> _______________________________________________<br>
> gdal-dev mailing list<br>
> <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
> <a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a></div>
</div>
</div>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a></blockquote>
</div>
</div>
-- <br>
<div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr"><span style="font-size:12.8px;color:rgb(102,102,102)">Chris Marsh, PhD</span></div>
<div dir="ltr"><span style="font-size:12.8px;color:rgb(102,102,102)"></span><span><span style="font-size:12.8px;color:rgb(102,102,102)"></span></span><span><span style="font-size:12.8px;color:rgb(102,102,102)">University of Saskatchewan</span></span><br style="font-size:12.8px;color:rgb(102,102,102)">
<span style="font-size:12.8px;color:rgb(102,102,102)"></span><a href="http://chrismarsh.ca/" style="font-size:12.8px;color:rgb(102,102,102)" target="_blank">chrismarsh.ca</a></div>
<span style="color:rgb(102,102,102)"></span><br style="color:rgb(102,102,102)">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>