- Notifications
You must be signed in to change notification settings - Fork6
A Ruby wrapper for OpenStreetMap Overpass API
License
NotificationsYou must be signed in to change notification settings
BrunoSalerno/overpass-api-ruby
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A Ruby wrapper for OpenStreetMap Overpass API. Supports both QL and XML.
Note: Version 0.2 introduces breaking changes. Check the file CHANGELOG.md.
gem install overpass-api-ruby
or addgem 'overpass-api-ruby' to your Gemfile
Using XML:
require'overpass_api_ruby'options={:bbox=>{:s=> -34.705448,:n=> -34.526562,:w=> -58.531471,:e=> -58.335159},:timeout=>900,:element_limit=>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:
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)query="rel['route'='subway'];(._;>;);out body;"response=overpass.query(query)
bbox Hash. Global bounding box.endpoint String. Defaults to http://overpass-api.de/api/interpretertimeout Integer.QL
maxsize Integer.XML
element_limit Integer.SeeOverpass API
BothQL andXML classes have the same public methods:
query(<Stringquery>)Performsthequerypassedusingtheglobalvaluessetoninstantiation.raw_query(<Stringquery>)Thewholequerymustbepassed.buid_query(<Stringquery>)ReturnsaStringcontainingthewholequery.bounding_box(s,n,w,e)Definestheglobalboundingbox.
Runrake spec
MIT.
About
A Ruby wrapper for OpenStreetMap Overpass API
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.