JuanCouste / overpass-ql-ts

Overpass QL query builder abstraction with typing
MIT License
5 stars 1 forks source link

Chaining #11

Closed JuanCouste closed 8 months ago

JuanCouste commented 8 months ago

Expose functionality for chaining of query, byId, bbox, inside & filter statements. This definitely is more efficient than intersecting individual parts. ie:

(s: OverpassState) =>
    s.node
        .query({ name: "The name" })
        .and(s.chain.bbox([10, 11, 12, 13]))
        .and(s.chain.filter((e) => e.hasTag("tag1").and(e.getTag("tag1").eq("some value")))),
node ["name"="The name"]
       (10, 11, 12, 13)
       (if: (is_tag("tag1") && (t["tag1"] == "some value")));