Opened 18 years ago

Closed 18 years ago

Last modified 15 years ago

#278 closed enhancement (fixed)

2.5D/3D geometry support

Reported by: holl@… Owned by: mhugent
Priority: major: does not work as expected Milestone:
Component: OGR Layer support Version: Trunk
Keywords: Oracle OCI Cc: marco.hugentobler@…
Must Fix for Release: No Platform: Debian
Platform Version: Awaiting user input: no

Description

Hi developers,

currently I am writing a plugin for Oracle-access (similar to the postgres) through OGR. Loading a vector using QgisIface::addVectorLayer() works partly, the attribute-table gets populated with the correct attributes, but the geometry is unknown to QGIS.

The shell displays the following warning:

[...]
UNKNOWN WKBTYPE ENCOUNTERED
[...]
UNKNOWN WKBTYPE ENCOUNTERED
Debug: qgsogrprovider.cpp: 581: (getNextFeature) Feature is null
Debug: qgsvectorlayer.cpp: 948: (draw) Total features processed is 458
Debug: qgsmaprender.cpp: 285: (render) QgsMapRender::render: Done
[...]

Indeed, when I use ogrinfo to query my layers in Oracle it recognizes it at Geometry: Unknown (any).

I discussed this with Marco Off-list and he pointed out that QGIS cannot handle 3d geometry currently. But OGR supports the following geometries so it could be included in QGIS as well:

typedef enum 
{
    wkbUnknown = 0,             /* non-standard */
    wkbPoint = 1,               /* rest are standard WKB type codes */
    wkbLineString = 2,
    wkbPolygon = 3,
    wkbMultiPoint = 4,
    wkbMultiLineString = 5,
    wkbMultiPolygon = 6,
    wkbGeometryCollection = 7,
    wkbNone = 100,              /* non-standard, for pure attribute records */
    wkbLinearRing = 101,        /* non-standard, just for createGeometry() */
    wkbPoint25D = 0x80000001,   /* 2.5D extensions as per 99-402 */
    wkbLineString25D = 0x80000002,
    wkbPolygon25D = 0x80000003,
    wkbMultiPoint25D = 0x80000004,
    wkbMultiLineString25D = 0x80000005,
    wkbMultiPolygon25D = 0x80000006,
    wkbGeometryCollection25D = 0x80000007
} OGRwkbGeometryType;

In future Versions it would be nice to have this included in QGIS, so that at least 25d layers could be loaded.

Best regards

Stephan

Change History (4)

comment:1 by holl@…, 18 years ago

Priority: minormajor

Hi devs,

some additional hints, I have asked at the gdal-dev-list[1].

<Frank Warmerdam>
I am not aware of a dependable way of determining the geometry type of an
oracle geometry column.  So the driver just returns wkbUnknown which means
any geometry type may appear.

This is not uncommon with different kinds of drivers, so if QGIS can't handle
it, I think QGIS should be improved.
</Frank Warmerdam>

So this means QGIS should be extended in that way, that a provider/plugin can pass a geometry-type to QgisIface::addVectorLayer if possible?

Stephan

[1] http://lists.maptools.org/pipermail/gdal-dev/2006-September/010130.html

comment:2 by wonder, 18 years ago

Initial support for 2.5D geometries has been added in r5879 in order to fix #308. This support is now just basic to allow layers to be displayed. Z vaules are completely ignored.

comment:3 by mhugent, 18 years ago

Must Fix for Release: No
Resolution: fixed
Status: newclosed

comment:4 by (none), 15 years ago

Milestone: Version 0.9

Milestone Version 0.9 deleted

Note: See TracTickets for help on using tickets.