mapricot-api 0.12.0 → 0.13.0

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -5
  3. data/lib/mapricot/api.rb +4 -4
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9bc321819cc79bc1fa54ad0ea299a93c1e21362e25bf79c524f26af234ec1577
4
- data.tar.gz: c0b7c20c95f41df1e2fdc85a3079eddfee2e8f1c46b2ac9b3672f1174f5c8651
3
+ metadata.gz: 3e555ba729e27b2a4b8f31959f110398f56aa56c4194a49c96526d4542bcfa9b
4
+ data.tar.gz: 9c870fcd6884cf91cfc5d0bf3eb4bebf33fc06a03cb0782f5249a7503c3155e6
5
5
  SHA512:
6
- metadata.gz: 429d97f2c96011452f19181d7335324735c4c7dbd7bc0cf50745e80c1552d3599efa05c1b91be66fe30f28bb0cc4bceca3e87d8f49daeeff8b0f13d113203c35
7
- data.tar.gz: 39fedf7b581ada641578873f6048003e39ca82ce95a606c615be5c004017fa981ae26ac14644b5ba3126802a0d9e28904debda82c77810d4ed70c9839f7e1ef7
6
+ metadata.gz: 77f1c6898440dfa8da979f9ace452144ab8b29b2e79d6e5c310537b81ee5d9abdc344be15f4de3da5ce5a0a95c8b774af64d1d644320c20661cade5b37e45657
7
+ data.tar.gz: 33f7c9d70cc13f80a9e22d2b6170dd8da78b673adea5a0c4056db9ba9385fdcfd9c834cf8e3af9e6d9b1557959454c4eca7fd9887eefd8695159b8f88e674fe1
data/README.md CHANGED
@@ -31,19 +31,19 @@ Methods are grouped by product, the same way as the API's paths. Each returns th
31
31
  | `client.geocoding.search(q, address:, locality:, county:, region:, postal_code:, focus:, country:, limit:, lang:)` | [`GET /geocoding/v1/search`](https://mapricot.com/docs/geocoding/#find-an-address) |
32
32
  | `client.geocoding.search_batch(queries)` | [`POST /geocoding/v1/search/batch`](https://mapricot.com/docs/geocoding/#search-a-list-of-addresses) |
33
33
  | `client.geocoding.autocomplete(q, focus:, country:, limit:, lang:)` | [`GET /geocoding/v1/autocomplete`](https://mapricot.com/docs/geocoding/#suggest-as-people-type) |
34
- | `client.geocoding.reverse(lat, lon, limit:, lang:)` | [`GET /geocoding/v1/reverse`](https://mapricot.com/docs/geocoding/#find-the-address-at-a-point) |
35
- | `client.places.nearby(lat, lon, category:, radius:, limit:, lang:)` | [`GET /places/v1/nearby`](https://mapricot.com/docs/places/#list-places-around-a-point) |
34
+ | `client.geocoding.reverse(lat:, lon:, limit:, lang:)` | [`GET /geocoding/v1/reverse`](https://mapricot.com/docs/geocoding/#find-the-address-at-a-point) |
35
+ | `client.places.nearby(lat:, lon:, category:, radius:, limit:, lang:)` | [`GET /places/v1/nearby`](https://mapricot.com/docs/places/#list-places-around-a-point) |
36
36
  | `client.places.get(id, lang:)` | [`GET /places/v1/{id}`](https://mapricot.com/docs/places/#look-up-a-saved-place) |
37
37
  | `client.routing.route(waypoints, mode:, geometries:, steps:, lang:, costing:)` | [`POST /routing/v1/route`](https://mapricot.com/docs/routing/#get-a-route) |
38
38
  | `client.routing.optimize(waypoints, mode:, geometries:, steps:, lang:, costing:)` | [`POST /routing/v1/optimize`](https://mapricot.com/docs/routing/#optimize-the-order-of-stops) |
39
- | `client.routing.isochrone(location, minutes, mode:, costing:, generalize:)` | [`POST /routing/v1/isochrone`](https://mapricot.com/docs/routing/#get-an-isochrone) |
39
+ | `client.routing.isochrone(location:, minutes:, mode:, costing:, generalize:)` | [`POST /routing/v1/isochrone`](https://mapricot.com/docs/routing/#get-an-isochrone) |
40
40
  | `client.ip_geolocation.lookup(ip)` | [`GET /ip-geolocation/v1/{ip}`](https://mapricot.com/docs/ip-geolocation/#look-up-an-address) |
41
41
  | `client.account` | `GET /account`, which checks a key and is never billed |
42
42
 
43
43
  Every keyword argument is optional. `focus` and each waypoint are `{ lat:, lon: }`. `country` and `category` take an Array or a comma-separated String.
44
44
 
45
45
  ```ruby
46
- nearby = client.places.nearby(45.52, -122.68, category: ["food:coffee_shop"], radius: 1000)
46
+ nearby = client.places.nearby(lat: 45.52, lon: -122.68, category: ["food:coffee_shop"], radius: 1000)
47
47
  route = client.routing.route([{ lat: 45.5189, lon: -122.6793 }, { lat: 45.5214, lon: -122.6828 }], mode: "walk")
48
48
  puts route["routes"][0]["durationSeconds"]
49
49
  ```
@@ -72,7 +72,7 @@ Pass `steps: true` and each leg's `steps` has its turn-by-turn directions: an `i
72
72
  An isochrone is a GeoJSON `FeatureCollection` with one polygon per time, largest first, so a map that draws them in order shows the smaller ones on top:
73
73
 
74
74
  ```ruby
75
- area = client.routing.isochrone({ lat: 45.5189, lon: -122.6793 }, [5, 10], mode: "walk")
75
+ area = client.routing.isochrone(location: { lat: 45.5189, lon: -122.6793 }, minutes: [5, 10], mode: "walk")
76
76
  puts area["features"].map { |feature| feature["properties"]["minutes"] }.inspect
77
77
  ```
78
78
 
data/lib/mapricot/api.rb CHANGED
@@ -7,7 +7,7 @@ require "net/http"
7
7
  # The official client for the Mapricot API: address and place search, reverse geocoding, nearby places, routing,
8
8
  # and IP geolocation. See https://mapricot.com/docs/ruby/.
9
9
  module Mapricot
10
- VERSION = "0.12.0"
10
+ VERSION = "0.13.0"
11
11
 
12
12
  # An error response from the API.
13
13
  class Error < StandardError
@@ -133,7 +133,7 @@ module Mapricot
133
133
  end
134
134
 
135
135
  # Find the address nearest a coordinate, or the area around it.
136
- def reverse(lat, lon, limit: nil, lang: nil)
136
+ def reverse(lat:, lon:, limit: nil, lang: nil)
137
137
  @get.call("/geocoding/v1/reverse", lat: lat, lon: lon, limit: limit, lang: lang)
138
138
  end
139
139
  end
@@ -145,7 +145,7 @@ module Mapricot
145
145
  end
146
146
 
147
147
  # List places around a coordinate, optionally by category, an Array or a String.
148
- def nearby(lat, lon, category: nil, radius: nil, limit: nil, lang: nil)
148
+ def nearby(lat:, lon:, category: nil, radius: nil, limit: nil, lang: nil)
149
149
  @get.call("/places/v1/nearby", lat: lat, lon: lon, category: category, radius: radius, limit: limit, lang: lang)
150
150
  end
151
151
 
@@ -181,7 +181,7 @@ module Mapricot
181
181
  # The areas reachable from a location, {lat:, lon:}, within 1 to 4 times, each 1 to 60 minutes, as a GeoJSON
182
182
  # FeatureCollection with one polygon per time, largest first. mode and costing are as for route. generalize smooths
183
183
  # each outline to within that many meters, from 10 to 5000; left out, the API picks it from the travel time.
184
- def isochrone(location, minutes, mode: nil, costing: nil, generalize: nil)
184
+ def isochrone(location:, minutes:, mode: nil, costing: nil, generalize: nil)
185
185
  @post.call("/routing/v1/isochrone", { location: location, minutes: minutes, mode: mode, costing: costing, generalize: generalize })
186
186
  end
187
187
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mapricot-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mapricot