[gdal-dev] ogr2ogr in fwtools 2.3 on windows gml to shp issue

Even Rouault even.rouault at mines-paris.org
Wed Apr 29 15:24:21 EDT 2009


Peter,

I've just finally completely removed that test on the maximum number of bytes 
inside a geometry tag. I've found a shapefile that translated to GML produces 
a single geometry element a bit more than 100 MB... and ogr can parse it 
succesfully. There was indeed a test on the number of entities that alone is 
enough to avoid the billion laugh attack.

Le Wednesday 29 April 2009 20:37:09 Rushforth, Peter, vous avez écrit :
> Hi Even,
>
> The billion laughs attack targets entity expansion, which I would
> have thought could be controlled by a parser feature instead of
> hard-coding a limit on the number of vertices in a polygon.
>
> 10,000,000 bytes would translate to about 270K vertices in my files,
> which I hope will be enough - I have doubts for northern islands though.
>
> Regarding the apparent non-reading of the gfs file by ogr2ogr, perhaps
> I was mislead by arcmap caching the schema, or at any rate I was unable
> to reproduce the problem with fwtools 2.3.1.
>
> Thanks for your help.
>
> Peter
>
> > -----Original Message-----
> > From: Even Rouault [mailto:even.rouault at mines-paris.org]
> > Sent: April 29, 2009 1:49 PM
> > To: Rushforth, Peter
> > Cc: gdal-dev at lists.osgeo.org
> > Subject: Re: [gdal-dev] ogr2ogr in fwtools 2.3 on windows gml
> > to shp issue
> >
> > Hi,
> >
> > As far as the message "ERROR 1: Too much data inside one
> > element. File probably corrupted" is concerned, I think that
> > FWTools-2.3.0 showed a temporary regression where the maximum
> > size for a geometry was limited to 100,000 bytes to avoid
> > reading corrupted/hostile files. This limit was proved to be
> > too low and raised to 10,000,000 bytes a bit later (see
> > http://trac.osgeo.org/gdal/ticket/2818) and I believe that
> > this fix went into FWTools-2.3.1. Unfortunately the FWTools
> > home page isn't well updated and it only shows 2.3.0 as the
> > latest version. But you can find here FWTools 2.3.1 :
> > http://home.gdal.org/fwtools/FWTools231.exe
> >
> > I was able to rename an attribute in a generated .gfs file
> > and ogrinfo successfully returned the modified attribute
> > name. So you'll have to provide more details, ideally a small
> > GML file and the modified .gfs demonstrating a problem.
> >
> > Best regards,
> > Even
> >
> > Le Wednesday 29 April 2009 17:16:11, vous avez écrit :
> > > Hi,
> > >
> > > Using fwtools 2.3 on windows, I run the ogr2ogr command on
> >
> > a gml file
> >
> > > to create a shp file.
> > >
> > > I get the following error message:
> > >
> > > C:\Program Files\FWTools2.3.0\>ogr2ogr -f "ESRI Shapefile"
> >
> > peter.shp
> >
> > > test.gml ERROR 1: Too much data inside one element. File probably
> > > corrupted
> > >
> > > When I cut down the number of coordinates in the gml:Polygon (to an
> > > extreme minimum), the shp file is created.  But I can't do
> >
> > that in real life.
> >
> > > Also, I want to supply a gfs file to control attribute name
> >
> > mapping.
> >
> > > But it seems to be ignored.
> > >
> > > Thanks
> > >
> > > Peter Rushforth
> > > Technology Advisor / Conseiller technique GeoConnections /
> > > GéoConnexions
> > > 650-615 Booth St. / rue Booth
> > > Ottawa ON K1A 0E9
> > > E-mail / Courriel: Peter.Rushforth at NRCan-RNCan.gc.ca Phone /
> > > Télephone: (613) 943-0784 Fax / telecopier:  (613) 947-2410
> > > _______________________________________________
> > > gdal-dev mailing list
> > > gdal-dev at lists.osgeo.org
> > > http://lists.osgeo.org/mailman/listinfo/gdal-dev




More information about the gdal-dev mailing list