Class: Underpass::QL::Query
- Inherits:
-
Object
- Object
- Underpass::QL::Query
- Defined in:
- lib/underpass/ql/query.rb
Overview
High-level entry point for querying the Overpass API.
Glues together Request, Client, Response, QueryAnalyzer, and Matcher to provide a single-call interface.
Class Method Summary collapse
-
.perform(bounding_box, query) ⇒ Array<Feature>
Queries the Overpass API within a bounding box.
-
.perform_in_area(area_name, query) ⇒ Array<Feature>
Queries the Overpass API within a named area (e.g. “Romania”).
Class Method Details
.perform(bounding_box, query) ⇒ Array<Feature>
Queries the Overpass API within a bounding box.
25 26 27 28 29 30 |
# File 'lib/underpass/ql/query.rb', line 25 def self.perform(bounding_box, query) query_string = resolve_query(query) op_bbox = Underpass::QL::BoundingBox.from_geometry(bounding_box) request = Underpass::QL::Request.new(query_string, op_bbox) execute(request, query_string) end |
.perform_in_area(area_name, query) ⇒ Array<Feature>
Queries the Overpass API within a named area (e.g. “Romania”).
40 41 42 43 44 |
# File 'lib/underpass/ql/query.rb', line 40 def self.perform_in_area(area_name, query) query_string = resolve_query(query) request = Underpass::QL::Request.new(query_string, nil, area_name: area_name) execute(request, query_string) end |