diff --git a/README_API_GUIDE.md b/README_API_GUIDE.md index 6cc41c6bb..58a103052 100644 --- a/README_API_GUIDE.md +++ b/README_API_GUIDE.md @@ -73,20 +73,6 @@ Global Street Address Lookups * **Terms of Service**: http://www.microsoft.com/maps/product/terms.html * **Limitations**: No country codes or state names. Must be used on "public-facing, non-password protected web sites," "in conjunction with Bing Maps or an application that integrates Bing Maps." -### Data Science Toolkit (`:dstk`) - -Data Science Toolkit provides an API whose response format is like Google's but which can be set up as a privately hosted service. - -* **API key**: none -* **Quota**: No quota if you are self-hosting the service. -* **Region**: world -* **SSL support**: ? -* **Languages**: en -* **Documentation**: http://www.datasciencetoolkit.org/developerdocs -* **Terms of Service**: http://www.datasciencetoolkit.org/developerdocs#googlestylegeocoder -* **Limitations**: No reverse geocoding. -* **Notes**: If you are hosting your own DSTK server you will need to configure the host name, eg: `Geocoder.configure(lookup: :dstk, dstk: {host: "localhost:4567"})`. - ### ESRI (`:esri`) * **API key**: optional (set `Geocoder.configure(esri: {api_key: ["client_id", "client_secret"]})`) diff --git a/lib/geocoder/lookup.rb b/lib/geocoder/lookup.rb index e915b7d4d..87523cae8 100644 --- a/lib/geocoder/lookup.rb +++ b/lib/geocoder/lookup.rb @@ -32,7 +32,6 @@ def all_services_with_http_requests def street_services @street_services ||= [ :location_iq, - :dstk, :esri, :google, :google_premier, diff --git a/lib/geocoder/lookups/dstk.rb b/lib/geocoder/lookups/dstk.rb deleted file mode 100644 index f5c16cfc5..000000000 --- a/lib/geocoder/lookups/dstk.rb +++ /dev/null @@ -1,22 +0,0 @@ -# More information about the Data Science Toolkit can be found at: -# http://www.datasciencetoolkit.org/. The provided APIs mimic the -# Google geocoding api. - -require 'geocoder/lookups/google' -require 'geocoder/results/dstk' - -module Geocoder::Lookup - class Dstk < Google - - def name - "Data Science Toolkit" - end - - private # ---------------------------------------------------------------- - - def base_query_url(query) - host = configuration[:host] || "www.datasciencetoolkit.org" - "#{protocol}://#{host}/maps/api/geocode/json?" - end - end -end diff --git a/lib/geocoder/results/dstk.rb b/lib/geocoder/results/dstk.rb deleted file mode 100644 index ce98fe6a5..000000000 --- a/lib/geocoder/results/dstk.rb +++ /dev/null @@ -1,6 +0,0 @@ -require 'geocoder/results/google' - -module Geocoder::Result - class Dstk < Google - end -end \ No newline at end of file diff --git a/test/test_helper.rb b/test/test_helper.rb index b3e4301e4..cf63d39a2 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -196,14 +196,6 @@ def fixture_prefix end end - require 'geocoder/lookups/dstk' - class Dstk - private - def fixture_prefix - "google" - end - end - require 'geocoder/lookups/location_iq' class LocationIq private diff --git a/test/unit/lookups/dstk_test.rb b/test/unit/lookups/dstk_test.rb deleted file mode 100644 index 8783ab9f4..000000000 --- a/test/unit/lookups/dstk_test.rb +++ /dev/null @@ -1,26 +0,0 @@ -# encoding: utf-8 -require 'test_helper' - -class DstkTest < GeocoderTestCase - - def setup - super - Geocoder.configure(lookup: :dstk) - end - - def test_dstk_result_components - result = Geocoder.search("Madison Square Garden, New York, NY").first - assert_equal "Manhattan", result.address_components_of_type(:sublocality).first['long_name'] - end - - def test_dstk_query_url - query = Geocoder::Query.new("Madison Square Garden, New York, NY") - assert_equal "http://www.datasciencetoolkit.org/maps/api/geocode/json?address=Madison+Square+Garden%2C+New+York%2C+NY&language=en&sensor=false", query.url - end - - def test_dstk_query_url_with_custom_host - Geocoder.configure(dstk: {host: 'NOT_AN_ACTUAL_HOST'}) - query = Geocoder::Query.new("Madison Square Garden, New York, NY") - assert_equal "http://NOT_AN_ACTUAL_HOST/maps/api/geocode/json?address=Madison+Square+Garden%2C+New+York%2C+NY&language=en&sensor=false", query.url - end -end