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

Even Rouault even.rouault at mines-paris.org
Wed Apr 29 14:53:35 EDT 2009


What is the relationship with the original topic of this thread ?

I'm not sure how you could run "gdal_polygonize" as such as there's no 
gdal_polygonize.bat provided by default, so I imagine you created your own.

Did you remember of running "setfw.bat" before to set up appropriate 
environment variables ? When doing that, I'm able to do "python 
bin\gdal_polygonize.py"

But anyway, this is of no use, since gdal_polygonize.py will require the new 
generation GDAL python bindings, but (for historical reasons) FWTools comes 
with old-generation GDAL python bindings that do not have the newer mappings, 
like the one needed for gdal_polygonize.py

Perhaps you should try osgeo4w.

Le Wednesday 29 April 2009 20:18:09 Doug_Newcomb at fws.gov, vous avez écrit :
> There seems to be an issue with the python scripts in fwtools 2.3.0 and
> 2.3.1
>
> Example:
>
>
> C:\Program Files\FWTools2.3.1>gdal_polygonize
> Traceback (most recent call last):
>   File "C:\PROGRA~1\FWTOOL~1.1\bin\gdal_polygonize.py", line 34, in
> <module>
>     import gdal, ogr, osr
>   File "C:\PROGRA~1\FWTOOL~1.1\pymod\gdal.py", line 191, in <module>
>     import _gdal
> ImportError: No module named _gdal
>
> C:\Program Files\FWTools2.3.1>
>
>
> Not complaining, just grateful the toolset is there for Windows.
>
> Doug
>
>
> Doug Newcomb
> USFWS
> Raleigh, NC
> 919-856-4520 ext. 14 doug_newcomb at fws.gov
> ---------------------------------------------------------------------------
>------------------------------
>
> The opinions I express are my own and are not representative of the
> official policy of the U.S.Fish and Wildlife Service or Dept. of Interior.
> Life is too short for undocumented, proprietary data formats.
>
>
>
>              Even Rouault
>              <even.rouault at min
>              es-paris.org>                                              To
>              Sent by:                  "Rushforth, Peter"
>              gdal-dev-bounces@         <Peter.Rushforth at nrcan-rncan.gc.ca>
>              lists.osgeo.org                                            cc
>                                        gdal-dev at lists.osgeo.org
>                                                                    Subject
>              04/29/2009 01:48          Re: [gdal-dev] ogr2ogr in fwtools
>              PM                        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
>
> _______________________________________________
> 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