[postgis-users] pgsql2shp ERROR:mixed geometry types in table

Denis Rykov rykovd at gmail.com
Sun Sep 5 23:28:10 PDT 2010


Yes, I convert my data using the following command "UPDATE osm_line SET way
= ST_Multi(way) where geometrytype(way) = 'LINESTRING'".

> time psql -U pgsql -d osm -c "UPDATE osm_line SET way = ST_Multi(way) where
> geometrytype(way) = 'LINESTRING';"
> UPDATE 914007
>
> real 70m12.384s
> user 0m0.009s
> sys 0m0.011s
>
 Many thanks for response. I will try them.
But actually I wouldn't want to convert my data to MULTI*. It is look like
hack to work with the new version of pgsql2shp.
I think that adding any option to pgsql2shp for turn of checking of geometry
types or downgrading to previous version of pgsql2shp can solve my problem.


2010/9/6 Stephen Woodbridge <woodbri at swoodbridge.com>:
> On 9/5/2010 10:16 PM, Denis Rykov wrote:
>>
>> I've tried to convert all my geometries to MULTI* with ST_Multi()
>> function but it works very slowly.
>>
>> 2010/9/5 Denis Rykov<rykovd at gmail.com>:
>>>
>>> Hi, I have a PostGIS table with Polygonal and Multi Polygonal  types
>>> of geometry.
>>> I used the pgsql2shp last year and had no problems. But some days ago
>>> I've update pgsql2shp from svn.
>>> And now I can't convert my PostGIS data into shapefile because I get
>>> an error : "ERROR: Mixed geometry types in table".
>>> I think that it is not necessary to consider this case as erroneous.
>
> Denis,
>
> How you converting them? Using and UPDATE?
> This would be very slow because every (most?) rows in the table would need
> to be updated.
>
> There are a couple of faster alternatives:
>
> 1. create table newtable select ..., st_multi(the_geom) form ...;
>   then dump that table
>
> 2. pgsql2shp [<options>] <database> "select ..., st_multi(the_geom) as
> the_geom from ...."
>
> -Steve W
> _______________________________________________
> 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/20100906/6c5b6b85/attachment.html>


More information about the postgis-users mailing list