<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>Unfortunately, I really don't have the time.<br><br>I am glad to provide the fix, but whether you choose to apply it or keep a broken implementation is up to you. <br><br>> Date&#58; Fri, 4 Nov 2011 16&#58;54&#58;09 -0200<br>> Subject&#58; Re&#58; &#91;gdal-dev&#93; Patch for s57reader.cpp<br>> From&#58; etourigny.dev&#64;gmail.com<br>> To&#58; mrxonx&#64;hotmail.com<br>> CC&#58; gdal-dev&#64;lists.osgeo.org<br>> <br>> Dear  Mike,<br>> <br>> Please add this to a relevant ticket, or create one and add it there.<br>> <br>> http&#58;//trac.osgeo.org/gdal/report<br>> <br>> thanks, Etienne<br>> <br>> On Fri, Nov 4, 2011 at 4&#58;27 PM,  &#60;mrxonx&#64;hotmail.com&#62; wrote&#58;<br>> &#62; Dear all,<br>> &#62;<br>> &#62; Included is a patch for s57reader.cpp that properly applies updates for<br>> &#62; certain types of charts.<br>> &#62;<br>> &#62; The essence of this patch is that SG2D field may not be present in<br>> &#62; original record, and must be added if update is trying to insert SG2D<br>> &#62; fields.<br>> &#62;<br>> &#62; The patch was made against our modified version of OGR, so line numbers<br>> &#62; likely do not match and certain function signatures may need to be<br>> &#62; updated. If you&#39;d like to apply it - make sure it goes in the<br>> &#62; S57Reader&#58;&#58;ApplyRecordUpdate.<br>> &#62;<br>> &#62; Best,<br>> &#62; --<br>> &#62; Mike<br>> &#62;<br>> &#62;<br>> &#62;<br>> &#62; Index&#58; s57reader.cpp<br>> &#62; &#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;<br>> &#62; --- s57reader.cpp &#160; &#160; &#160; &#40;revision 0000&#41;<br>> &#62; &#43;&#43;&#43; s57reader.cpp &#160; &#160; &#160; &#40;working copy&#41;<br>> &#62; &#64;&#64; -2635,16 &#43;2635,30 &#64;&#64;<br>> &#62; &#160; &#160; &#160; &#160; /&#42; If we don&#39;t have SG2D, check for SG3D &#42;/<br>> &#62; &#160; &#160; &#160; &#160; if&#40; poDstSG2D &#61;&#61; NULL &#41;<br>> &#62; &#160; &#160; &#160; &#160; &#123;<br>> &#62; - &#160; &#160; &#160; &#160; &#160; &#160;poSrcSG2D &#61; poUpdate-&#62;FindField&#40;&#34;SG3D&#34;&#41;&#59;<br>> &#62; &#160; &#160; &#160; &#160; &#160; &#160; poDstSG2D &#61; poTarget-&#62;FindField&#40;&#34;SG3D&#34;&#41;&#59;<br>> &#62; &#43; &#160; &#160; &#160; &#160; &#160; &#160;if &#40;poDstSG2D &#33;&#61; NULL&#41; &#123;<br>> &#62; &#43; &#160; &#160; &#160; &#160; &#160; &#160; &#160; poSrcSG2D &#61; poUpdate-&#62;FindField&#40;&#34;SG3D&#34;&#41;&#59;<br>> &#62; &#43; &#160; &#160; &#160; &#160; &#160; &#160;&#125;<br>> &#62; &#160; &#160; &#160; &#160; &#125;<br>> &#62;<br>> &#62; - &#160; &#160; &#160; &#160;if&#40; &#40;poSrcSG2D &#61;&#61; NULL &#38;&#38; nCCUI &#33;&#61; 2&#41; &#124;&#124; poDstSG2D &#61;&#61; NULL &#41;<br>> &#62; &#43; &#160; &#160; &#160; &#160;if&#40; &#40;poSrcSG2D &#61;&#61; NULL &#38;&#38; nCCUI &#33;&#61; 2&#41; &#124;&#124; &#40;poDstSG2D &#61;&#61; NULL &#38;&#38; nCCUI &#33;&#61; 1&#41; &#41;<br>> &#62; &#160; &#160; &#160; &#160; &#123;<br>> &#62; &#160; &#160; &#160; &#160; &#160; &#160; CPLAssert&#40; FALSE &#41;&#59;<br>> &#62; &#160; &#160; &#160; &#160; &#160; &#160; return FALSE&#59;<br>> &#62; &#160; &#160; &#160; &#160; &#125;<br>> &#62;<br>> &#62; &#43; &#160; &#160; &#160; &#160;if &#40;poDstSG2D &#61;&#61; NULL&#41; &#123;<br>> &#62; &#43; &#160; &#160; &#160; &#160; &#160;poTarget-&#62;AddField&#40;poTarget-&#62;GetModule&#40;&#41;-&#62;FindFieldDefn&#40;&#34;SG2D&#34;&#41;&#41;&#59;<br>> &#62; &#43; &#160; &#160; &#160; &#160; &#160;poDstSG2D &#61; poTarget-&#62;FindField&#40;&#34;SG2D&#34;&#41;&#59;<br>> &#62; &#43; &#160; &#160; &#160; &#160; &#160;if &#40;poDstSG2D &#61;&#61; NULL&#41; &#123;<br>> &#62; &#43; &#160; &#160; &#160; &#160; &#160; &#160;CPLAssert&#40; FALSE &#41;&#59;<br>> &#62; &#43; &#160; &#160; &#160; &#160; &#160; &#160;return FALSE&#59;<br>> &#62; &#43; &#160; &#160; &#160; &#160; &#160;&#125;<br>> &#62; &#43;<br>> &#62; &#43; &#160; &#160; &#160; &#160; &#160;// Delete null default data that was created<br>> &#62; &#43; &#160; &#160; &#160; &#160; &#160;poTarget-&#62;SetFieldRaw&#40; poDstSG2D, 0, NULL, 0 &#41;&#59;<br>> &#62; &#43; &#160; &#160; &#160; &#160;&#125;<br>> &#62; &#43;<br>> &#62; &#160; &#160; &#160; &#160; nCoordSize &#61; poDstSG2D-&#62;GetFieldDefn&#40;&#41;-&#62;GetFixedWidth&#40;&#41;&#59;<br>> &#62;<br>> &#62; &#160; &#160; &#160; &#160; if&#40; nCCUI &#61;&#61; 1 &#41; /&#42; INSERT &#42;/<br>> &#62;<br>> &#62; _______________________________________________<br>> &#62; gdal-dev mailing list<br>> &#62; gdal-dev&#64;lists.osgeo.org<br>> &#62; http&#58;//lists.osgeo.org/mailman/listinfo/gdal-dev<br>> &#62;<br>                                               </div></body>
</html>