[Gdal-dev] file size balloons when converting gml to tab, shp with ogr2ogr

Peter.Rushforth at statcan.ca Peter.Rushforth at statcan.ca
Thu May 18 11:05:04 EDT 2006


Hi Frank,

It is just the .dbf and the .dat files for mapinfo which grow too big.
I checked the mid/mif and found that you could edit the string field
definition and generate the tab file which then turned out to be about
the right size.

I was searching for a way to tell the gml driver how big the string
fields were in order that that info get passed on to the tab and shp
drivers.  I tried editing the gfs file and adding a Width element, but
it seemed to be ignored.  Would an xml schema work, I wonder?

Cheers

Peter Rushforth
Geography Division
Statistics Canada
Ottawa Ontario
K1A 0T6


> -----Original Message-----
> From: Frank Warmerdam [mailto:fwarmerdam at gmail.com] On Behalf 
> Of Frank Warmerdam
> Sent: May 18, 2006 10:30 AM
> To: Peter.Rushforth at statcan.ca
> Cc: gdal-dev at lists.maptools.org
> Subject: Re: [Gdal-dev] file size balloons when converting 
> gml to tab, shp with ogr2ogr
> 
> 
> Peter.Rushforth at statcan.ca wrote:
> > Hi,
> > 
> > I've been experimenting with converting GML documents to 
> mapinfo tab 
> > and
> > esri shp
> > formats.  I have the same files previously created with commercial 
> > software with
> > exactly the same record layouts.  The files I've created 
> with ogr2ogr 
> > seem to be up
> > to 5 to 10 times larger than the same file (and format) 
> created with the 
> > commercial software.
> > 
> > When you view the files, they appear identical, line for line, 
> > attribute
> > for attribute.
> > 
> > Is there somebody who could point me in the right direction to 
> > determine
> > why?
> 
> Peter,
> 
> Generally speaking string fields without a defined size will 
> end up being very wide when translated to shapefiles since it 
> is necessary for me to pick a string width when creating the 
> shapefile, but without prescanning all the actual values that 
> will be written.  This may also be an issue with tab format, 
> I'm not sure.  I don't *think* it is an issue with .mid/.mif.
> 
> So, is it primarily the .dbf file that is big for shapefiles? 
>  The .shp should generally be slightly more compact than the 
> corresponding GML geometry format.
> 
> 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 OSGF, 
> http://osgeo.org
> 
> 




More information about the Gdal-dev mailing list