-
Notifications
You must be signed in to change notification settings - Fork 5
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 Other Endpoints (Overpass-Turbo, TagInfo) #23
Comments
I'm currently not using overpass turbo, I used it in the past from js code, but since my database on the server is up to date with latest osm changes I use it instead of querying overpass turbo. |
https://github.com/OffenesJena/OSMImports |
I am interested in having overpass |
Here's my implementation if anyone is interested. |
Great thanks. I will experiment a bit with OSMImports |
Seems like it works but as I see it it does some old fashioned json parsing, web request. It also doesn't provide bbox to be passed in. What I really liked is the chained queries though.
What I need is construction of the url so I will simply look and take out those bits out. My own similar implementation will look like this:
|
Yup, you can make it a lot nicer, especially using chaining etc :-) |
I don't have plans to pursue this soon (if at all), but a PR with a class to handle this would be very much welcome :-) |
The overpass turbo language is complicated and I have given up on trying to model any part of it in c#. Maybe an implementation already exists, but I looked a year ago and there wasn't really anything. However, it would be trivial to accept a query string (composed by someone else), send the request, and parse the result (assuming the result fits the OSM data model). I wonder if implementing just that could cover most use-cases? |
The results can be several output types: osm, geojson, csv. |
I agree. I have working overpass querying:
It is separate from the OsmApiClient api currently. The constructor takes permanent values for the query, the keys and values are added with chaining while request call puts the strings together. I could add it into OsmApiClient but then the http client would need to take to accept custom urls are mentioned
|
I think this class is a good starting point :-) |
I agree request and query building should probably be separated. I don't think requesting from different servers should be a responsibility of the query building either. Maybe query builder would create this part:
And in NonAuthClient eg it could prepend (baseUrl1 += query) and try like in your wikipedia implementation. When it comes to node, way and relation I think this line can be changed out (depending on
|
@Lelelo1 You are amazing |
Here is proposal of the overpass client.
|
What urls should be used? |
The Are someone up for adding this feature? Something I don't understand is how the models should look like. How should I proceed if I want this overpass feature? Create a fork? If someone could use the query builder I made and assemble the rest parts like adding tests that would be appreciated. I am not comfortable following rest of the code standards and make the web requests |
I'll review the PR in the next few days, hopefully, and if everything is approved we'll need to release a new version. |
@Lelelo1 If you want the feature right now, create a fork and reference that in your project. |
Ok I will make a pr then. I am having problems creating test: Run Tests is greyed out The file looks like: I can run existing tests but how do you I create new tests (I am using Visual Studio for Mac) |
Visual studio for mac is just the worst. |
I was able to get it to work in visual studio code. Should timeout and data (json eg) be configurable? If so should it be in the client or in the query? |
I think the OverpassClient should only accept a query string, make the request, and parse the result. That way the |
I'm not even sure it should parse the results as there can be few response formats (csv, json, osm, others?). |
Then get rid of |
That's actually a valid option as the client won't do much beside slightly wrap httpclient. |
There is some value in (re)using the |
No argue here. But the client shouldn't only support one format, it should at least support osm, json and csv (I'm not familiar with others). |
To make it simple we can indeed have the However I think you would want to use C# models in the end regardless of the serialization type and use built in (shared ideally) client. |
Also, there is need of testing the |
Unit test to try and create as many scenarios as possible to make sure that adding nodes, ways, attributes, etc. generates the right query string I believe. |
It's just that I need a client to test the query string? |
No, there's no need for a client to make sure the tests are working as expected. |
I will probably have a pr up at the start of next week |
So we can close the current PR that you opened? Is it still relevant? |
It can be closed |
https://wiki.openstreetmap.org/wiki/Overpass_API
https://taginfo.openstreetmap.org/taginfo/apidoc
https://nominatim.org/release-docs/develop/api/Overview/
I put this here as something which could be added. Please comment if this would be helpful or you.
First, see if a .net client already exists.
Add the code, add tests, update documentation, update this, release a new version.
The text was updated successfully, but these errors were encountered: