<commit_before>Overpass API Ruby
=================

A Ruby wrapper for OpenStreetMap Overpass API. Supports both QL and XML.

Install
-------

`gem install overpass-api-ruby`

or add `gem 'overpass-api-ruby'` to your Gemfile

Usage
-----

Using XML:

```ruby
require 'overpass_api_ruby'

options={:bbox => {:s => -34.705448, :n => -34.526562,
                   :w => -58.531471, :e => -58.335159},
         :timeout => 900,
         :maxsize => 1073741824}

overpass = OverpassAPI::XML.new(options)

query = "<union><query type='relation'><has-kv k='route' v='subway'/></query>" <<
        "</union><union><item/><recurse type='down'/></union>"

response = overpass.query(query)
```

Using QL:

```ruby
require 'overpass_api_ruby'

options={:bbox => {:s => -34.705448, :n => -34.526562,
  :w => -58.531471, :e => -58.335159},
:timeout => 900}

overpass = OverpassAPI::QL.new(options)<commit_msg>Updates example<commit_after>Overpass API Ruby
=================

A Ruby wrapper for OpenStreetMap Overpass API. Supports both QL and XML.

Install
-------

`gem install overpass-api-ruby`

or add `gem 'overpass-api-ruby'` to your Gemfile

Usage
-----

Using XML:

```ruby
require 'overpass_api_ruby'

options={:bbox => {:s => -34.705448, :n => -34.526562,
                   :w => -58.531471, :e => -58.335159},
         :timeout => 900,
         :maxsize => 1073741824}

overpass = OverpassAPI::XML.new(options)

query = "<union><query type='relation'><has-kv k='route' v='subway'/></query>" <<
        "</union><union><item/><recurse type='down'/></union>"

response = overpass.query(query)
```

Using QL:

```ruby
require 'overpass_api_ruby'

options={:bbox => {:s => -34.705448, :n => -34.526562,
                   :w => -58.531471, :e => -58.335159},
         :timeout => 900,
         :maxsize => 1073741824}

overpass = OverpassAPI::QL.new(options)
{'fraction_non_alphanumeric': 0.2104695089044792, 'fraction_numerical': 0.09174311926605505, 'mean_word_length': 3.1945701357466065, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 48, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1906486', 'n_tokens_mistral': 809, 'n_tokens_neox': 659, 'n_words': 150}