[postgis-users] Invalid geometry

Paul Ramsey pramsey at cleverelephant.ca
Thu Nov 27 11:40:06 PST 2008


Try including one non-spatial field in the table you dump.

P

On Thu, Nov 27, 2008 at 11:33 AM, Travis Kirstine
<traviskirstine at gmail.com> wrote:
> I'm having some problems with shapefiles dumped out of postgis using
> the pgsql2shp utility.  I am creating a geometry union using the
> upgis_cascadeunion function then exploding the multi features to
> single part features
>
> CREATE TABLE omnr_glcbp_geomunion AS SELECT
> upgis_cascadeunion(the_geom) as the_geom from omnr_glcbp_watersheds;
>
> CREATE TABLE omnr_glcbp_boundary AS SELECT ST_GeometryN(the_geom,
> generate_series(1, ST_NumGeometries(the_geom))) AS the_geom FROM
> omnr_glcbp_geomunion ;
>
> I then checked that that the geometry was valid and a multipolygon and
> everything looks fine.  When the data is dumped to a shp file I get a
> error when opening the file with arcgis "Number of shapes does not
> match number of table records".  Also when I check the shapefile with
> ogrinfo it does not report the geometry (returns Unknown).  I thought
> that upgis_cascadeunion might be causing the problem however I had the
> same results when using the ST_Buffer(Collect(the_geom), 0) to
> dissolve the polygons.
> --
> Travis K.
>
> Toronto, Canada
> ------------------------------------------------------------
> "She knows there's no success like failure
> And that failure's no success at all."
> -Bob Dylan-
> ------------------------------------------------------------
> _______________________________________________
> 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