[postgis-users] Multipolygons to Polygon

Kevin Neufeld kneufeld at refractions.net
Wed Apr 16 12:28:24 PDT 2008


Use ST_GeometryN(geometry, int) if you're sure you only have one 
geometry in them.
http://postgis.refractions.net/docs/ch06.html#id2964448

You can test this by:
SELECT ST_NumGeometries(the_geom), count(*)
FROM my_tbl
GROUP BY ST_NumGeometries;

If you don't have any check constraints on your table:
UPDATE my_tbl
  SET the_geom = ST_GeometryN(the_geom, 1);

-- Kevin

George Silva wrote:
> Hello everyone,
>
> I have a converted dataset that has only polygons, but they were 
> imported from ArcGIS as Multipolygons. I need them to become simple 
> polygons. (I dont have any real multi-polygons in the table - they 
> were just imported that way.
>
> How can i convert this dataset to regular tyep polygons *question 
> mark* (no question marks on this keyboard :( )
>
> Thx for the help!
> ------------------------------------------------------------------------
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>   



More information about the postgis-users mailing list