id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc 3664,OGR SDTS driver problem with Polygons,lwaugh,warmerdam,"I have found (and fixed) a problem with SDTS polygons. Firstly the problem: When the features are accessed for the first polygon layer in a datasource the rings are correct, however, when subsequent polygon layers are accessed the rings are duplicated. Thereby causing inner rings to match outer rings on some features. This can be replicated using ""ogrinfo -ro {CATD} PC02"" compared with ""ogrinfo -ro {CATD} PC01 PC02"" - and checking the PC02 features will show duplicated rings. The cause: The AssembleRings function is called when attempting to retrieve features for a polygon layer and it builds the polygons by reading through the Line layers and Attaching them to the Polygons (using AttachToPolygons). While AssembleRings ensures it is only run once per PolygonReader (using bRingsAssembled flag) and each PolygonReader is owned by a layer. The called function AttachToPolygons attaches all line segments to ALL layers. Therefore causing the duplication of rings when a subsequent polygon layer is accessed. The fix: sdtslinereader.cpp: Change AttachToPolygons to limit attachments ONLY to requested layer (new parameter). Easily done with ""if (iPolyLayer != iLayer) continue"" at (or near) Line 320 sdtspolygonreader.cpp: Change AssembleRings to pass through the requested layer (new parameter), and the call to AttachToPolygons. sdts_al.h: Change definitions of AssembleRings and AttachToPolygons to have int iLayer parameter. ogrsdtslayer.cpp: Change call to AssembleRings to have the new parameter iLayer. sdts2shp.cpp: Change call to AssembleRings to have the new parameter iLayer.",defect,closed,normal,1.7.3,OGR_SF,1.7.1,normal,fixed,sdts,