1982 char *hexewkb = NULL;
1983 unsigned char *hexewkb_binary = NULL;
1989 int i, geocolnum = 0;
2007 if (PQresultStatus(state->
fetchres) != PGRES_TUPLES_OK)
2020 geocolnum = PQfnumber(state->
fetchres,
"_geoX");
2077 LWDEBUG(4,
"PostGIS >= 1.0, non-binary cursor");
2081 hexewkb_binary = PQunescapeBytea((
unsigned char *)val, &hexewkb_len);
2086 LWDEBUG(4,
"PostGIS < 1.0, non-binary cursor");
2091 hexewkb =
malloc(hexewkb_len + 1);
2092 strncpy(hexewkb, val, hexewkb_len + 1);
2097 LWDEBUG(4,
"PostGIS (any version) using binary cursor");
2104 LWDEBUGF(4,
"HexEWKB - length: %d value: %s", strlen(hexewkb), hexewkb);
2119 switch (lwgeom->
type)
2174 if (hexewkb)
free(hexewkb);
2175 if (hexewkb_binary) PQfreemem(hexewkb_binary);
static SHPObject * create_point(SHPDUMPERSTATE *state, LWPOINT *lwpoint)
SHPObject SHPAPI_CALL1 * SHPCreateSimpleObject(int nSHPType, int nVertices, const double *padfX, const double *padfY, const double *padfZ){ return(SHPCreateObject(nSHPType, -1, 0, NULL, NULL, nVertices, padfX, padfY, padfZ, NULL)
static SHPObject * create_polygon(SHPDUMPERSTATE *state, LWPOLY *lwpolygon)
char * convert_bytes_to_hex(uint8_t *ewkb, size_t size)
Binary to hexewkb conversion function.
static SHPObject * create_multilinestring(SHPDUMPERSTATE *state, LWMLINE *lwmultilinestring)
void lwgeom_free(LWGEOM *geom)
static char * goodDBFValue(char *in, char fieldType)
Make appropriate formatting of a DBF value based on type.
int SHPAPI_CALL DBFWriteAttributeDirectly(DBFHandle psDBF, int hEntity, int iField, void *pValue)
#define LWDEBUG(level, msg)
void SHPAPI_CALL SHPDestroyObject(SHPObject *psObject)
LWPOLY * lwgeom_as_lwpoly(const LWGEOM *lwgeom)
LWPOINT * lwgeom_as_lwpoint(const LWGEOM *lwgeom)
LWMPOLY * lwgeom_as_lwmpoly(const LWGEOM *lwgeom)
#define LW_PARSER_CHECK_NONE
static SHPObject * create_linestring(SHPDUMPERSTATE *state, LWLINE *lwlinestring)
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
LWMLINE * lwgeom_as_lwmline(const LWGEOM *lwgeom)
static SHPObject * create_multipoint(SHPDUMPERSTATE *state, LWMPOINT *lwmultipoint)
LWLINE * lwgeom_as_lwline(const LWGEOM *lwgeom)
LWGEOM * lwgeom_from_hexwkb(const char *hexwkb, const char check)
int SHPAPI_CALL SHPWriteObject(SHPHandle psSHP, int nShapeId, SHPObject *psObject)
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
LWMPOINT * lwgeom_as_lwmpoint(const LWGEOM *lwgeom)
static char * nullDBFValue(char fieldType)
static SHPObject * create_multipolygon(SHPDUMPERSTATE *state, LWMPOLY *lwmultipolygon)
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members) ...
char message[SHPDUMPERMSGLEN]
static SHPObject * create_point_empty(SHPDUMPERSTATE *state, LWPOINT *lwpoint)
#define LWDEBUGF(level, msg,...)