#6357 closed defect (fixed)

SXF Fixes

Reported by: warmerdam Owned by: warmerdam
Priority: normal Milestone:
Component: OGR_SF Version: unspecified
Severity: normal Keywords: SXF
Cc: bishop, alexey


Transcribed from gdal-dev-owner:

some time ago jratike80 recommended send mail to gdal-dev http://trac.osgeo.org/gdal/ticket/5647 i am writing: From: Alexey ILchenko <lexa.ilc@…> To: gdal-dev@… Cc: Date: Mon, 8 Feb 2016 01:14:20 +0300 Subject: SXF Driver Hi all. I think i found some bugs on SXF driver. Check, please.

1)error on index in file ogrsxfdatasource.cpp line 620 and 687 "switch (anData[5])" replace "switch (anData[4])"

2)error in conversion multy part line. in this time they converted on point or one line. examle: "----- ----- -----" -> "." or "----" its not save all geometry

3)if RSC file has no description layer description of objects, all layers after this layer will be removed. why, because y save all object in additional layer:

1269    papoLayers = (OGRLayer**)CPLRealloc(papoLayers,
sizeof(OGRLayer*)* (nLayers + 1));
1270    papoLayers[nLayers] = new OGRSXFLayer(fpSXF, &hIOMutex, 255,
CPLString("Not_Classified"), oSXFPassport.version,
1271    nLayers++;
"127int OGRSXFLayer::AddRecord(long nFID, unsigned nClassCode,
vsi_l_offset nOffset, bool bHasSemantic, size_t nSemanticsSize)
129    if (mnClassificators.empty() ||
mnClassificators.find(nClassCode) != mnClassificators.end())"

if the empty layer not last will be bad.

4) i think y can add epsg:4326 if (iEllips == 9 && iProjSys == 33) and anData[4]=65 and adfParams[i]=0

Attachments (2)

osm.rsc (423.0 KB) - added by alexey 14 months ago.
fordebug.sxf (3.6 KB) - added by alexey 14 months ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 15 months ago by warmerdam

Cc: alexey added

comment:2 Changed 15 months ago by Bishop

Can you provide test sxf + rsc for 2) and 3) to reproduce the bug?

comment:3 Changed 14 months ago by Bishop

Resolution: fixed
Status: newclosed

Fixed in r33512 The 2 and 3 need some samples to reproduce the bug. If files will be provided, please reopen ticket.

comment:4 Changed 14 months ago by Even Rouault

It looks to me that the following lines will leak memory since pszRecoded is assigned previously with CPLRecode or CPLStrdup. Also, minor note, CPLStrnlen(pszRecoded, 255) == 0 could be written more simply (and efficiently) as pszRecoded[0] != 0.

    if(CPLStrnlen(pszRecoded, 255) == 0)
        pszRecoded = CPLStrdup("Unnamed");

comment:5 in reply to:  4 Changed 14 months ago by Bishop

Fix in r33515

Changed 14 months ago by alexey

Attachment: fordebug.sxf added


comment:6 Changed 14 months ago by alexey

Resolution: fixed
Status: closedreopened

2)problem with geometry metric text lable 3)objects going from layer "signature" to layer "direct"

comment:7 Changed 12 months ago by Bishop

Resolution: fixed
Status: reopenedclosed

Fix in r34024.

Several notes about problem 2:

  1. The problem geometries in test file (fordebug.sxf​) are not multi part line, but multi part text. I added support for such geometries. But this is not error, just new functionality.
  1. The mentioned "incorrect conversion" line to point is correct. According to specification (see. http://gistoolkit.ru/download/doc/sxf4bin.pdf page 17) code xххх0100 is vector POINT object wich has 2 coordinates. First coordinate is anchor, and second - for direction. GDAL create feature with point geometry and add direction to the ANGLE field. This is useful for rotating point symbols according the ANGLE value in most GIS programs.
Note: See TracTickets for help on using tickets.