[Shapelib] SHPReadObject compile error

Jamie Lahowetz jlahowetz at gmail.com
Wed Apr 29 23:59:03 PDT 2009


I get this error when compiling:
shape_test.c: In function ‘main’:
shape_test.c:24: error: incompatible types in assignment
shape_test.c:25: error: ‘SHPObject’ has no member named ‘nShapeid’

Does this mean that the shapefile does not have an id or am I just doing it
wrong?

#include <shapefil.h>

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

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

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

    printf("Entities: %d\n",entities);
    printf("Type: %d\n",type);
    for(int i=0;i<2;printf("Min Bound: %lf\nMax Bound:
%lf\n",minbound[i],maxbound[i]), i++);

    int a=0;
    printf("\nReading Entity %d\n",a);
    shpinforead = *SHPReadObject(handle,a);
    printf("%d %d\n",shpinforead->nShapeid,shpinforead->nParts);

    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/20090430/11623a09/attachment.html>


More information about the Shapelib mailing list