GRASS 8 Programmer's Manual
8.5.0dev(2025)-c070206eb1
|
#include "shapefil_private.h"
#include <assert.h>
#include <errno.h>
#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Go to the source code of this file.
Macros | |
#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) |
Functions | |
void | SHPWriteHeader (SHPHandle psSHP) |
SHPHandle | SHPOpen (const char *pszLayer, const char *pszAccess) |
SHPHandle | SHPOpenLL (const char *pszLayer, const char *pszAccess, const SAHooks *psHooks) |
SHPHandle | SHPOpenLLEx (const char *pszLayer, const char *pszAccess, const SAHooks *psHooks, int bRestoreSHX) |
int | SHPRestoreSHX (const char *pszLayer, const char *pszAccess, const SAHooks *psHooks) |
void | SHPClose (SHPHandle psSHP) |
void | SHPSetFastModeReadObject (SHPHandle hSHP, int bFastMode) |
void | SHPGetInfo (const SHPHandle psSHP, int *pnEntities, int *pnShapeType, double *padfMinBound, double *padfMaxBound) |
SHPHandle | SHPCreate (const char *pszLayer, int nShapeType) |
SHPHandle | SHPCreateLL (const char *pszLayer, int nShapeType, const SAHooks *psHooks) |
void | SHPComputeExtents (SHPObject *psObject) |
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) |
int | SHPWriteObject (SHPHandle psSHP, int nShapeId, const SHPObject *psObject) |
SHPObject * | SHPReadObject (const SHPHandle psSHP, int hEntity) |
const char * | SHPTypeName (int nSHPType) |
const char * | SHPPartTypeName (int nPartType) |
void | SHPDestroyObject (SHPObject *psShape) |
int | SHPRewindObject (const SHPHandle hSHP, SHPObject *psObject) |
void SHPClose | ( | SHPHandle | psSHP | ) |
Definition at line 821 of file shpopen.c.
References SHPInfo::bUpdated, SAHooks::FClose, SHPInfo::fpSHP, SHPInfo::fpSHX, free(), SHPInfo::pabyObjectBuf, SHPInfo::pabyRec, SHPInfo::panRecOffset, SHPInfo::panRecSize, SHPInfo::psCachedObject, SHPInfo::sHooks, SHPLIB_NULLPTR, and SHPWriteHeader().
void SHPComputeExtents | ( | SHPObject * | psObject | ) |
Definition at line 1099 of file shpopen.c.
References tagSHPObject::dfMMax, tagSHPObject::dfMMin, tagSHPObject::dfXMax, tagSHPObject::dfXMin, tagSHPObject::dfYMax, tagSHPObject::dfYMin, tagSHPObject::dfZMax, tagSHPObject::dfZMin, MAX, MIN, tagSHPObject::nVertices, tagSHPObject::padfM, tagSHPObject::padfX, tagSHPObject::padfY, and tagSHPObject::padfZ.
Referenced by SHPCreateObject().
SHPHandle SHPCreate | ( | const char * | pszLayer, |
int | nShapeType | ||
) |
Definition at line 914 of file shpopen.c.
References SASetupDefaultHooks(), and SHPCreateLL().
Definition at line 930 of file shpopen.c.
Referenced by SHPCreate().
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 | ||
) |
Definition at line 1132 of file shpopen.c.
References tagSHPObject::bMeasureIsUsed, FALSE, malloc(), MAX, tagSHPObject::nParts, tagSHPObject::nShapeId, tagSHPObject::nSHPType, tagSHPObject::nVertices, tagSHPObject::padfM, tagSHPObject::padfX, tagSHPObject::padfY, tagSHPObject::padfZ, tagSHPObject::panPartStart, tagSHPObject::panPartType, SHPComputeExtents(), SHPLIB_NULLPTR, SHPP_RING, SHPT_ARC, SHPT_ARCM, SHPT_ARCZ, SHPT_MULTIPATCH, SHPT_MULTIPOINTM, SHPT_MULTIPOINTZ, SHPT_POINTM, SHPT_POINTZ, SHPT_POLYGON, SHPT_POLYGONM, SHPT_POLYGONZ, STATIC_CAST, and TRUE.
Referenced by SHPCreateSimpleObject().
SHPObject* SHPCreateSimpleObject | ( | int | nSHPType, |
int | nVertices, | ||
const double * | padfX, | ||
const double * | padfY, | ||
const double * | padfZ | ||
) |
Definition at line 1242 of file shpopen.c.
References SHPCreateObject(), and SHPLIB_NULLPTR.
void SHPDestroyObject | ( | SHPObject * | psShape | ) |
Definition at line 2654 of file shpopen.c.
References tagSHPObject::bFastModeReadObject, FALSE, free(), tagSHPObject::padfM, tagSHPObject::padfX, tagSHPObject::padfY, tagSHPObject::padfZ, tagSHPObject::panPartStart, tagSHPObject::panPartType, and SHPLIB_NULLPTR.
Referenced by SHPReadObject().
void SHPGetInfo | ( | const SHPHandle | psSHP, |
int * | pnEntities, | ||
int * | pnShapeType, | ||
double * | padfMinBound, | ||
double * | padfMaxBound | ||
) |
Definition at line 886 of file shpopen.c.
References SHPInfo::adBoundsMax, SHPInfo::adBoundsMin, SHPInfo::nRecords, SHPInfo::nShapeType, and SHPLIB_NULLPTR.
SHPHandle SHPOpen | ( | const char * | pszLayer, |
const char * | pszAccess | ||
) |
Definition at line 213 of file shpopen.c.
References SASetupDefaultHooks(), and SHPOpenLL().
Definition at line 245 of file shpopen.c.
References SHPInfo::bUpdated, FALSE, SHPInfo::sHooks, SHPLIB_NULLPTR, and STATIC_CAST.
Referenced by SHPOpen(), and SHPOpenLLEx().
SHPHandle SHPOpenLLEx | ( | const char * | pszLayer, |
const char * | pszAccess, | ||
const SAHooks * | psHooks, | ||
int | bRestoreSHX | ||
) |
Definition at line 586 of file shpopen.c.
References SHPLIB_NULLPTR, SHPOpenLL(), and SHPRestoreSHX().
const char* SHPPartTypeName | ( | int | nPartType | ) |
Definition at line 2624 of file shpopen.c.
References SHPP_FIRSTRING, SHPP_INNERRING, SHPP_OUTERRING, SHPP_RING, SHPP_TRIFAN, and SHPP_TRISTRIP.
Definition at line 1785 of file shpopen.c.
References tagSHPObject::bFastModeReadObject, tagSHPObject::bMeasureIsUsed, tagSHPObject::dfXMax, tagSHPObject::dfXMin, tagSHPObject::dfYMax, tagSHPObject::dfYMin, FALSE, tagSHPObject::nShapeId, tagSHPObject::nSHPType, SHP_SWAP32, SHP_SWAPDOUBLE_CPY, SHPDestroyObject(), SHPLIB_NULLPTR, SHPT_ARC, SHPT_ARCM, SHPT_ARCZ, SHPT_MULTIPATCH, SHPT_POLYGON, SHPT_POLYGONM, SHPT_POLYGONZ, and STATIC_CAST.
int SHPRestoreSHX | ( | const char * | pszLayer, |
const char * | pszAccess, | ||
const SAHooks * | psHooks | ||
) |
Definition at line 607 of file shpopen.c.
Referenced by SHPOpenLLEx().
Definition at line 2785 of file shpopen.c.
References FALSE, tagSHPObject::nParts, tagSHPObject::nSHPType, tagSHPObject::nVertices, tagSHPObject::padfZ, tagSHPObject::panPartStart, SHPT_POLYGON, SHPT_POLYGONM, SHPT_POLYGONZ, and TRUE.
void SHPSetFastModeReadObject | ( | SHPHandle | hSHP, |
int | bFastMode | ||
) |
Definition at line 867 of file shpopen.c.
References assert, SHPInfo::bFastModeReadObject, SHPInfo::psCachedObject, SHPLIB_NULLPTR, and STATIC_CAST.
const char* SHPTypeName | ( | int | nSHPType | ) |
Definition at line 2570 of file shpopen.c.
References SHPT_ARC, SHPT_ARCM, SHPT_ARCZ, SHPT_MULTIPATCH, SHPT_MULTIPOINT, SHPT_MULTIPOINTM, SHPT_MULTIPOINTZ, SHPT_NULL, SHPT_POINT, SHPT_POINTM, SHPT_POINTZ, SHPT_POLYGON, SHPT_POLYGONM, and SHPT_POLYGONZ.
void SHPWriteHeader | ( | SHPHandle | psSHP | ) |
Definition at line 56 of file shpopen.c.
References SHPInfo::adBoundsMax, SHPInfo::adBoundsMin, ByteCopy, SAHooks::Error, SAHooks::FFlush, SHPInfo::fpSHP, SHPInfo::fpSHX, free(), SAHooks::FSeek, SAHooks::FWrite, malloc(), SHPInfo::nFileSize, SHPInfo::nRecords, SHPInfo::nShapeType, SHPInfo::panRecOffset, SHPInfo::panRecSize, SHPInfo::sHooks, SHP_SWAP32, SHP_SWAP64, SHPLIB_NULLPTR, and STATIC_CAST.
Referenced by SHPClose().
Definition at line 1256 of file shpopen.c.
References assert, SHPInfo::bUpdated, SAHooks::Error, malloc(), SHPInfo::nMaxRecords, tagSHPObject::nParts, SHPInfo::nRecords, SHPInfo::nShapeType, tagSHPObject::nSHPType, tagSHPObject::nVertices, SHPInfo::panRecOffset, SHPInfo::panRecSize, SHPInfo::sHooks, SHPLIB_NULLPTR, SHPT_ARC, SHPT_ARCM, SHPT_ARCZ, SHPT_MULTIPATCH, SHPT_NULL, SHPT_POLYGON, SHPT_POLYGONM, SHPT_POLYGONZ, STATIC_CAST, and TRUE.