Generate an allocated geometry string for shapefile object obj using the state parameters.
This function basically deals with the polygon case. It sorts the polys in order of outer, inner,inner, so that inners always come after outers they are within.
Definition at line 616 of file shp2pgsql-core.c.
619 int polygon_total, ring_total;
639 snprintf(state->
message,
SHPLOADERMSGLEN,
_(
"We have a Multipolygon with %d parts, can't use -S switch!"), polygon_total);
648 for (pi = 0; pi < polygon_total; pi++)
657 polyring = Outer[pi];
661 polyring = polyring->
next;
665 polyring = Outer[pi];
672 for (vi = 0; vi < polyring->
n; vi++)
675 point4d.
x = polyring->
list[vi].
x;
676 point4d.
y = polyring->
list[vi].
y;
679 point4d.
z = polyring->
list[vi].
z;
681 point4d.
m = polyring->
list[vi].
m;
689 polyring = polyring->
next;
704 lwgeom = lwpolygons[0];
LWGEOM * lwcollection_as_lwgeom(const LWCOLLECTION *obj)
void lwgeom_free(LWGEOM *geom)
LWGEOM * lwpoly_as_lwgeom(const LWPOLY *obj)
int lwpoly_add_ring(LWPOLY *poly, POINTARRAY *pa)
Add a ring, allocating extra space if necessary.
char * lwgeom_to_hexwkb(const LWGEOM *geom, uint8_t variant, size_t *size_out)
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
char * lwgeom_to_wkt(const LWGEOM *geom, uint8_t variant, int precision, size_t *size_out)
WKT emitter function.
LWCOLLECTION * lwcollection_construct(uint8_t type, int srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
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)
LWPOLY * lwpoly_construct_empty(int srid, char hasz, char hasm)
int FindPolygons(SHPObject *obj, Ring ***Out)
void ReleasePolygons(Ring **polys, int npolys)
char message[SHPLOADERMSGLEN]
struct struct_ring * next
References _, shp_loader_state::config, FindPolygons(), FLAGS_SET_M, FLAGS_SET_Z, shp_loader_state::from_srid, shp_loader_state::has_m, shp_loader_state::has_z, struct_ring::list, LW_TRUE, lwcollection_as_lwgeom(), lwcollection_construct(), lwfree(), lwgeom_free(), lwgeom_to_hexwkb(), lwgeom_to_wkt(), lwpoly_add_ring(), lwpoly_as_lwgeom(), lwpoly_construct_empty(), POINT4D::m, struct_point::m, malloc(), shp_loader_state::message, MULTIPOLYGONTYPE, struct_ring::n, struct_ring::next, ptarray_append_point(), ptarray_construct_empty(), ReleasePolygons(), SHPLOADERERR, SHPLOADERMSGLEN, SHPLOADEROK, shp_loader_config::simple_geometries, shp_loader_config::use_wkt, WKB_EXTENDED, WKT_EXTENDED, WKT_PRECISION, POINT4D::x, struct_point::x, POINT4D::y, struct_point::y, POINT4D::z, and struct_point::z.
Referenced by ShpLoaderGenerateSQLRowStatement().