underpass 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a173c933d640a68a1ed75c88ee6dcb770cb17a953d9ae56769b55629b3d06b04
4
- data.tar.gz: 031f1237a8d944f693e16c694699e6abf0ace92249257329c80083739b6c959d
3
+ metadata.gz: 499389ab42025a727e89c1bfbee99f0444fb7db0593c06ad2959eda87d794d65
4
+ data.tar.gz: c8d700d784d837474e6fa5dd5f8d35339b8bf17cf08de41cdfa32807f87cf889
5
5
  SHA512:
6
- metadata.gz: f5b7bbd768748cdda65a8b1160035086460a6cc80a56044e84812c97a0e7be8edb83a9d2dd2bce6c5573a9322e48100e7f1ece4b8cb56b711eb7341e5a1464db
7
- data.tar.gz: 893374e2c0eef334aaf9d0573b2d17b8a49854e5f639249b1c5f40492b56b513dae6fe7f4c2e1a17c9280f058f6b668f92191958032071bf0dee26a9a0f9d2ed
6
+ metadata.gz: 321f52730a7c02f9828cf5451e4a92507fb32b219114a3d1b20c93956e19e710218594a5afee47370e4cafc7e37f5226c21db8f43806ff9fc2fe7becb2ac6e5f
7
+ data.tar.gz: aeeda5fbdf1f1a355a4ee4e9d5484aaf1d71994ba3c6f08d236fc4e4473363c94fabe219a3205a8d8220f74f2ad0cc5ae45198b532e4c0f8516e5ae8f9a69e7b
data/lib/underpass.rb CHANGED
@@ -5,8 +5,8 @@ require 'json'
5
5
 
6
6
  require 'underpass/ql/ql'
7
7
 
8
- # The Underpass library
9
- # Offers various helpers to work with the Overpass API and RGeo objects
8
+ # Underpass is a library that makes it easy to query the Overpass API
9
+ # and translate its responses into RGeo objects
10
10
  module Underpass
11
11
  end
12
12
 
@@ -4,7 +4,7 @@ module Underpass
4
4
  module QL
5
5
  # Bounding box related utilities.
6
6
  class BoundingBox
7
- # returns the Overpass query language bounding box string
7
+ # Returns the Overpass query language bounding box string
8
8
  # when provided with an RGeo geometry
9
9
  def self.from_geometry(geometry)
10
10
  r_bb = RGeo::Cartesian::BoundingBox.create_from_geometry(geometry)
@@ -2,8 +2,8 @@
2
2
 
3
3
  module Underpass
4
4
  module QL
5
- # Parses the API request response into easily digestable objects
6
- # which are then returned as matches.
5
+ # Deals with parsing the API request response into easily digestable objects
6
+ # which are then returned as matches
7
7
  class Parser
8
8
  def initialize(response)
9
9
  @response = response
@@ -9,7 +9,7 @@ require 'underpass/ql/query'
9
9
  module Underpass
10
10
  # Provides the means to work with Overpass by using the
11
11
  # Overpass Query Language (QL). Overpass also provides an XML based
12
- # query language but we're not interested in that.
12
+ # query language but we're not interested in that
13
13
  module QL
14
14
  end
15
15
  end
@@ -2,8 +2,11 @@
2
2
 
3
3
  module Underpass
4
4
  module QL
5
- # Convenience class, provides the perform static method.
5
+ # Provides a shortcut method that makes it easy to work with the library
6
6
  class Query
7
+ # Shortcut method that glues together the whole library.
8
+ # * +bounding_box+ an RGeo polygon
9
+ # * +query+ is the Overpass QL query
7
10
  def self.perform(bounding_box, query)
8
11
  op_bbox = Underpass::QL::BoundingBox.from_geometry(bounding_box)
9
12
  response = Underpass::QL::Request.new(query, op_bbox).run
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Underpass
4
4
  module QL
5
- # Deals with performing the Overpass API request.
5
+ # Deals with performing the Overpass API request
6
6
  class Request
7
7
  API_URI = 'https://overpass-api.de/api/interpreter'.freeze
8
8
  QUERY_TEMPLATE = <<-TEMPLATE.freeze
@@ -20,6 +20,7 @@ module Underpass
20
20
  @global_bbox ||= "[#{bbox}]"
21
21
  end
22
22
 
23
+ # Performs the API request
23
24
  def run
24
25
  query = QUERY_TEMPLATE.sub('BBOX', @global_bbox)
25
26
  .sub('QUERY', @overpass_query)
@@ -2,7 +2,8 @@
2
2
 
3
3
  module Underpass
4
4
  module QL
5
- # Contains factories for various shapes from ways and nodes.
5
+ # Contains factories for various RGeo shapes from ways and nodes parsed
6
+ # with the Parser class
6
7
  class Shape
7
8
  def self.polygon_from_way(way, nodes)
8
9
  f = RGeo::Geographic.spherical_factory(srid: 4326)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: underpass
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janos Rusiczki
@@ -80,7 +80,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - ">="
82
82
  - !ruby/object:Gem::Version
83
- version: 2.6.0
83
+ version: 2.3.0
84
84
  required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - ">="