[gdal-dev] dgn to mysql

Frank Warmerdam warmerdam at pobox.com
Wed Dec 5 09:13:42 EST 2007


Berényi Attila wrote:
> Dear Folks,
> 
> I've tried to convert a DGN drawing to MySQL with ogr2ogr, but I've
> got this error message:
> "ERROR 1: MySQL error message:Column 'SHAPE' cannot be null
> Description: INSERT INTO elements (SHAPE , type, level, graphicgroup,
> colorindex, weight, style) VALUES (GeometryFromText('LINESTRING (600
> 200 0,650 230 0)',-1) , 3, 1, 0, 0, 0, 0)"
> 
> The appropriate command:
> "ogr2ogr -f MySQL MySQL:test,user=xxx,password=xxx drawing.dgn
> -overwrite -nlt GEOMETRY "
> 
> I've edited the MySQL table, but no success at all.
> 
> Any idea? Could be because of the 3 dimensional drawing?

Attila,

What version of GDAL are you using?  The above is attempting to insert a
3D geometry into mysql and it is my understanding that mysql only supports
2D geometries.  I believe there was a bug fix related to this somewhat
recently.  It should be fixed in GDAL 1.4.4 and GDAL 1.5.0b1.

   http://trac.osgeo.org/gdal/ticket/1848

I can't think of any trivial workaround to force your geometries to 2D with
ogr2ogr (unfortunately).

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



More information about the gdal-dev mailing list