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 227 of file shp2pgsql-core.c.
228{
231
233
234 int dims = 0;
235 int u;
236
237 char *mem;
238 size_t mem_length;
239
242
243
245 {
247 }
248
249 else
250 {
251
253
254
256 {
257
259
260
261 point4d.
x = obj->
padfX[u];
262 point4d.
y = obj->
padfY[u];
263
265 point4d.
z = obj->
padfZ[u];
267 point4d.
m = obj->
padfM[u];
268
269
271
272
274 }
275
276
277
279 {
281 }
282 else
283 {
284 lwgeom = lwmultipoints[0];
286 }
287 }
288
290 {
292 }
293 else
294 {
296 }
297
298 if ( !mem )
299 {
302 }
303
304
306
307
308 *geometry = mem;
309
311}
LWCOLLECTION * lwcollection_construct(uint8_t type, int32_t srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
char * lwgeom_to_hexwkb(const LWGEOM *geom, uint8_t variant, size_t *size_out)
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(), lwgeom_to_wkt(), lwpoint_as_lwgeom(), lwpoint_construct(), lwpoint_construct_empty(), POINT4D::m, malloc(), shp_loader_state::message, MULTIPOINTTYPE, SHPObject::nVertices, SHPObject::padfM, SHPObject::padfX, SHPObject::padfY, SHPObject::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().