I modified the code as you have suggested. But I encounter a new problem. If I run a simple program from the command line like this: http://osgeo.pastebin.com/pPqkcvk3 get the following error: "python: malloc.c:4628: _int_malloc: Assertion `(unsigned long)(size) >= (unsigned long)(nb)' failed." I updated the code to the 42566 version but I still have the same problem. Any suggestions?. I will keep trying!. Thank you. Fernando.
Ing. Fernando Pacheco M.S.L. Ingesur srl Dirección: Requena 1062 ap.302, Montevideo, Uruguay. Teléfonos: (+598 2) 408 90 48, (+598 9) 962 79 32 Web: http://ingesur.com.uy/ On Tue, Jun 15, 2010 at 2:10 PM, Fernando Pacheco < [email protected]> wrote: > Woks!. Thank you. Fernando. > > > Ing. Fernando Pacheco M.S.L. > > Ingesur srl > Dirección: Requena 1062 ap.302, Montevideo, Uruguay. > Teléfonos: (+598 2) 408 90 48, (+598 9) 962 79 32 > Web: http://ingesur.com.uy/ > > > On Tue, Jun 15, 2010 at 1:56 PM, Glynn Clements > <[email protected]>wrote: > >> >> Fernando Pacheco wrote: >> >> > I'm trying to access a grass vector map with python (2.6). I'm using the >> svn >> > version (revision 42 565) but keep getting "Segmentation fault" when >> trying >> > to open the file with Vect_open_old (map, input, mpaset). The code I'm >> using >> > can be found here: http://osgeo.pastebin.com/VLGunxyq >> > Can you please tell me I'm doing wrong (the same code works well with >> python >> > libraries generated with SWIG)?. >> >> There are two problems, one in your code, one in the ctypes wrappers. >> >> First, Vect_open_old needs a pointer to a a Map_info structure, not >> the structure itself, so you need to use byref(), e.g.: >> >> from ctypes import * >> >> ... >> >> vector.Vect_open_old(byref(map), input, mapset) >> >> Second, if LFS is enabled, any files which use the vector structures >> are compiled with -D_FILE_OFFSET_BITS=64. This wasn't being passed to >> the preprocessor when the ctypes wrappers were generated, resulting in >> incorrect wrappers being generated for various structures, including >> the Map_info structure. This should be fixed by r42566. >> >> -- >> Glynn Clements <[email protected]> >> > >
_______________________________________________ grass-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-dev
