[Gdal-dev] append option in ogr2ogr

Frank Warmerdam warmerdam at pobox.com
Mon Jun 7 09:18:28 EDT 2004


Hans Verlouw wrote:
> Hi list,
> 
> I noticed some strange behaviour when using the 'append' option of ogr2ogr.
> I have twelve 2-dimensional ESRI shape files that I want to convert to 
> one single table in Oracle Spatial 9i.
> When I convert one shape file and explicitly specify the -lco DIM=2 
> option, the result is OK, so SDO_GTYPE = 2007 for all records.
> 
> But after I append other shape files (which are 2D originally too) the 
> resulting Oracle table gets over 90% records that are 3D,
> so with SDO_GTYPE = 3007
> 
> For every step I specify the -lco DIM=2 option.

Hans,

The -lco options are not utilized in append mode so ogr2ogr has no obvious
way of knowing it should create 2D geometries instead of 3D.  I have to
reboot to win32 to test Oracle stuff, so I haven't looked into the problem
yet.   Would you mind filing a bug in bugzilla about it?

In the meantime, if you can rebuild GDAL you could edit
gdal/ogr/ogrsf_frmts/oci/ogrociwritablelayer.cpp and change nDimension
to be 2 in the constructor near the beginning.

It is possible that Oracle actually keeps track that the layer type is
2D in the supporting table and I could initialize this value more properly
from that source.  However, I will need to do some digging to establish if
that is the case.

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    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list