Opened 19 years ago

Closed 9 years ago

#768 closed defect (invalid)

ogr2ogr, postgis, s57 & enforce_dims_wkb_geometry

Reported by: halset@… Owned by: warmerdam
Priority: high Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description (last modified by Jukka Rahkonen)

I have installed the following on my mac with Mac OS X 10.3.7:
postgresql-8.0.1
postgis-1.0.0-rc2
gdal-1.2.5

I am trying to load a single S-57 cell into the database, but the first insert fails.
LOG:  statement: INSERT INTO "airare" (wkb_geometry , "rcid", "prim", "grup", "objl", "rver", "agen", 
"fidn", "fids", "lnam", "catair", "scamin") VALUES (GeometryFromText('POINT 
(15.47197780 78.24509130)'::TEXT,1) , 684, 1, 2, 2, 1, 340, 1334049, 50002, '015400145B21C352', 
'2', 270000)
ERROR:  new row for relation "airare" violates check constraint "enforce_dims_wkb_geometry"

This is the same error with another cell:
LOG:  statement: INSERT INTO "achare" (wkb_geometry , "rcid", "prim", "grup", "objl", "rver", "agen", 
"fidn", "fids", "lnam", "catach", "status", "scamin") VALUES (GeometryFromText('POINT 
(16.82046390 77.82454520)'::TEXT,1) , 476, 1, 2, 4, 1, 340, 953081, 50004, '0154000E8AF9C354', 
'1', '3', 360000)
ERROR:  new row for relation "achare" violates check constraint "enforce_dims_wkb_geometry"

The enforce_dims_wkb_geometry constraint are equal in airare and achare:
    "enforce_dims_wkb_geometry" CHECK (ndims(wkb_geometry) = 3)

Anyone knows how this can be fixed?

Change History (4)

comment:1 by halset@…, 19 years ago

I tried to drop the enforce_dims_wkb_geometry constraint, but it is recreated the next time I run 
ogr2ogr.

comment:2 by halset@…, 19 years ago

I got passed this point by commenting out the special handling of z==0 in OGRMakeWktCoordinate

comment:3 by Jukka Rahkonen, 9 years ago

Description: modified (diff)

If this is the file to study trunk/gdal/ogr/ogrutils.cpp then I do not see anything about z==0 that was the part of code that fixed the issue for user halset.

The issue may be fixed and this ticket can be closed but I can't say it for sure.

comment:4 by Even Rouault, 9 years ago

Resolution: invalid
Status: newclosed

Let's assume it is fixed. Playing with -nlt in ogr2ogr should fix/workaround such issues.

Note: See TracTickets for help on using tickets.