[Marble-bugs] [Bug 266366] New: KmlcoordinateTagHandler can't handle space after comma in coordinates

J Jones bjustjones at netscape.net
Tue Feb 15 11:08:33 CET 2011


https://bugs.kde.org/show_bug.cgi?id=266366

           Summary: KmlcoordinateTagHandler can't handle space after comma
                    in coordinates
           Product: marble
           Version: unspecified
          Platform: Compiled Sources
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: marble-bugs at kde.org
        ReportedBy: bjustjones at netscape.net


Version:           unspecified (using KDE 4.4.5) 
OS:                Linux

In function
   GeoNode* KmlcoordinatesTagHandler::parse( GeoParser& parser )
in file 
   KmlcoordinateTagHandler .cpp

the line 53:
   QStringList  coordinatesLines = parser.readElementText().trimmed().split(
QRegExp("\\s"), QString::SkipEmptyParts );

splits coordinates by spaces.
so <coordinates> -113.55, 52.5 </coordinates>
will be broken into two pairs because of the space in the middle

maybe a fancier QRegExpression? 

or a 

.replace(QRegExp("\\s*,\\s*"),",") thrown in there after the trimmed() in order
to collapse spaces around commas?
as in:
QStringList  coordinatesLines =
parser.readElementText().trimmed().replace(QRegExp("\\s*,\\s*"),",").split(
QRegExp("\\s"), QString::SkipEmptyParts );


Reproducible: Always

Steps to Reproduce:
feed in a kml file with space around the commas in <coordinates>

Actual Results:  
bad kml points are skipped
(placemarks before and after in kml file are drawn though)

Expected Results:  
all placemarks drawn

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Marble-bugs mailing list