[mapserver-users] Shapefile field length problem

Steve White steve at online-archaeology.co.uk
Mon Aug 4 16:56:16 EDT 2008


I'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.

 

Here's my VRT file:

 

<OGRVRTDataSource>

    <OGRVRTLayer name="Layer1">

      <SrcDataSource>MyDSN</SrcDataSource>

      <SrcSQL>EXEC MySP</SrcSQL>

      <FID>ID</FID>

      <GeometryType>wkbPoint</GeometryType>

      <LayerSRS>WGS84</LayerSRS>

      <GeometryField encoding="PointFromColumns" y="Latitude"
x="Longitude"/>

    </OGRVRTLayer>

</OGRVRTDataSource>

 

I'm using org2ogr to produce a shapefile and it'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. 

 

I'm guessing that it's doing this by default because no explicit value has
been set for the text field length.

 

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?

 

Cheers,

 

Steve

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080804/cad5abfb/attachment.html


More information about the mapserver-users mailing list