Opened 12 years ago

Closed 5 years ago

#4409 closed defect (wontfix)

AVC_e00 driver failing to read correctly

Reported by: anguscarr Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: OGR_SF Version: svn-trunk
Severity: normal Keywords: e00, import, failure
Cc:

Description

I have an issue with reading e00 files correctly using ogr.

I am using polygon coverages parsed into e00 files by ESRI tools. I assume the e00 files are correctly formatted.

For example, I can import data using the ESRI stack of tools, or with avcimport, and get the correct topology in the resultant coverage, as viewed in QGIS.

When I use ogr2ogr or QGIS to read from the e00 file directly, it fails, producing incorrect data, but no error message.

Later in QGIS, it is failing to view the table. My imagination suggests that's probably a follow-on from ogr closing the file or something like that.

I will try to generate the smallest possible test case to generate the error. One polygon, exported to e00.

avcimport worked fine on the e00 to produce the correct output.

The polygons have arcs with negative index numbers, which (according to the docs on http://avce00.maptools.org/docs/v7_e00_cover.html#PAL means they are to be reversed as they are added to the polygon. I see no evidence that this takes place when I browse through http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/avc

and look for issues in the e00 files.

The ogr code suggests that it is looking for the arcs in a list, but it doesn't explicitly check for "negativeness".

The test case for autotesting the e00 code does not test reading PAL, as the e00 file was not built for polygon topology, as far as I can tell.

I will investigate further, and try to provide a test case.

Attachments (3)

maptools.e00 (6.7 KB ) - added by anguscarr 11 years ago.
example e00 file which shows the error
Screenshot using avcimport.jpg (43.3 KB ) - added by anguscarr 11 years ago.
Screenshot using QGIS.jpg (38.8 KB ) - added by anguscarr 11 years ago.

Download all attachments as: .zip

Change History (9)

by anguscarr, 11 years ago

Attachment: maptools.e00 added

example e00 file which shows the error

by anguscarr, 11 years ago

by anguscarr, 11 years ago

Attachment: Screenshot using QGIS.jpg added

comment:1 by anguscarr, 11 years ago

Version: 1.8.11.9.2

I cribbed the e00 file from http://avce00.maptools.org/docs/v7_e00_cover.html#APP_B. The same behaviour is still present. I used QGIS to show the problem. Screenshots are also attached.

Screenshot of the file using avcimport:

And using QGIS, it clearly shows the collapsed polygons:

comment:2 by anguscarr, 11 years ago

I got into looking for the problem a bit. Here is a patch. It is untested (although it compiles just fine). I am looking for feedback.

Index: ogr/ogrsf_frmts/avc/ogravce00layer.cpp
===================================================================
--- ogr/ogrsf_frmts/avc/ogravce00layer.cpp      (revision 26482)
+++ ogr/ogrsf_frmts/avc/ogravce00layer.cpp      (working copy)
@@ -338,6 +338,14 @@
         if( poArc->GetGeometryRef() == NULL )
             return FALSE;

+        if( psPAL->pasArcs[iArc].nArcId < 0 )
+            //Reverse the line segment if id .lt. 0
+            ((OGRLineString *) poArc->GetGeometryRef())->reversePoints();
+
         oArcs.addGeometry( poArc->GetGeometryRef() );
         OGRFeature::DestroyFeature( poArc );
     }

comment:3 by anguscarr, 11 years ago

Version: 1.9.2svn-trunk

comment:4 by Even Rouault, 11 years ago

Summary: AVC_e00 driver failing to read correctly[PATCH] AVC_e00 driver failing to read correctly

comment:5 by anguscarr, 11 years ago

Summary: [PATCH] AVC_e00 driver failing to read correctlyAVC_e00 driver failing to read correctly

Oops. That didn't do anything useful. I tested it after finally getting ogr to compile and it's not right yet.

The logic used in this section is that the polygon outline is built from the arcs in order presented, but that is not correct. It should be done in node order, not in arc id in the list order.

So... Please ignore the above patch.

comment:6 by Even Rouault, 5 years ago

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.