[Gdal-dev] ogr2ogr shapefile to postgis error

Michael Mallete mrmallete at gmail.com
Wed Sep 29 23:50:29 EDT 2004


hello again mr. warmerdam! 

yes now it works! i tried using ogr2ogr with "-nlt multipolygon"
option. i guess that solves that. thank you so much for this. :)

although i do have another problem. there are some shapefiles that
when i convert/insert, this error appears:

ERROR 1: INSERT command for new feature failed.
ERROR: numeric field overflow

ERROR 1: Terminating translation prematurely after failed translation
of layer <layer name here>

what does "numeric field overflow" mean? sorry for being a pest. my
problems just keep on coming. anyway thank you so much again sir for
your help.

have a nice day! :)

-Myk


On Wed, 29 Sep 2004 22:56:30 -0400, Frank Warmerdam <warmerdam at pobox.com> wrote:
> Michael Mallete wrote:
> > good day sir! thank you very much for your kind reply. :)
> >
> > yes it's a new table being created by ogr2ogr. how do i set the
> > CPL_DEBUG environment variable?
> >
> > anyways, i am using the OpenEV_FW kit in a Win2k platform. i am using
> > ogr2ogr to convert and insert shapefiles to postgis to an external
> > server running on a win2k server platfrom. i've had success converting
> > and inserting my other shapefiles. i only encounter this problem from
> > time to time. i'm wondering what's so unique with the data which
> > failed with the data which were successfully converted/inserted.
> >
> > anyways, thanx again sir! hoping my problem is solvable.
> 
> Myk,
> 
> OK, on review of the OGR PostGIS code and your error message, I am now
> guessing that your shapefiles contains polygons and OGR reports it's
> geometry type as Polygon.  If so, ogr2ogr will try to create a PostGIS
> table where the geometry column is constrained to be of type polygon.
> 
> However, polygon shapefiles can actually have some "multi-island"
> polygons.  Recently OGR was improved to treat these as Multipolygons
> as they ought to be according to the OpenGIS Simple Features geometry
> model.  The downside is that you can't put MultiPolygons into a Polygon
> geometry column in PostGIS.
> 
> If everything was being done manually, the trick would be to set the
> geometry type of the column to "GEOMETRY" in the AddGeometryColumn()
> call.
> 
> I was just going to say that ogr2ogr provides no means to do this.
> But on review of the ogr2ogr commandline options I see it does!
> 
> You should be able to add "-nlt geometry" to tell ogr2ogr to create the
> new layer with unconstrained geometry.  Let me know if this works.
> 
> 
> 
> Best regards,
> --
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | Geospatial Programmer for Rent
> 
>



More information about the Gdal-dev mailing list