Opened 13 years ago

Closed 13 years ago

#2991 closed defect (fixed)

OGR PGeo driver's GetGeometryRef() returns NULL for lines/polygons with Z coordinates

Reported by: traianstanev Owned by: chaitanya
Priority: normal Milestone: 1.6.3
Component: OGR_SF Version: 1.6.0
Severity: normal Keywords: PGEO
Cc: warmerdam


This defect is essentially the same as ticket #2692, but for polygons and lines with Z coordinates. The driver needs a special case to map shape geometry types 10 and 19 (PolylineZ and PolygonZ) in addition to 9 (PointZ). This is likely due to shape types being slightly different in SHP versus PGDB. Here is the list:

Value Shape Type GDB Type
0 Null Shape Null Shape
1 Point Point
3 PolyLine PolyLine
5 Polygon Polygon
8 MultiPoint MultiPoint
9 n/a PointZ
10 n/a PolylineZ
11 PointZ PointZM
13 PolyLineZ PolyLineZM
15 PolygonZ PolygonZM
18 MultiPointZ MultiPointZM
19 n/a PolygonZ
20 n/a MultiPointZ
21 PointM PointM
23 PolyLineM PolyLineM
25 PolygonM PolygonM
28 MultiPointM MultiPointM
31 MultiPatch MultiPatchM
32 n/a MultiPatch

Attachments (2) (898.2 KB ) - added by traianstanev 13 years ago. (11.1 KB ) - added by traianstanev 13 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 by warmerdam, 13 years ago

Cc: warmerdam added
Keywords: PGEO added
Milestone: 1.6.2
Owner: changed from warmerdam to chaitanya


Please dig into this when practical. Traian - do you have sample data demonstrating some of the currently unhandled types?

comment:2 by traianstanev, 13 years ago

I do have a data set with the two types I mention in the report. I don't have data for the other two types in the table (20 and 32). I will need to get approval before posting it here (it's customer data).

by traianstanev, 13 years ago

Attachment: added

comment:3 by traianstanev, 13 years ago

I have added a test file which demonstrates the problem. I was not allowed to share the original data, so this is a specially prepared file from the customer. It demonstrates PolygonZ and PolylineZ features -- OGR already has the fix for PointZ, as mentioned in my bug description.

comment:4 by traianstanev, 13 years ago

I'm also attaching the fix I am temporarily using. I am not sure about some of the changes, but it does work for the geometry types in question. Admittedly, I didn't test it very thoroughly...

by traianstanev, 13 years ago

Attachment: added

comment:5 by chaitanya, 13 years ago

Status: newassigned


Can you give me a reference for the PGDB data types? There are some conflicts which need to be resolved before I can apply your patch.

comment:7 by chaitanya, 13 years ago

Applied the patch in trunk (r17619) and 1.6 branch (r17620).

The patch worked fine with the data provided by Traian and was also able to identify some previously unidentified geometries in I also tested it on some other data without any changes/problems.

It also gives a better fix for POINTZ shape type problem described in #2692. I removed the patch r15799.


Can I put up the test file on the GDAL's sample data archive at

comment:8 by traianstanev, 13 years ago

Yes, it's ok to upload the file.

comment:9 by chaitanya, 13 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.