[postgis-users] Best approach: Loading data with ogr2ogr

Craig Miller craig.miller at spatialminds.com
Fri May 20 11:05:41 PDT 2005


I'm trying to figure out what the best way is to load data with ogr2ogr?

I'm attempting to load data with ogr2ogr and am receiving the error:

ERROR:  new row for relation "roads" violates check constraint
"enforce_dims_wkb_geometry".

My understanding is that this constraint is enforcing that 3 dimensions
(x,y,z) are being provided and that ogr2ogr is only providing 2 dimensions
(x,y).  I saw a post from last February where Frank suggested two different
workarounds to the problem:

1.  Convert the data to a shapefile and use the PostGIS shapefile loader to
load the data.

2.  Drop the dimensions constraint on my table.

I'm considering the second option, but am wondering what the consequences
will be (if any).  Is there a newer version of ogr2ogr that carries the z
value around?

Environment:  I have a fresh install of PostgreSQL-8.0.3 with Postgis
1.0.0-1.  I'm loading my data with ogr2ogr on top of gdal12.dll ver.
1.2.6.0.

Thanks for the help,
--Craig






More information about the postgis-users mailing list