[Edbsilon-list] Error during conversation
Stephan Holl
stephan.holl at intevation.de
Die Dez 12 11:45:15 CET 2006
Hi Jan-Oliver,
Am Dienstag, 12. Dezember 2006 01:58 schrieb "Jan-Oliver Wagner"
<jan-oliver.wagner at intevation.de>:
> Hallo Stephan,
>
> On Monday 11 December 2006 10:29, Stephan Holl wrote:
> > I have checked out the edbsilon-code from CVS and run it against my
> > edbs-file.
> >
> > edbsilon died with the following error:
> > Lese UeberseeStadt.edb
> > Traceback (most recent call last):
> > File "./edbsilon/Konverter/edbsilon.py", line 184, in ?
> > parsen(fc.ONS, quelle, edbsformat)
> > File "./edbsilon/Konverter/parse.py", line 204, in parsen
> > return second_parsing(ONS, liste, edbsformat)
> > File "./edbsilon/Konverter/parse.py", line 82, in second_parsing
> > II_daten = e.get_II_data(edbsformat)
> > File "./edbsilon/Konverter/edbsclasses.py", line 989, in get_II_data
> > ainfo.paralist[0])
> > File "./edbsilon/Konverter/edbsclasses.py", line 1157, in arc2wkt
> > beta = getwinkel((bx/r, by/r))
> > File "./edbsilon/Konverter/edbsclasses.py", line 1131, in getwinkel
> > return acos(vx)
> > ValueError: math domain error
> >
> > Perhaps someone has a pointer where to look at?
>
> well, I just modified edbsclasses.py to ensure vx is <= 1 -- which
> is not the case for line 18474 where the error occurs in your
> file (which I have access to, fortunately ;-)
>
> The patch is attached - but be aware it is probably not
> the right solution.
Well it gives another error.
> The next problem I then observe is that no definition for Folie 066
> is found. Seems, Brandenburg does not use it.
Right. In a first step I do not want to adopt the config just to see what
comes out.
> Then this error occurs:
>
> Traceback (most recent call last):
> File "edbsilon.py", line 185, in ?
> fc.export()
> File "/powerhome/jan/project/edbsilon/Konverter/exportOGR.py", line 124,
> in export
> self.convertONS()
> File "/powerhome/jan/project/edbsilon/Konverter/exportOGR.py", line 62,
> in convertONS
> self.readObj(self.ONS[Objnr])
> File "/powerhome/jan/project/edbsilon/Konverter/exportOGR.py", line 94,
> in readObj
> self.exportObjekt(obj)
> File "/powerhome/jan/project/edbsilon/Konverter/exportOGR.py", line 205,
> in exportObjekt
> geom = getLinie(obj)
> File "/powerhome/jan/project/edbsilon/Konverter/exportOGR.py", line 318,
> in getLinie
> return ogr.CreateGeometryFromWkt('MULTILINESTRING(%s)'
> %join(multiline)) File "/usr/lib/python2.3/site-packages/ogr.py", line 970,
> in
> CreateGeometryFromWkt
> _obj = _gdal.OGR_G_CreateFromWkt( string, srs_o )
> ValueError: Corrupt WKT geometry passed to OGR_G_CreateFromWkt.
>
>
> which is caused by this multiline:
> ['(3485710.497 5883739.401,3485710.997 5883739.399)', '(3485721.265
> 5883736.618,3485710.994 5883739.669)']
>
> which is the first one to be in fact a multiline! All other multlines so
> far were just lines.
There seems to be something wrong within the detection/parsing/formating of
multilinestrings.
I temporarily commented out line
318 ( multiline.append('(%s)' % join(coordAsList,',')) ) in
edbsilon/Konverter/exportOGR.py. This results in wrong line and point shapes,
but the polygone-shapes get build. Please see this only as a fast workarround
to see at least some results.
Best
Stephan
--
Stephan Holl : www.intevation.de/~stephan | GISpatcher: www.gispatcher.de
Intevation GmbH: www.intevation.de | GAV e.V.: www.grass-verein.de
Georgstr.4 : 49074 Osnabrück | Telefon: +49(0)541. 3350832