[Gdal-dev] Need Help with ogr2ogr Import Shapefile Error

Bill Thoen bthoen at gisnet.com
Mon Dec 4 12:44:12 EST 2006


I just tried to import a shapefile into an empty database,but got an error
I don't understand. Can anyone tell me what's wrong and how to fix this?

The table is projected in the NAD83 UTM zone 16 system. The shapefile has
associated .dbf, .prj, .sbn, .sbx, .shp, .shp.xml, and .shx files.
Here's what I tried:

$ ogr2ogr -update -append -f PostgreSQL PG:dbname=clu 
   clu_001ilna04_U.shp -a_srs EPSG:26916

ERROR 1: INSERT command for new feature failed.
ERROR:  new row for relation "clu_001ilna04_U" violates check constraint
"enforce_geotype_wkb_geometry"

Command: INSERT INTO "clu_001ilna04_U" (wkb_geometry , "calcacres",
"fid_clu_pu", "fid_raster", "gridcode", "id") VALUES
(GeomFromEWKT('SRID=32767;MULTIPOLYGON (((644362.065155122079886
4450705.620940338820219,644363.544632167438976
4450692.674534672871232,644362.506020959932357
4450668.265126464888453,644361.73160208191257
4450667.269374941475689,644350.386709051439539
4450666.500845180824399,644348.361834342591465
4450696.390567463822663,644318.472275645937771
4450694.365692755207419,644320.015551458112895
4450671.584788967855275,644310.571207334287465
4450677.094057868234813,644295.510117926285602
4450688.519762669689953,644286.307391183683649
4450705.73757757153362,644362.065155122079886
4450705.620940338820219)),((644350.68460021680221
4450662.102819930762053,644347.444931551930495
4450661.513744649477303,644332.707743575796485
4450665.303227815777063,644350.386709051439539
4450666.500845180824399,644350.68460021680221
4450662.102819930762053)))'::TEXT) ,     0.61, 1, 4857272, 61, 4857273)

ERROR 1: Terminating translation prematurely after failed
translation of layer clu_001ilna04_U

TIA,

- Bill Thoen




More information about the Gdal-dev mailing list