I want to use map and distance matrix api free

Hello There,

I want to use map and route distance. in order to do that I have to bill google's distance matrix api. Is there any way I can use that free like any alternate api which is providing free service to calculate distance between two points and can pin point the location

any help would be appriciated

thank you in advance

Hi Darshan,

if distance calculation doesn't need to be accurate the you could use the SQL Server built in Spatial queries. Distance is calculated in a direct line and not based on roads asf.

The example here is an advanced sql server query (not possible to achieve this with an aggregate). It takes Latitude and Longitude as parameters. Both are of type decimal with a precision of 8.

Within my Entity Geo i have stored cities along with their latitude and longitude. Also both a decimal with a precision of 8.

geography::Point(Latitude, Longitude, 4326). This function casts both decimals to a Point SQL data type. 4326 is a spatial reference identifier. In short this one is responsible for how results are returned. 4326 is metric. You can read here Spatial Reference Identifiers (SRIDs) - SQL Server | Microsoft Docs  more.

The appended .STDistance which also takes a geography::Point as parameter calculates the distance between the two points. With a spatial reference identifier of 4326 this returns meters. As you see in the example i divide that by 1000 to get kilometers, wrapped in a ROUND with a precision of 1.

For displaying geo data on a map, you might find the LeafletJS project helpful. There is a forge component for reactive web available here LeafletJS - Reactive - Overview | OutSystems .

For finding places i can recommend what3words (one of my favorites) https://what3words.com/. Still there is no forge component available. I might do that when i find some time :-). what3words is free for small companies but they charge a price when transaction volume rises. The website does not say when this happens.

Hope that helps,


Hey Darshan Saini

I think you can use this. Just try this and implement it accordingly.


Ankit S.


Thank you @Stefan Weber  and @Ankit Shukla for your time and efforts. As I am new to outsystems I'll take time and try these.

thank you again 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.