gns2shp (Re: Extension hacking)

Bernhard Reiter bernhard at intevation.de
Mon Jun 9 16:15:01 CEST 2008


Am Sonntag, 8. Juni 2008 05:48:37 schrieb Anthony Lenton:
> I'm starting to put together an extension to play around a bit, and I
> tried to play around a bit with the gns2shp extension.
> It seems to be a bit out of date as it doesn't run properly with the
> files you download from
> http://earth-info.nga.mil/gns/html/cntry_files.html
> The headers seem to be different to the ones it supposes it will
> receive, so if you try with a file recently downloaded you now get a
>
> Traceback (most recent call last):
>   File "/home/anthony/svn/thuban/trunk/thuban/Thuban/UI/mainwindow.py",
> line 300, in invoke_command
>     command.Execute(self.Context())
>   File "/home/anthony/svn/thuban/trunk/thuban/Thuban/UI/command.py",
> line 121, in Execute
>     apply(self.function, (context,) + self.args + args, kw)
>   File
> "/home/anthony/svn/thuban/trunk/thuban/Extensions/gns2shp/gns2shp.py", line
> 138, in gns2shp_dialog
>     no = gns2shp(gns_filename, gns_filename[:-4])
>   File
> "/home/anthony/svn/thuban/trunk/thuban/Extensions/gns2shp/gns2shp.py", line
> 93, in gns2shp
>     MODIFY_DATE  = line.split('\t')
> ValueError: too many values to unpack
>
> I was wondering if this is a bug, or if I'm trying with the wrong files.

My assumption is, that it is a defect as gns2shp is rather old.
Jan-Oliver would know for sure. :)

> Also, I don't know if it would be better to update to the new file
> format, or to make it flexible so that the user can select the lat/lon
> columns, and the other columns are taken as data, or something.

I can't tell. If there is a gns file format documentation, this would help us 
to answer this question. :) I would make it flexible only if the 
specification demands it. 

Best,
Bernhard




More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)