"Google Maps API"

sgenzersgenzer 12Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,448  Community Manager
edited June 9 in Help
hi...not sure if someone has done this before but I figured out how to get Google Maps API to work within RM.  This operator takes an address (attribute="address_for_google") and calculates the distance in miles to New York, NY.  Note that if you use this, you will need to request an API key from developer.google.com

<operator activated="true" class="web:enrich_data_by_webservice" compatibility="5.3.002" expanded="true" height="60" name="Google Maps Distance Lookup" width="90" x="313" y="30">
            <parameter key="query_type" value="XPath"/>
            <list key="string_machting_queries"/>
            <list key="regular_expression_queries"/>
            <list key="regular_region_queries"/>
            <list key="xpath_queries">
              <parameter key="Distance" value="//distance/text/text()"/>
            </list>
            <list key="namespaces"/>
            <parameter key="assume_html" value="false"/>
            <list key="index_queries"/>
            <list key="jsonpath_queries"/>
            <parameter key="service_method" value="fgfgfgf"/>
            <parameter key="body" value="text=&lt;%title%&gt;"/>
            <parameter key="url" value=""/>
            <parameter key="delay" value="20"/>
            <list key="request_properties">
              <parameter key="key" value="ENTER YOUR API KEY HERE"/>
            </list>
          </operator>

Answers

  • Marco_BoeckMarco_Boeck Team Lead Software Engineering Moderator, Employee, Member, University Professor Posts: 1,806   RM Engineering
    Hi,

    cool, thanks for sharing :)

    Regards,
    Marco
  • mschmitzmschmitz Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 2,127  RM Data Scientist
    That's cool :D

    I build an libary process to show google map as sticky on a map. But this REALLY helps.

    Thanks a lot!


    Martin
    - Head of Data Science Services at RapidMiner -
    Dortmund, Germany
  • sgenzersgenzer 12Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,448  Community Manager
    thanks, guys.  It was fun.  :)

    BTW if you try it, you should increase the delay to 150ms or so.  Google throttles the Distance Matrix API use at the "free" tier:

    100 elements per query.
    100 elements per 10 seconds.
    2 500 elements per 24 hour period

    Scott
Sign In or Register to comment.