dataPreprocessing/prepareShpFiles.c
int allFeaturesSimple(SHPHandle shpIn)
{
  int bOk = 1;         /* for return */
  int inputCount = 0;  /* number of features in the input file */
  int shapeType = 0;   /* what kind of geographic feature? */
  int in = 0;      /* count features read */
  int out = 0;     /* count features written */
  int part = 0;    /* count parts within a feature */
  SHPObject * readShp = NULL;
  SHPObject * newShp = NULL;
  SHPGetInfo(shpIn, &inputCount,&shapeType,NULL,NULL);
  for (in = 0; (in < inputCount) && (bOk > 0); in++)
     {
     readShp = SHPReadObject(shpIn,in);
     if (readShp == NULL)
       {
       bOk = 0;
       break;
       }
     if (readShp->nParts > 1) /* can't handle - exit */
       {
       bOk = 0;
       break;
       }
     }
  return bOk;
}
/* Read all the shapes and check to make sure none has more
 * than one part. If multi is found, print message and exit.
 * This means user must manually convert.
 *    shpIn       File handle for input coordinate file
 * Returns 1 for all simple, 0 for error or if a multi-feature is found.
 */
Read all the shapes and check to make sure none has more
than one part. If multi is found, print message and exit.
This means user must manually convert.
shpIn       File handle for input coordinate file
Returns 1 for all simple, 0 for error or if a multi-feature is found.
Read all the shapes and check to make sure none has more than one part . If multi is found print message and exit . This means user must manually convert . shpIn File handle for input coordinate file Returns 1 for all simple 0 for error or if a multi - feature is found .
int allFeaturesSimple(SHPHandle shpIn)
{
  int bOk = 1;         
  int inputCount = 0;  
  int shapeType = 0;   
  int in = 0;      
  int out = 0;     
  int part = 0;    
  SHPObject * readShp = NULL;
  SHPObject * newShp = NULL;
  SHPGetInfo(shpIn, &inputCount,&shapeType,NULL,NULL);
  for (in = 0; (in < inputCount) && (bOk > 0); in++)
     {
     readShp = SHPReadObject(shpIn,in);
     if (readShp == NULL)
       {
       bOk = 0;
       break;
       }
     if (readShp->nParts > 1) 
       {
       bOk = 0;
       break;
       }
     }
  return bOk;
}
int allFeaturesSimple ( SHPHandle shpIn ) { int bOk = 1 ; int inputCount = 0 ; int shapeType = 0 ; int in = 0 ; int out = 0 ; int part = 0 ; SHPObject * readShp = NULL ; SHPObject * newShp = NULL ; SHPGetInfo ( shpIn , & inputCount , & shapeType , NULL , NULL ) ; for ( in = 0 ; ( in < inputCount ) && ( bOk > 0 ) ; in ++ ) { readShp = SHPReadObject ( shpIn , in ) ; if ( readShp == NULL ) { bOk = 0 ; break ; } if ( readShp -> nParts > 1 ) { bOk = 0 ; break ; } } return bOk ; }
Read all the shapes and check to make sure none has more
 than one part.
Read all the shapes and check to make sure none has more than one part .
/* for return */ /* number of features in the input file */ /* what kind of geographic feature? */ /* count features read */ /* count features written */ /* count parts within a feature */ /* can't handle - exit */