<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=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @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:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</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 lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span lang=EN-GB>I&#8217;m trying to dump some tables out of
MS SQL Server 2000 using a vrt file. The sql query includes a text field that
could contain a large amount of characters.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>Here&#8217;s my VRT file:<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>&lt;OGRVRTDataSource&gt;<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>&nbsp; &nbsp;&nbsp;&lt;OGRVRTLayer
name=&quot;Layer1&quot;&gt;<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;SrcDataSource&gt;MyDSN&lt;/SrcDataSource&gt;<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;SrcSQL&gt;EXEC MySP&lt;/SrcSQL&gt;<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;FID&gt;ID&lt;/FID&gt;<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;GeometryType&gt;wkbPoint&lt;/GeometryType&gt;<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;LayerSRS&gt;WGS84&lt;/LayerSRS&gt;<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;GeometryField encoding=&quot;PointFromColumns&quot; y=&quot;Latitude&quot;
x=&quot;Longitude&quot;/&gt;<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>&nbsp;&nbsp;&nbsp; &lt;/OGRVRTLayer&gt;<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>&lt;/OGRVRTDataSource&gt;<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>I&#8217;m using org2ogr to produce a
shapefile and it&#8217;s all working fine. However, when I open the DBF file in
Excel I see that the text field has been truncated at exactly 80 characters. <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>I&#8217;m guessing that it&#8217;s doing
this by default because no explicit value has been set for the text field
length.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>How can I specify a length for a text
(string) field for my shp file when dumping out via ogr2ogr and a vrt file as
above?<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>Cheers,<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-GB>Steve<o:p></o:p></span></p>

</div>

</body>

</html>