"Google Maps API"

sgenzersgenzer Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,959 Community Manager
edited June 2019 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 Administrator, Moderator, Employee, Member, University Professor Posts: 1,993 RM Engineering
    Hi,

    cool, thanks for sharing :)

    Regards,
    Marco
  • MartinLiebigMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,503 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
    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
  • sgenzersgenzer Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,959 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.