Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem parsing single line GPX file #18

Closed
HarelM opened this issue Aug 11, 2018 · 1 comment
Closed

Problem parsing single line GPX file #18

HarelM opened this issue Aug 11, 2018 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@HarelM
Copy link
Contributor

HarelM commented Aug 11, 2018

As far as I can tell the following GPX string is valid, but the parser doesn't parse it correctly, I think:

        [TestMethod]
        public void TestMultipleFeaturesFromSingleLine()
        {
            var str = @"<?xml version='1.0' encoding='utf-8'?>
<gpx version='1.1' creator='IsraelHikingMap' xmlns='http://www.topografix.com/GPX/1/1'><metadata><bounds minlat='1' minlon='2' maxlat='16' maxlon='17' /></metadata><wpt lat='1' lon='2' /><trk><name>name1</name><extensions /><trkseg><trkpt lat='3' lon='4'><ele>5</ele></trkpt><trkpt lat='6' lon='7'><ele>8</ele></trkpt></trkseg></trk><trk><name>name2</name><extensions /><trkseg><trkpt lat='13' lon='14'><ele>15</ele></trkpt><trkpt lat='16' lon='17'><ele>18</ele></trkpt></trkseg></trk></gpx>";

            var features = GpxReader.ReadFeatures(XmlReader.Create(new MemoryStream(Encoding.UTF8.GetBytes(str))),
                new GpxReaderSettings(), new GeometryFactory());

            Assert.AreEqual(3, features.features.Length);
        }

Splitting the gpx string into multiple lines solves this, but I think it should work this way too...

@airbreather airbreather self-assigned this Aug 11, 2018
@airbreather airbreather added the bug Something isn't working label Aug 11, 2018
@airbreather airbreather added this to the Alpha 0.2.0 milestone Aug 11, 2018
@airbreather
Copy link
Member

Thanks for the report. Should be fixed in 0.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants