need help shapelib

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

need help shapelib

calpas calpas
Dear all,
 this is a simple program I' writting in order to collect the shapefile type:
#include "shapelib/shapefil.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>

int main (int argc, char ** argv)
     char * filepath;
     char *  accessType;
    int *  pnEntities;
    int * pnShapeType = NULL;
        double * padfMinBound;
    double * padfMaxBound;
    SHPHandle hSHP;
    FILE * istream;

    filepath= "/home/geotema/valatest/data/point_bycicle_sharing.shp";
    accessType= "rb";
    if ( (istream = fopen ( filepath, "rb" ) ) == NULL )
        printf ( "file non-existant!\n" );
        printf ( "file exists!\n" );
    hSHP = SHPOpen(filepath,"rb");
    SHPGetInfo(hSHP,pnEntities,pnShapeType, padfMinBound, padfMaxBound);
    hSHP = (SHPHandle)malloc(sizeof(SHPHandle));
    printf("hELLO World \nShape type %d\n  ", hSHP->nShapeType);
        fclose ( istream );

    return 1;

In order to link my program with the shape lib, what I've through my is defining the following parameters:

bin_PROGRAMS= readshapetest
readshapetest_SOURCES = readshapetest.c shapelib/shpopen.c shapelib/shapefil.h
    rm -f *.o *.c

the compiling step is successful, unfortunately I'm keeping on having 0 as output. can you please tell me where I'm failing


Shapelib mailing list
[hidden email]