How can I get latitude and longitude from an address in .net core mvc

Ishika Garg 10 Reputation points
2023-04-08T14:14:21.8933333+00:00

I want to find distance between two locations so that I can calculate the price and amount of time that will be taken to reach the other location and for that I want latitude and longitude of both the locations so that I can calculate the distance between them.

Developer technologies | ASP.NET | ASP.NET Core
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 78,086 Reputation points Volunteer Moderator
    2023-04-08T15:06:39.1633333+00:00
    0 comments No comments

  2. Anonymous
    2023-04-13T07:46:06.1833333+00:00

    Hi @Ishika Garg

    I want latitude and longitude of both the locations so that I can calculate the distance between them.

    For this issue, you have to use the map API, such as Azure Maps, Bing Maps. Generally, the Map API will provide related API method to get the latitude and longitude for an address, and then calculate the distance, travel time and so on.

    For example, if using Azure Maps, you can refer to the following articles:
    To get the latitude and longitude:

    Request latitude and longitude for an address (geocoding)

    Search - Get Search Address

    To get the distance, estimated travel time between an origin and a destination:

    Route - Get Route Directions

    Route - Post Route Matrix


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    Best regards,
    Dillion

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.