Opened 12 years ago

Closed 12 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

Description

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)

PGeoTest.zip (898.2 KB) - added by traianstanev 12 years ago.
pgeo_fix.zip (11.1 KB) - added by traianstanev 12 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 12 years ago by warmerdam

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

Chaitanya,

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

comment:2 Changed 12 years ago by traianstanev

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).

Changed 12 years ago by traianstanev

Attachment: PGeoTest.zip added

comment:3 Changed 12 years ago by traianstanev

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 Changed 12 years ago by traianstanev

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...

Changed 12 years ago by traianstanev

Attachment: pgeo_fix.zip added

comment:5 Changed 12 years ago by chaitanya

Status: newassigned

Traian,

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 Changed 12 years ago by chaitanya

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 http://download.osgeo.org/gdal/data/pgeo/NHDH0104.tar.gz. 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.

Train,

Can I put up the test file PGeoTest.zip on the GDAL's sample data archive at http://download.osgeo.org/gdal/data?

comment:8 Changed 12 years ago by traianstanev

Yes, it's ok to upload the file.

comment:9 Changed 12 years ago by chaitanya

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