Commit b38942df authored by Mark Cave-Ayland's avatar Mark Cave-Ayland

Fix #603: shp2pgsql: "-w" produces invalid WKT for MULTI* objects.


git-svn-id: http://svn.osgeo.org/postgis/[email protected] b70326c6-7e19-0410-871a-916f4a2858ee
parent 6e64f0aa
......@@ -409,6 +409,14 @@ GenerateLineStringGeometry(SHPLOADERSTATE *state, SHPObject *obj, char **geometr
if (state->config->simple_geometries == 0)
{
lwcollection = lwcollection_construct(MULTILINETYPE, state->config->sr_id, NULL, obj->nParts, lwmultilinestrings);
/* When outputting wkt rather than wkb, we need to remove the SRID from the inner geometries */
if (state->config->hwgeom)
{
for (u = 0; u < obj->nParts; u++)
lwmultilinestrings[u]->SRID = -1;
}
serialized_lwgeom = lwgeom_serialize(lwcollection_as_lwgeom(lwcollection));
}
......@@ -766,6 +774,14 @@ GeneratePolygonGeometry(SHPLOADERSTATE *state, SHPObject *obj, char **geometry)
if (state->config->simple_geometries == 0)
{
lwcollection = lwcollection_construct(MULTIPOLYGONTYPE, state->config->sr_id, NULL, polygon_total, lwpolygons);
/* When outputting wkt rather than wkb, we need to remove the SRID from the inner geometries */
if (state->config->hwgeom)
{
for (u = 0; u < pi; u++)
lwpolygons[u]->SRID = -1;
}
serialized_lwgeom = lwgeom_serialize(lwcollection_as_lwgeom(lwcollection));
}
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment