How to send a distance to storage account by azure maps using function app

surya chakravarthy 1 Reputation point

I want to find the distance between two points and the calculated distance need to store it in storage account.
I want to do that with serverless. So I had been choosen function app. can you help me with my requirement plz.

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
338 questions
{count} votes

1 answer

Sort by: Most helpful
  1. rbrundritt 7,011 Reputation points Microsoft Employee

    Which type of storage solution are you planning to use?

    The basic flow for your solution would be as follows:

    1. Get the two points you want to calculate the distance between. Is this input into the service? Stored in some file you want to process?
    2. If the points are addresses, geocode them using the v2 geocoding service in Azure Maps:
    3. Once you have coordinates, decide on the type of distance you want. If you want straight line distances, simply calculate these using the Haversine formula: If you want distances along the roads, use the Azure Maps routing service or route matrix service (if you are processing a lot of points at once).
    4. Take the distances, convert the units if needed as depending on which of the above you methods you use, you will likely get KM or meter distances.
    5. Connect to your storage account and upload your distances (how exactly you would do this depends on which storage method you are using).

    Use the SDKs to make it easier to make requests to the REST services:

    No comments