[Shapelib] Shapelib test

Jamie Lahowetz deadpickle at gmail.com
Mon Apr 27 19:36:20 PDT 2009


I am learning C so humor me. I have a simple script but everytime I run it I
get a segmentation fault. Any ideas?

#include <shapefil.h>

int main (void)
{
    const char * shapefile =
"/mnt/share/uas/GRRUVI2_uc/extractor/colorado/fe_2007_08_county";
    SHPHandle handle;
    int entities;
    int type;
    double minbound;
    double maxbound;

    printf("%s\n", shapefile);

    handle = SHPOpen(shapefile,"rb");
    SHPGetInfo( handle,&entities,&type,&minbound,&maxbound);

    SHPClose(handle);
    return 0;
}


-- 
Jamie Ryan Lahowetz
University of Nebraska - Lincoln
Graduate Student - Geosciences
402.304.0766
jlahowetz at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/shapelib/attachments/20090427/978dd2cc/attachment.html>


More information about the Shapelib mailing list