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 0
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
136 SAFile (*FOpen)(
const char *filename,
const char *
access,
void *pvUserData);
144 int (*Remove)(
const char *filename,
void *pvUserData);
152#ifdef SHPAPI_UTF8_HOOKS
176 double adBoundsMin[4];
177 double adBoundsMax[4];
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
301 const int *panPartStart,
const int *panPartType,
302 int nVertices,
const double *padfX,
const double *padfY,
324#define MAX_DEFAULT_TREE_DEPTH 12
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
482 const char *pszCodePage);
484 const char *pszCodePage,
int SHPTreeAddShapeId(SHPTree *hTree, SHPObject *psObject)
int * SHPSearchDiskTree(FILE *fp, double *padfBoundsMin, double *padfBoundsMax, int *pnShapeCount)
DBFHandle DBFCloneEmpty(const DBFHandle psDBF, const char *pszFilename)
void SHPDestroyObject(SHPObject *psObject)
SHPObject * SHPReadObject(const SHPHandle hSHP, int iShape)
const char * DBFGetCodePage(const DBFHandle psDBF)
int DBFAddNativeFieldType(DBFHandle hDBF, const char *pszFieldName, char chType, int nWidth, int nDecimals)
SHPDate DBFReadDateAttribute(DBFHandle hDBF, int iShape, int iField)
DBFHandle DBFOpenLL(const char *pszDBFFile, const char *pszAccess, const SAHooks *psHooks)
const char * DBFReadTuple(DBFHandle psDBF, int hEntity)
int * SHPTreeFindLikelyShapes(const SHPTree *hTree, double *padfBoundsMin, double *padfBoundsMax, int *)
int DBFAddField(DBFHandle hDBF, const char *pszFieldName, DBFFieldType eType, int nWidth, int nDecimals)
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)
int DBFWriteDoubleAttribute(DBFHandle hDBF, int iShape, int iField, double dFieldValue)
struct shape_tree_node SHPTreeNode
int DBFGetFieldCount(const DBFHandle psDBF)
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)
char DBFGetNativeFieldType(const DBFHandle hDBF, int iField)
void SHPCloseDiskTree(SHPTreeDiskHandle hDiskTree)
int SHPWriteObject(SHPHandle hSHP, int iShape, const SHPObject *psObject)
int DBFMarkRecordDeleted(DBFHandle psDBF, int iShape, int bIsDeleted)
void SBNCloseDiskTree(SBNSearchHandle hSBN)
void SHPDestroyTree(SHPTree *hTree)
const char * DBFReadStringAttribute(DBFHandle hDBF, int iShape, int iField)
int DBFAlterFieldDefn(DBFHandle psDBF, int iField, const char *pszFieldName, char chType, int nWidth, int nDecimals)
SHPTreeDiskHandle SHPOpenDiskTree(const char *pszQIXFilename, const SAHooks *psHooks)
int DBFIsRecordDeleted(const DBFHandle psDBF, int iShape)
void DBFSetWriteEndOfFileChar(DBFHandle psDBF, int bWriteFlag)
int DBFWriteIntegerAttribute(DBFHandle hDBF, int iShape, int iField, int nFieldValue)
SHPHandle SHPOpenLL(const char *pszShapeFile, const char *pszAccess, const SAHooks *psHooks)
void SHPWriteHeader(SHPHandle hSHP)
int DBFWriteDateAttribute(DBFHandle hDBF, int iShape, int iField, const SHPDate *dateFieldValue)
int DBFDeleteField(DBFHandle hDBF, int iField)
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)
DBFFieldType DBFGetFieldInfo(const DBFHandle psDBF, int iField, char *pszFieldName, int *pnWidth, int *pnDecimals)
int DBFReorderFields(DBFHandle psDBF, const int *panMap)
void DBFUpdateHeader(DBFHandle hDBF)
const char * SHPTypeName(int nSHPType)
int * SHPSearchDiskTreeEx(const SHPTreeDiskHandle hDiskTree, double *padfBoundsMin, double *padfBoundsMax, int *pnShapeCount)
int DBFReadIntegerAttribute(DBFHandle hDBF, int iShape, int iField)
DBFHandle DBFCreate(const char *pszDBFFile)
SHPHandle SHPOpen(const char *pszShapeFile, const char *pszAccess)
DBFHandle DBFCreateLL(const char *pszDBFFile, const char *pszCodePage, const SAHooks *psHooks)
const char * DBFReadLogicalAttribute(DBFHandle hDBF, int iShape, int iField)
int SHPWriteTreeLL(SHPTree *hTree, const char *pszFilename, const SAHooks *psHooks)
int DBFIsAttributeNULL(const DBFHandle hDBF, int iShape, int iField)
void DBFSetLastModifiedDate(DBFHandle psDBF, int nYYSince1900, int nMM, int nDD)
void SHPTreeTrimExtraNodes(SHPTree *hTree)
int DBFWriteNULLAttribute(DBFHandle hDBF, int iShape, int iField)
double DBFReadDoubleAttribute(DBFHandle hDBF, int iShape, int iField)
void SHPGetInfo(const SHPHandle hSHP, int *pnEntities, int *pnShapeType, double *padfMinBound, double *padfMaxBound)
DBFHandle DBFCreateEx(const char *pszDBFFile, const char *pszCodePage)
void SASetupDefaultHooks(SAHooks *psHooks)
int SHPWriteTree(SHPTree *hTree, const char *pszFilename)
int SHPRewindObject(const SHPHandle hSHP, SHPObject *psObject)
DBFHandle DBFOpen(const char *pszDBFFile, const char *pszAccess)
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)
int DBFWriteAttributeDirectly(DBFHandle psDBF, int hEntity, int iField, const void *pValue)
void SHPSetFastModeReadObject(SHPHandle hSHP, int bFastMode)
void SHPComputeExtents(SHPObject *psObject)
int DBFGetRecordCount(const DBFHandle psDBF)
void DBFClose(DBFHandle hDBF)
int DBFWriteTuple(DBFHandle psDBF, int hEntity, const void *pRawTuple)
int DBFGetFieldIndex(const DBFHandle psDBF, const char *pszFieldName)
SHPHandle SHPCreateLL(const char *pszShapeFile, int nShapeType, const SAHooks *psHooks)
SHPHandle SHPCreate(const char *pszShapeFile, int nShapeType)
int DBFWriteStringAttribute(DBFHandle hDBF, int iShape, int iField, const char *pszFieldValue)
int DBFWriteLogicalAttribute(DBFHandle hDBF, int iShape, int iField, const char lFieldValue)
int bCurrentRecordModified
int bRequireNextWriteSeek
SHPObject * psCachedObject
unsigned int * panRecSize
unsigned char * pabyObjectBuf
unsigned int * panRecOffset
SHPObject ** papsShapeObj
struct shape_tree_node * apsSubNode[4]