Search code examples
actions-on-google

How to make action "What's the Geology here"?


I would like to make an action where people can ask the geology at a/their location.

This would make use of GET requests from web services which are made available through the OneGeology Geoportal (http://portal.onegeology.org/OnegeologyGlobal/)

GET requests look like:

http://portal.onegeology.org/OnegeologyGlobal/proxyxml?url=https%3A//gs-seamless.geoscience.nsw.gov.au/geoserver/onegeology/ows%3FSERVICE%3DWMS%26SERVICE%3DWMS%26VERSION%3D1.3.0%26REQUEST%3DGetFeatureInfo%26FORMAT%3Dimage%252Fpng%26TRANSPARENT%3Dtrue%26QUERY_LAYERS%3Dau_nsw_25k_geounits%26LAYERS%3Dau_nsw_25k_geounits%26INFO_FORMAT%3Dtext%252Fhtml%26I%3D50%26J%3D50%26CRS%3DEPSG%253A4326%26STYLES%3D%26WIDTH%3D101%26HEIGHT%3D101%26BBOX%3D-33.689918518066406%252C150.75199127197266%252C-33.620567321777344%252C150.82134246826172&_=1587457888900

Output is

https://gs-seamless.geoscience.nsw.gov.au/geoserver/onegeology/ows?SERVICE=WMS&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=au_nsw_25k_geounits&LAYERS=au_nsw_25k_geounits&INFO_FORMAT=text%2Fhtml&I=50&J=50&CRS=EPSG%3A4326&STYLES=&WIDTH=101&HEIGHT=101&BBOX=-33.689918518066406%2C150.75199127197266%2C-33.620567321777344%2C150.82134246826172

Geoserver GetFeatureInfo output

So would want GA to respond with the "unit_name" attribute = "Londonderry Clay" .

Could someone point me in the right direction to develop such a service?

Would it be simplier if I made a mobile app version of the portal first? Or do I need to make a custom action via Dialogflow from stratch? or a 3rd way?


Solution

  • Well, what would be easier is to work with technologies that you're already familiar with.

    Are you familiar with mobile programming? Go that route, although it will be more difficult to integrate voice for other Assistant platforms later.

    Understand web programming more and you're used to building back-end services? Building a fulfillment webhook that makes this call from parameters from Dialogflow might be easier.

    If you want to learn how this is typically done, and not necessarily go with what's easiest for you, you'll want to go the latter route. This involves

    • Designing the conversation
    • Building this conversation in Dialogflow
    • The specific procedures involved to get user information including specific location
    • Building a webhook running on a server to process the user input, including their location, making the call to the API, and returning the response to the user