[Gdal-dev] postgis driver

Bart van den Eijnden BEN at Syncera-ITSolutions.NL
Thu Oct 13 07:41:33 EDT 2005


Hi list,

I was running into a problem with the PostGIS driver when trying to get a Mapinfo TAB into PostGIS.

D:\ms4w\apps\stragisweb\htdocs\sites\mdwh\data\gebiedsgericht\geo>ogr2ogr -f "PostgreSQL" PG:"host=127.0.0.1 user=postgres password=stragisweb dbname=mdwh" basisgebieden_conept4.TAB
ERROR 1: INSERT command for new feature failed.
ERROR:  new row for relation "basisgebieden_conept4" violates check constraint "
enforce_geotype_wkb_geometry"

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

After debugging the SQL statements I found out that the geometry type was set to polygon, and the Mapinfo file also contained Multipolygons, so I could solve this by using:

D:\ms4w\apps\stragisweb\htdocs\sites\mdwh\data\gebiedsgericht\geo>ogr2ogr -f "PostgreSQL" PG:"host=127.0.0.1 user=postgres password=stragisweb dbname=mdwh" basisgebieden_conept4.TAB -lco OVERWRITE=YES -nlt MULTIPOLYGON

I have a few questions/remarks about the driver:

1) schema support is really needed, since now everything ends up in public

2) would it be a good idea to let the driver create indexes already on the geometry column, oid and the ogc_fid columns and do a vacuum analyze after that? Or are there reasons not to want this?

Thanks for this driver btw!

Best regards,
Bart

Bart van den Eijnden
Syncera IT Solutions
Postbus 270
2600 AG  DELFT

tel.nr.: 015-7512436
email: BEN at Syncera-ITSolutions.nl





More information about the Gdal-dev mailing list