[FWTools] enforce_geotype_wkb_geometry

Frank Warmerdam warmerdam at pobox.com
Tue Oct 18 13:51:13 EDT 2005


On 10/18/05, Frances Collier <fcollier at preparedresponse.com> wrote:
> I need some help, again, with the ogr2ogr function. I am trying to put a
> shapefile into postgreSQL using ogr2ogr.
>
> The command:
>
> '>ogr2ogr –f "PostgreSQL" "PG:dbname=dcmms host=localhost user=postgres
> password=password" wawaterbodies.shp -lco PRCISION=NO'
>
> The error:
>
> 'ERROR 1: INSERT command for new feature failed.
>
> ERROR: new row for relation "wawaterbodies" violates check constraint
> "enforce_geotype_wkb_geometry"
>
> The shape for the file is Polygon. What am I doing wrong?

Frances,

You don't mention what version of FWTools (or PostGIS) you are
using.  There has been work in this area since the spring so
make sure you are using a very recent FWTools (ie 1.0.0a4).
If it still does not work, try adding:

 -lco DIM=2

to your command.

Looking at the current code, I think OGR is supposed to force
the coordinate dimension of the geometries pushed into PostGIS
to match the dimension of the created table but if that is not working
properly I will need to look into it.

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 FWTools mailing list