| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

Defines | Typedefs | Functions | Variables
E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/shapelib/shpopen.c File Reference
`#include "shapefil.h"`
`#include <math.h>`
`#include <limits.h>`
`#include <assert.h>`
`#include <stdlib.h>`
`#include <string.h>`

## Defines

#define | FALSE 0
#define | TRUE 1
#define | ByteCopy(a, b, c) memcpy( b, a, c )
#define | MIN(a, b) ((a<b) ? a : b)
#define | MAX(a, b) ((a>b) ? a : b)

## Typedefs

typedef unsigned char | uchar
typedef int | int32

## Functions

SHPHandle SHPAPI_CALL | SHPOpen (const char *pszLayer, const char *pszAccess)
void SHPAPI_CALL | SHPClose (SHPHandle psSHP)
void SHPAPI_CALL | SHPGetInfo (SHPHandle psSHP, int *pnEntities, int *pnShapeType, double *padfMinBound, double *padfMaxBound)
SHPHandle SHPAPI_CALL | SHPCreate (const char *pszLayer, int nShapeType)
void SHPAPI_CALL | SHPComputeExtents (SHPObject *psObject)
SHPObject SHPAPI_CALL1 * | SHPCreateObject (int nSHPType, int nShapeId, int nParts, int *panPartStart, int *panPartType, int nVertices, double *padfX, double *padfY, double *padfZ, double *padfM){SHPObject *psObject;inti, bHasM, bHasZ;psObject=(SHPObject *) calloc(1, sizeof(SHPObject)
| if (nSHPType==SHPT_ARCM||nSHPType==SHPT_POINTM||nSHPType==SHPT_POLYGONM||nSHPType==SHPT_MULTIPOINTM)
| SHPComputeExtents (psObject)
| return (psObject)
SHPObject SHPAPI_CALL1 * | SHPCreateSimpleObject (int nSHPType, int nVertices, double *padfX, double *padfY, double *padfZ){return(SHPCreateObject(nSHPType,-1, 0, NULL, NULL, nVertices, padfX, padfY, padfZ, NULL)
int SHPAPI_CALL | SHPWriteObject (SHPHandle psSHP, int nShapeId, SHPObject *psObject)
SHPObject SHPAPI_CALL1 * | SHPReadObject (SHPHandle psSHP, int hEntity){SHPObject *psShape;if(hEntity< 0||hEntity >=psSHP->nRecords) return(NULL
| if (psSHP->panRecSize[hEntity]+8 > psSHP->nBufSize)
| fseek (psSHP->fpSHP, psSHP->panRecOffset[hEntity], 0)
| fread (psSHP->pabyRec, psSHP->panRecSize[hEntity]+8, 1, psSHP->fpSHP)
| if (bBigEndian)
else | if (psShape->nSHPType==SHPT_MULTIPOINT||psShape->nSHPType==SHPT_MULTIPOINTM||psShape->nSHPType==SHPT_MULTIPOINTZ)
| return (psShape)
const char SHPAPI_CALL1 * | SHPTypeName (int nSHPType){switch(nSHPType
const char SHPAPI_CALL1 * | SHPPartTypeName (int nPartType){switch(nPartType
void SHPAPI_CALL | SHPDestroyObject (SHPObject *psShape)
int SHPAPI_CALL | SHPRewindObject (SHPHandle hSHP, SHPObject *psObject)

## Variables

psObject | nSHPType = nSHPType
psObject | nShapeId = nShapeId
| psShape = (SHPObject *) calloc(1,sizeof(SHPObject))

## Define Documentation

#define ByteCopy | ( |  | a,
|  |  | b,
|  |  | c
| ) |  | memcpy( b, a, c )

#define FALSE 0

#define MAX | ( |  | a,
|  |  | b
| ) |  | ((a>b) ? a : b)

Examples:
  TePDIMMIOMatching_test.cpp, and TePDIOFMatching_test.cpp.

#define MIN | ( |  | a,
|  |  | b
| ) |  | ((a<b) ? a : b)

Examples:
  TePDIMatrix_test.cpp, TePDIMMIOMatching_test.cpp, and TePDIOFMatching_test.cpp.

#define TRUE 1

## Typedef Documentation

typedef int int32

typedef unsigned char uchar

## Function Documentation

fread | ( | psSHP-> | pabyRec,
|  | psSHP->panRecSize+ | 8[hEntity],
|  | 1 | ,
|  | psSHP-> | fpSHP
| ) |  |

fseek | ( | psSHP-> | fpSHP,
|  | psSHP-> | panRecOffset[hEntity],
|  | 0 |
| ) |  |

else if | ( | nSHPType | = `= SHPT_ARCM || nSHPType == SHPT_POINTM || nSHPType == SHPT_POLYGONM || nSHPType == SHPT_MULTIPOINTM` | ) |

if | ( | psSHP->panRecSize+ | 8[hEntity],
|  | psSHP-> | nBufSize
| ) |  |

if | ( | bBigEndian |  | ) |

else if | ( | psShape-> | nSHPType = `= SHPT_MULTIPOINT || psShape->nSHPType == SHPT_MULTIPOINTM || psShape->nSHPType == SHPT_MULTIPOINTZ` | ) |

return | ( | psShape |  | ) |

return | ( | psObject |  | ) |

void SHPAPI_CALL SHPClose | ( | SHPHandle | psSHP | ) |

void SHPAPI_CALL SHPComputeExtents | ( | SHPObject * | psObject | ) |

SHPComputeExtents | ( | psObject |  | ) |

SHPHandle SHPAPI_CALL SHPCreate | ( | const char * | pszLayer,
|  | int | nShapeType
| ) |  |

SHPObject SHPAPI_CALL1* SHPCreateObject | ( | int | nSHPType,
|  | int | nShapeId,
|  | int | nParts,
|  | int * | panPartStart,
|  | int * | panPartType,
|  | int | nVertices,
|  | double * | padfX,
|  | double * | padfY,
|  | double * | padfZ,
|  | double * | padfM
| ) |  |

SHPObject SHPAPI_CALL1* SHPCreateSimpleObject | ( | int | nSHPType,
|  | int | nVertices,
|  | double * | padfX,
|  | double * | padfY,
|  | double * | padfZ
| ) |  |

void SHPAPI_CALL SHPDestroyObject | ( | SHPObject * | psShape | ) |

void SHPAPI_CALL SHPGetInfo | ( | SHPHandle | psSHP,
|  | int * | pnEntities,
|  | int * | pnShapeType,
|  | double * | padfMinBound,
|  | double * | padfMaxBound
| ) |  |

SHPHandle SHPAPI_CALL SHPOpen | ( | const char * | pszLayer,
|  | const char * | pszAccess
| ) |  |

const char SHPAPI_CALL1* SHPPartTypeName | ( | int | nPartType | ) |

SHPObject SHPAPI_CALL1* SHPReadObject | ( | SHPHandle | psSHP,
|  | int | hEntity
| ) |  |

int SHPAPI_CALL SHPRewindObject | ( | SHPHandle | hSHP,
|  | SHPObject * | psObject
| ) |  |

const char SHPAPI_CALL1* SHPTypeName | ( | int | nSHPType | ) |

int SHPAPI_CALL SHPWriteObject | ( | SHPHandle | psSHP,
|  | int | nShapeId,
|  | SHPObject * | psObject
| ) |  |

Examples:
  TePDIRaster2Vector_test.cpp, and TePDISegmentation_test.cpp.

## Variable Documentation

psShape nShapeId = nShapeId

psObject nSHPType = nSHPType

memcpy & psShape = (SHPObject *) calloc(1,sizeof(SHPObject))

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines