-
Notifications
You must be signed in to change notification settings - Fork 86
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
Support OverpassApi #76
Comments
Yes, of course. If it's backwards compatible with what is there now (but if I read correctly it will be) and if you also add some tests for it then I will thank you for submitting a pull request! 👍 Just FYI, I have also built some code in a test environment that downloads from overpass, are you saying this won't work anymore: https://github.com/itinero/routing/blob/develop/test/Itinero.Test.Functional/Staging/Download.cs#L53 Also, if therre is anything you can reuse from there feel free to do so. |
I just tested your code sample with a simple Overpass query and it works. At its heart, you're using:
When your code gets to an XmlElement it doesn't recognize, it skips it. The code I was using, expecting to work but having trouble with:
When my code gets to an XmlElement it doesn't recognize, it stops reading and returns. I'm not sure if I prefer having an IEnumerable<OsmSharp.OsmGeo>, or an OsmSharp.API.Osm. My next step (which I haven't gotten to yet) is trying to modify elements and submit change sets (after reading all documentation and getting community feedback). |
Thank you for having tests in your project! The unit and functional tests still pass. I'm not sure the proper way to link an Issue and a PullRequest. (#77) |
The pull-request has been merged in develop. This should fix your issue, just use the latest nuget prerelease package until OsmSharp is ready for it's next stable release. |
With a small change to XmlExtensions.cs, OsmSharp would be able to deserialize responses from OverpassApi and other data sources which include unexpected XML elements.
Overpass responses include a "meta" element and a "note" element, which I think would be fine to ignore while deserializing for most purposes. Your current implementation stops deserializing when it finds any unexpected element.
If I made a pull request to this effect, would you consider it?
Related: drolbr/Overpass-API#533
The text was updated successfully, but these errors were encountered: