<html xmlns:v="urn:schemas-microsoft-com:vml" 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:12.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.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><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Adam,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Was able to replicate your problem. It looks like there are minor issues with both gdalwarp and ParaView that together are causing the crash.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">The first problem is that gdalwarp is not writing the units attribute correctly when outputting the coordinates in feet. Instead, the units are set to an empty string. This seems wrong. The attribute
 should be set to “ft” or “feet”. When you use gdalwarp to write units of meters, it correctly writes this attribute as “m”. This is probably a bug, but it shouldn’t cause ParaView to crash.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">So you probably already see where this is going. NetCDF attributes of empty strings are odd, and the ParaView reader probably has never encountered one before. Lo and behold in this case the
 reader tries to pull a pointer out of an empty std::string, and std::string throws an exception.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">I’ve raised a bug for ParaView (<a href="https://gitlab.kitware.com/paraview/paraview/issues/17173">https://gitlab.kitware.com/paraview/paraview/issues/17173</a>) and will look into fixing this.
 I’ll leave it up to you whether you want to contact the GDAL developers about the issue with gdalwarp.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">-Ken<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt">From:</span></b><span style="font-size:11.0pt"> ParaView [mailto:paraview-bounces@paraview.org]
<b>On Behalf Of </b>Adam Dershowitz<br>
<b>Sent:</b> Monday, February 13, 2017 9:20 AM<br>
<b>To:</b> ParaView@paraview.org<br>
<b>Subject:</b> [EXTERNAL] Re: [Paraview] Paraview crashes with netCDF<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I found a bit more information.  When pareview crashes, here is part of the crash log:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Application Specific Information:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">terminating with uncaught exception of type std::out_of_range: basic_string<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">abort() called<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thread 0 Crashed:: Dispatch queue: com.apple.main-thread<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">0   libsystem_kernel.dylib                 0x00007fffcb43add6 __pthread_kill + 10<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">1   libsystem_pthread.dylib              0x00007fffcb526787 pthread_kill + 90<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">2   libsystem_c.dylib                           0x00007fffcb3a0420 abort + 129<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">3   libc++abi.dylib               0x00007fffc9efb85a abort_message + 266<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">4   libc++abi.dylib               0x00007fffc9f20c37 default_terminate_handler() + 243<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">5   libobjc.A.dylib                 0x00007fffcaa2af33 _objc_terminate() + 124<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">6   libc++abi.dylib               0x00007fffc9f1dd69 std::__terminate(void (*)()) + 8<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">7   libc++abi.dylib               0x00007fffc9f1d9f2 __cxa_rethrow + 99<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">8   QtCore                             0x000000010db17d2d QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 845<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">9   QtCore                             0x000000010db1ad97 QCoreApplication::exec() + 199<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">10  org.paraview.ParaView             0x000000010b083fd2 main + 386<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">11  libdyld.dylib                   0x00007fffcb30c255 start + 1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Any idea why that happens with one feet, but not meters in an otherwise identical file? 
<o:p></o:p></span></p>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;color:black">-- Adam<o:p></o:p></span></p>
</div>
</div>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="color:black">From: </span></b><span style="color:black">Dershowitz Adam <<a href="mailto:adershowitz@exponent.com">adershowitz@exponent.com</a>><br>
<b>Date: </b>Tuesday, February 7, 2017 at 11:58 AM<br>
<b>To: </b>"<a href="mailto:ParaView@paraview.org">ParaView@paraview.org</a>" <<a href="mailto:ParaView@paraview.org">ParaView@paraview.org</a>><br>
<b>Subject: </b>Paraview crashes with netCDF<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Times New Roman",serif"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt">I have a geotiff file that I want to view in Paraview.  But, Paraview seems to not show the correct offset (0,0 instead of respected the offset).  The work around I have been trying is to warp it to the correct
 location using gdalwarp and to export it as a netCDF.  Then Paraview should be able to show it correctly.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">But, I have run into a crash.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">If I do this:</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">gdalwarp  -t_srs EPSG:3652 -of netCDF test.tiff test_ft.nc</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">then I try to open test.nc in Paraview immediately crashes.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">While, instead if do this:</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">gdalwarp  -t_srs EPSG:3651 -of netCDF test.tiff test_m.nc</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">then it opens fine.  The difference between these two files is that EPSG 3652 uses feet (which is better for me, for this particular project) while 3651 uses meters.  Both appear to be valid NetCDF files. 
 I’ve tried both readers “CAM NetCDF (Unstructured)” and “NetCDF files generic and CF conventions” with the same results. 
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I’m running Paraview 5.2.0 64-bit on Mac OS 10.12.3.  But, I have seen identical results on an older Mac with a prior OS.  I had also tried an older version of Paraview with the same result.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Any ideas why this consistently crashes Paraview, or what to do about it?  Using netCDF was already a work around, and I willing to try others to view these files.  The offset and scale are important because
 I then need to put in other data that is in the correct location and units.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">The files are too big for me to send to the mailing list, so I have not posted them. 
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks,</span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;color:black"> </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;color:black">-- Adam</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</body>
</html>