[gdal-dev] OGR's GMT driver: requests for enhancement

Frank Warmerdam warmerdam at pobox.com
Fri May 16 18:57:36 EDT 2008


Bruce Raup wrote:
> Hi all (and Frank),
> 
>  I've been trying to use ogr2ogr to create a shapefile from a GMT text
>  file.  I created the GMT file with the enhanced comment fields to
>  define the attribute names, types, etc. using perl.  The problem is
>  that ogr2ogr defines all the string fields as 80 characters in width.
> 
>  Is there some control over this?  I have a "description" field that is
>  getting truncated.

Bruce,

The GMT driver has no support for setting a field width, so the string
fields will all come through as variable length.  The shapefile driver
defaults to 80 characters for such fields.

If you are using GDAL/OGR Trunk you can use the new SQL casting operator
to set the field width:

   http://trac.osgeo.org/gdal/wiki/rfc21_ogrsqlcast

I'm not aware of a practical way of handling this with GDAL 1.5.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the gdal-dev mailing list