Skip to content

[FEATURE] Add "PRO" features: custom queries #252

@Mashin6

Description

@Mashin6

First of all, awesome job with parsing OSM data and making use of overpass user friendly!

Although most of the use cases are just a simple filter queries, I think it would be useful to have an option to write custom queries in overpass QL and pass it to functions like osmdata_sf. Right now I have to do it the hacky way by modifying $prefix and $features in overpass_query object.

Second, would be to add function osmdata_df() that would parse the OP output into regular data.frame object. That way queries like this, which return csv format would possible. This would allow afterwards doing left_join on data from osmdata_sf() query to have super simple way of e.g. plot count statistics per area object.

[out:csv(name,counts;false;",")][timeout:3600];
{{geocodeArea:Southeastern Connecticut COG}}->.a;

rel[admin_level=8](area.a);
map_to_area;

foreach -> .town(
  nwr[natural=tree](area.town)->.objects;
  make stat
    name = town.set(t["name"]),
    counts = objects.count(nwr);
  out;
  );

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions