[postgis-users] ogr2ogr import problem

Frank Warmerdam warmerdam at pobox.com
Thu Jun 22 21:13:41 PDT 2006


邵今(南京吉美思) wrote:
> I have a mapinfo layer(tab format) .
> I use ogr2ogr to impor it to postgis
> but this layer's field(only one field) has no value
> so when I import it, error log as below:
> ERROR:  new row for relation "layer1" violates check constraint 
> "enforce_geotype_wkb_geometry"
> 
> Is there any way to avoid it without fill the no value filed ?

Hi,

You might fine adding "-nlt GEOMETRY" helps.  This tells ogr2ogr
to create the geometry column as just geometry rather than a specific
type like LINESTRING.  This can be helpful when an OGR driver reports a
specific geometry type, but in actual fact has more than one type.  With
tab files this can happen for instance with a polygon file report its self
as polygon when it actually also has multipolygons.

If this doesn't help, I think you will need to make your input dataset
available, along with the exact command used, and info on the version
of postgis so I can try and reproduce the problem.

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    | President OSGF, http://osgeo.org




More information about the postgis-users mailing list