Stubmation
Address and Coordinate converter
Converts location data between text addresses and GPS coordinates depending on which format is needed for the requested task.
Uses
A scenario for this could be:
- You have a street address and need to retrieve latitude and longitude
- You have latitude and longitude and need to retrieve a formatted address
- You have Coordinates in different formats and want a standard way to process them through one workflow
This stubmation supports all of those patterns.
What Happens behind the scenes
The stubmation receives a flow_data object that tells it which conversion action to perform.
The action key inside flow_data determines the mode of operation.
The action_params object contains the actual values to use for the lookup.
Depending on the action used, the workflow will either:
- covert an address into coordinates
- convert coordinates into an address
All template actions built for this workflow call the same stubmation name:
address_and_gps_coordinates_converter
The only difference between them is the flow_data.action value and the structure of flow_data.action_params.
Coordinates from Address
Use this when you have a full address string and need latitude and longitude.
Flow Data Explained
action required string
The operation the stubmation should perform.
For this use case the value must be:
action_params required json object
Contains the data required for the selected action.
action_params.address required string
The full address string to convert from.
Example:
Address from Comma Separated LatLng String
Use this when latitude and longitude are provided as a single comma separated string.
Flow Data Explained
action required string
The geo-coding operation the stubmation should perform.
For this use case the value must be:
action_params required json object
Contains the data required for the selected action.
action_params.latlng required string
A comma separated latitude and longitude string.
Example:
Address from Separate Lat and Lng String Values
Use this when latitude and longitude are provided as separate string values.
Flow Data Explained
action required string
The geo-coding operation the stubmation should perform.
For this use case the value must be:
action_params required json object
Contains the data required for the selected action.
action_params.lat required string
The latitude value as a string.
Example:
action_params.lng required string
The longitude value as a string.
Example:
Address from Separate Lat and Lng Numeric Values
Use this when latitude and longitude are provided separately and should be sent as numeric values.
Flow Data Explained
action required string
The geo-coding operation the stubmation should perform.
For this use case the value must be:
action_params required json object
Contains the data required for the selected action.
action_params.lat required number
The latitude value as a number.
Example:
action_params.lng required number
The longitude value as a number.
Example:
Summary of Supported Payloads
This stubmation currently supports these payload shapes.
Address to Coordinates
Coordinates to Address using latlng
Coordinates to Address using string lat and lng
Coordinates to Address using numeric lat and lng
Notes
- Use
coordinates_from_addresswhen starting with a normal address - Use
address_from_coordinateswhen starting with latitude and longitude - Use the string variants when the downstream process expects string values
- Use the numeric variant when the downstream process expects true numbers