[gdal-dev] Wanted: -lco DIM for OGR/SQLite driver

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Sat Sep 22 03:40:45 PDT 2012


Even Rouault wrote:

> Le vendredi 21 septembre 2012 17:01:12, Jukka Rahkonen a écrit :
>> Hi,
>
>> OCI and PostgreSQL drivers both have layer creation option for setting
>> layer dimensions and it would be nice to have DIM option also in
>> Spatialite driver. What I was missing today was a possibility to use -lco
>> DIM=2 and convert 3D coordinates with all zero Z values into 2D
>> coordinates. Spatialite itself seems to support XY, XYM, XYZ and XYZM
>> dimensions.

> Actually, instead of adding this option in every driver, I've added a -dim
> option at ogr2ogr level. This will affect the layer geometry type, and the
< geometries inserted.

> ogr2ogr poly2d.sqlite poly3d.shp -f sqlite -dsco spatialite=yes -dim 2

Splendid.

Reason for my trouble was that 2D polygons in Oracle (GTYPE=2003) were interpreted as XYZ polygons, perhaps because Oracle spatial tables can contain a mixture of what ever kind of geometries and it is hard or impossible to find what  geometry types are really used in the tables without reading all the features first.  With this fix ogr2ogr can handle the situation easily.

-Jukka-


More information about the gdal-dev mailing list