Closed NoahSchiro closed 1 month ago
Perhaps in support of this, we should abstract the query into a structure which can carry meta data / information like this. This will also allow us to set some defaults.
Features I would like on this:
Create a QueryEngine
struct which contains information like the base URL we want to query.
Methods on the QueryEngine:
new()
to create a default instancewith_url()
to set the URL (returns a new instance of the struct)with_filters()
allows the user to set filters on the ways (so we only get highways, or bike paths or whatever they might be interested in. We have to look more into what types of ways there are). We can filter ways with the following modification to the query string: way(area.searchArea)[highway="type_of_way_we_want"];
query()
allows the user to pass a raw string. Currently this functionality is taken up by osm_request()
so this will just be a rename and a shift to be a method on this structquery()
needs a blocking version as wellquery_place()
allows a user to just pass in the place they are interested inquery_polygon()
allows a user to pass in a polygonA few notes about how we are currently querying:
Change the
osm_query
function such that users can provide their own endpoint.