[postgis-users] casting a geometry

Luigi Castro Cardeles luigi.cardeles at gmail.com
Wed Jun 3 12:24:44 PDT 2009


Hi
if they are polygon's, you can turn then into multi

ST_Multi(geometry)

Returns the geometry as a MULTI* geometry. If the geometry is already a
MULTI*, it is returned unchanged.

SELECT ST_MULTI(wkb_geometry) FROM table;

See if your postgis version have that function.

best regards,

Luigi Castro Cardeles


2009/6/3 Richard Greenwood <richard.greenwood at gmail.com>

> I am having trouble inserting geometries into a table. The geometry
> column has a constraint:
>   enforce_geotype_wkb_geometry CHECK (geometrytype(wkb_geometry) =
> 'MULTIPOLYGON'::text
>      OR wkb_geometry IS NULL);
>
> I am attempting to insert what I assume are polygons generated by
> st_buffer() but they violate the constraint. If I pgsql2shp the
> polygons out I can insert them into the table, but that's pretty ugly.
>
> Thanks,
> --
> Richard Greenwood
> richard.greenwood at gmail.com
> www.greenwoodmap.com
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090603/5a96165f/attachment.html>


More information about the postgis-users mailing list