1#ifndef SHAPEFILE_H_INCLUDED
2#define SHAPEFILE_H_INCLUDED
33#define SHAPELIB_VERSION_MAJOR 1
34#define SHAPELIB_VERSION_MINOR 6
35#define SHAPELIB_VERSION_MICRO 2
37#define SHAPELIB_MAKE_VERSION_NUMBER(major, minor, micro) \
38 ((major) * 10000 + (minor) * 100 + (micro))
40#define SHAPELIB_VERSION_NUMBER \
41 SHAPELIB_MAKE_VERSION_NUMBER(SHAPELIB_VERSION_MAJOR, \
42 SHAPELIB_VERSION_MINOR, \
43 SHAPELIB_VERSION_MICRO)
45#define SHAPELIB_AT_LEAST(major, minor, micro) \
46 (SHAPELIB_VERSION_NUMBER >= \
47 SHAPELIB_MAKE_VERSION_NUMBER(major, minor, micro))
57#define TRIM_DBF_WHITESPACE
64#define DISABLE_MULTIPATCH_MEASURE
95#ifdef SHAPELIB_DLLEXPORT
96#define SHPAPI_CALL __declspec(dllexport)
97#define SHPAPI_CALL1(x) __declspec(dllexport) x
101#if defined(USE_GCC_VISIBILITY_FLAG)
102#define SHPAPI_CALL __attribute__((visibility("default")))
103#define SHPAPI_CALL1(x) __attribute__((visibility("default"))) x
110#define SHPAPI_CALL1(x) x SHPAPI_CALL
118#define SHPAPI_WINDOWS
119#define SHPAPI_UTF8_HOOKS
128#if defined(_MSC_VER) && _MSC_VER >= 1400
147 double (*
Atof)(
const char *str);
152#ifdef SHPAPI_UTF8_HOOKS
204#define SHPT_POLYGON 5
205#define SHPT_MULTIPOINT 8
206#define SHPT_POINTZ 11
208#define SHPT_POLYGONZ 15
209#define SHPT_MULTIPOINTZ 18
210#define SHPT_POINTM 21
212#define SHPT_POLYGONM 25
213#define SHPT_MULTIPOINTM 28
214#define SHPT_MULTIPATCH 31
221#define SHPP_TRISTRIP 0
223#define SHPP_OUTERRING 2
224#define SHPP_INNERRING 3
225#define SHPP_FIRSTRING 4
271 const char *pszAccess,
const SAHooks *psHooks,
290 int *pnShapeType,
double *padfMinBound,
291 double *padfMaxBound);
301 const
int *panPartStart, const
int *panPartType,
302 int nVertices, const
double *padfX, const
double *padfY,
303 const
double *padfZ, const
double *padfM);
306 const
double *padfY, const
double *padfZ);
324#define MAX_DEFAULT_TREE_DEPTH 12
354 const
double *padfBoundsMin, const
double *padfBoundsMax);
365 double *padfBoundsMax,
int *);
367 const
double *, const
double *,
int);
370 double *padfBoundsMax,
int *pnShapeCount);
381 double *padfBoundsMin,
double *padfBoundsMax,
400 const
double *padfBoundsMax,
int *pnShapeCount);
404 int bMaxX,
int bMaxY,
int *pnShapeCount);
469#define XBASE_FLDHDR_SZ 32
471#define XBASE_FLDNAME_LEN_READ 11
473#define XBASE_FLDNAME_LEN_WRITE 10
475#define XBASE_FLD_MAX_WIDTH 255
493 char chType,
int nWidth,
int nDecimals);
500 const char *pszFieldName,
char chType,
501 int nWidth,
int nDecimals);
504 char *pszFieldName,
int *pnWidth,
508 const char *pszFieldName);
527 const
char *pszFieldValue);
531 const
char lFieldValue);
533 const
SHPDate *dateFieldValue);
535 int iField, const
void *pValue);
538 const
void *pRawTuple);
545 const
char *pszFilename);
DBFHandle DBFCloneEmpty(const DBFHandle psDBF, const char *pszFilename)
const char * DBFGetCodePage(const DBFHandle psDBF)
int DBFWriteIntegerAttribute(DBFHandle psDBF, int iRecord, int iField, int nValue)
const char * DBFReadTuple(DBFHandle psDBF, int hEntity)
DBFHandle DBFCreate(const char *pszFilename)
int DBFWriteStringAttribute(DBFHandle psDBF, int iRecord, int iField, const char *pszValue)
int DBFGetFieldCount(const DBFHandle psDBF)
int DBFMarkRecordDeleted(DBFHandle psDBF, int iShape, int bIsDeleted)
int DBFWriteLogicalAttribute(DBFHandle psDBF, int iRecord, int iField, const char lValue)
DBFHandle DBFOpenLL(const char *pszFilename, const char *pszAccess, const SAHooks *psHooks)
int DBFDeleteField(DBFHandle psDBF, int iField)
void DBFClose(DBFHandle psDBF)
int DBFAddField(DBFHandle psDBF, const char *pszFieldName, DBFFieldType eType, int nWidth, int nDecimals)
int DBFAlterFieldDefn(DBFHandle psDBF, int iField, const char *pszFieldName, char chType, int nWidth, int nDecimals)
int DBFWriteNULLAttribute(DBFHandle psDBF, int iRecord, int iField)
SHPDate DBFReadDateAttribute(DBFHandle psDBF, int iRecord, int iField)
int DBFIsRecordDeleted(const DBFHandle psDBF, int iShape)
void DBFSetWriteEndOfFileChar(DBFHandle psDBF, int bWriteFlag)
int DBFReadIntegerAttribute(DBFHandle psDBF, int iRecord, int iField)
DBFHandle DBFCreateEx(const char *pszFilename, const char *pszCodePage)
int DBFIsAttributeNULL(const DBFHandle psDBF, int iRecord, int iField)
DBFFieldType DBFGetFieldInfo(const DBFHandle psDBF, int iField, char *pszFieldName, int *pnWidth, int *pnDecimals)
int DBFReorderFields(DBFHandle psDBF, const int *panMap)
const char * DBFReadLogicalAttribute(DBFHandle psDBF, int iRecord, int iField)
int DBFWriteDoubleAttribute(DBFHandle psDBF, int iRecord, int iField, double dValue)
double DBFReadDoubleAttribute(DBFHandle psDBF, int iRecord, int iField)
void DBFSetLastModifiedDate(DBFHandle psDBF, int nYYSince1900, int nMM, int nDD)
void DBFUpdateHeader(DBFHandle psDBF)
char DBFGetNativeFieldType(const DBFHandle psDBF, int iField)
DBFHandle DBFCreateLL(const char *pszFilename, const char *pszCodePage, const SAHooks *psHooks)
int DBFAddNativeFieldType(DBFHandle psDBF, const char *pszFieldName, char chType, int nWidth, int nDecimals)
int DBFWriteAttributeDirectly(DBFHandle psDBF, int hEntity, int iField, const void *pValue)
int DBFGetRecordCount(const DBFHandle psDBF)
const char * DBFReadStringAttribute(DBFHandle psDBF, int iRecord, int iField)
int DBFWriteDateAttribute(DBFHandle psDBF, int iRecord, int iField, const SHPDate *lValue)
int DBFWriteTuple(DBFHandle psDBF, int hEntity, const void *pRawTuple)
DBFHandle DBFOpen(const char *pszFilename, const char *pszAccess)
int DBFGetFieldIndex(const DBFHandle psDBF, const char *pszFieldName)
void SASetupDefaultHooks(SAHooks *psHooks)
int SHPTreeAddShapeId(SHPTree *hTree, SHPObject *psObject)
int * SHPSearchDiskTree(FILE *fp, double *padfBoundsMin, double *padfBoundsMax, int *pnShapeCount)
void SHPDestroyObject(SHPObject *psObject)
SHPObject * SHPReadObject(const SHPHandle hSHP, int iShape)
int * SHPTreeFindLikelyShapes(const SHPTree *hTree, double *padfBoundsMin, double *padfBoundsMax, int *)
void SHPClose(SHPHandle hSHP)
int SHPCheckBoundsOverlap(const double *, const double *, const double *, const double *, int)
SHPHandle SHPOpenLLEx(const char *pszShapeFile, const char *pszAccess, const SAHooks *psHooks, int bRestoreSHX)
struct shape_tree_node SHPTreeNode
SHPObject * SHPCreateObject(int nSHPType, int nShapeId, int nParts, const int *panPartStart, const int *panPartType, int nVertices, const double *padfX, const double *padfY, const double *padfZ, const double *padfM)
SHPObject * SHPCreateSimpleObject(int nSHPType, int nVertices, const double *padfX, const double *padfY, const double *padfZ)
void SHPCloseDiskTree(SHPTreeDiskHandle hDiskTree)
int SHPWriteObject(SHPHandle hSHP, int iShape, const SHPObject *psObject)
void SBNCloseDiskTree(SBNSearchHandle hSBN)
void SHPDestroyTree(SHPTree *hTree)
struct SHPDiskTreeInfo * SHPTreeDiskHandle
SHPTreeDiskHandle SHPOpenDiskTree(const char *pszQIXFilename, const SAHooks *psHooks)
SHPHandle SHPOpenLL(const char *pszShapeFile, const char *pszAccess, const SAHooks *psHooks)
void SHPWriteHeader(SHPHandle hSHP)
SBNSearchHandle SBNOpenDiskTree(const char *pszSBNFilename, const SAHooks *psHooks)
void SBNSearchFreeIds(int *panShapeId)
SHPTree * SHPCreateTree(SHPHandle hSHP, int nDimension, int nMaxDepth, const double *padfBoundsMin, const double *padfBoundsMax)
const char * SHPTypeName(int nSHPType)
int * SHPSearchDiskTreeEx(const SHPTreeDiskHandle hDiskTree, double *padfBoundsMin, double *padfBoundsMax, int *pnShapeCount)
SHPHandle SHPOpen(const char *pszShapeFile, const char *pszAccess)
int SHPWriteTreeLL(SHPTree *hTree, const char *pszFilename, const SAHooks *psHooks)
void SHPTreeTrimExtraNodes(SHPTree *hTree)
void SHPGetInfo(const SHPHandle hSHP, int *pnEntities, int *pnShapeType, double *padfMinBound, double *padfMaxBound)
struct SBNSearchInfo * SBNSearchHandle
int SHPWriteTree(SHPTree *hTree, const char *pszFilename)
struct DBFInfo * DBFHandle
struct tagSHPObject SHPObject
int SHPRewindObject(const SHPHandle hSHP, SHPObject *psObject)
int SHPRestoreSHX(const char *pszShapeFile, const char *pszAccess, const SAHooks *psHooks)
int * SBNSearchDiskTree(const SBNSearchHandle hSBN, const double *padfBoundsMin, const double *padfBoundsMax, int *pnShapeCount)
int * SBNSearchDiskTreeInteger(const SBNSearchHandle hSBN, int bMinX, int bMinY, int bMaxX, int bMaxY, int *pnShapeCount)
const char * SHPPartTypeName(int nPartType)
void SHPSetFastModeReadObject(SHPHandle hSHP, int bFastMode)
void SHPComputeExtents(SHPObject *psObject)
SHPHandle SHPCreateLL(const char *pszShapeFile, int nShapeType, const SAHooks *psHooks)
SHPHandle SHPCreate(const char *pszShapeFile, int nShapeType)
int bCurrentRecordModified
int bRequireNextWriteSeek
SAOffset(*) FWrite(const void *p, SAOffset size, SAOffset nmemb, SAFile file)
void(*) Error(const char *message)
int(*) Remove(const char *filename, void *pvUserData)
SAOffset(*) FRead(void *p, SAOffset size, SAOffset nmemb, SAFile file)
SAOffset(*) FTell(SAFile file)
SAFile(*) FOpen(const char *filename, const char *access, void *pvUserData)
int(*) FFlush(SAFile file)
double(*) Atof(const char *str)
int(*) FClose(SAFile file)
SAOffset(*) FSeek(SAFile file, SAOffset offset, int whence)
SHPObject * psCachedObject
unsigned int * panRecSize
unsigned char * pabyObjectBuf
unsigned int * panRecOffset
SHPObject ** papsShapeObj
struct shape_tree_node * apsSubNode[4]