[GRASS-dev] Vect_read_line -> ERROR: G_calloc

"ifj. Stefán István" istefan at stef.hu
Mon Oct 8 09:22:26 PDT 2012


Hello!

I'm trying to open a vector map with the Grass 6 API, but when I try to
read from the map, I get the following error message:

ERROR: G_calloc: unable to allocate 1861156242 * 4 bytes at
       allocation.c:144

The map I tr to read from is quite small, has only 3 features (one
polyline and two boundaries).

I try to use this code to read from the map:

extern "C" {
#include "grass/gis.h"
#include "grass/Vect.h"
}

#include <iostream>

int main(int argc, char **argv){

        using namespace std;

        struct Map_info Map;
        int ret;

        G_gisinit(argv[0]);

        ret=Vect_open_old(&Map, "polygonmap", "PERMANENT");

        cout<<"open level: "<<ret<<endl;
        cout<<"maptype: "<<Vect_maptype_info(&Map)<<endl;

        struct line_pnts line_p;
        struct line_cats line_c;
        Vect_read_line(&Map, &line_p, &line_c,1);

        return ret;
}

What am'I doing wrong?

Thanks for your help in advance,
István



More information about the grass-dev mailing list