Generate an allocated geometry string for shapefile object obj using the state parameters if "force_multi" is true, single points will instead be created as multipoints with a single vertice.
Definition at line 229 of file shp2pgsql-core.c.
230{
233
235
236 int dims = 0;
237 int u;
238
239 char *mem;
240 size_t mem_length;
241
244
245
247 {
249 }
250
251 else
252 {
253
255
256
258 {
259
261
262
263 point4d.
x = obj->
padfX[u];
264 point4d.
y = obj->
padfY[u];
265
267 point4d.
z = obj->
padfZ[u];
269 point4d.
m = obj->
padfM[u];
270
271
273
274
276 }
277
278
279
281 {
283 }
284 else
285 {
286 lwgeom = lwmultipoints[0];
288 }
289 }
290
292 {
294 }
295 else
296 {
298 }
299
300 if ( !mem )
301 {
304 }
305
306
308
309
310 *geometry = mem;
311
313}
LWCOLLECTION * lwcollection_construct(uint8_t type, int32_t srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
char * lwgeom_to_hexwkb_buffer(const LWGEOM *geom, uint8_t variant)
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
void lwgeom_free(LWGEOM *geom)
LWPOINT * lwpoint_construct(int32_t srid, GBOX *bbox, POINTARRAY *point)
char * lwgeom_to_wkt(const LWGEOM *geom, uint8_t variant, int precision, size_t *size_out)
WKT emitter function.
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
LWPOINT * lwpoint_construct_empty(int32_t srid, char hasz, char hasm)
int ptarray_append_point(POINTARRAY *pa, const POINT4D *pt, int allow_duplicates)
Append a point to the end of an existing POINTARRAY If allow_duplicate is LW_FALSE,...
#define LW_TRUE
Return types for functions with status returns.
#define FLAGS_SET_M(flags, value)
#define FLAGS_SET_Z(flags, value)
LWGEOM * lwcollection_as_lwgeom(const LWCOLLECTION *obj)
char message[SHPLOADERMSGLEN]
References shp_loader_state::config, FLAGS_SET_M, FLAGS_SET_Z, shp_loader_state::from_srid, shp_loader_state::has_m, shp_loader_state::has_z, LW_TRUE, lwcollection_as_lwgeom(), lwcollection_construct(), lwfree(), lwgeom_free(), lwgeom_to_hexwkb_buffer(), lwgeom_to_wkt(), lwpoint_as_lwgeom(), lwpoint_construct(), lwpoint_construct_empty(), POINT4D::m, malloc(), shp_loader_state::message, MULTIPOINTTYPE, tagSHPObject::nVertices, tagSHPObject::padfM, tagSHPObject::padfX, tagSHPObject::padfY, tagSHPObject::padfZ, ptarray_append_point(), ptarray_construct_empty(), SHPLOADERERR, SHPLOADERMSGLEN, SHPLOADEROK, shp_loader_config::use_wkt, WKB_EXTENDED, WKT_EXTENDED, WKT_PRECISION, POINT4D::x, POINT4D::y, and POINT4D::z.
Referenced by ShpLoaderGenerateSQLRowStatement().