Use Azure Maps to calculate an isochrone to reach your customers

Published Sep 21 2021 08:01 AM 1,012 Views
Microsoft

Imagine you are a store owner and would like to target customers that live within a 15-minute drive from your store with advertising for your weekly specials. You could draw a circle on a map, guessing that is about 15 minutes away, but it will not truly represent the time it will take for customers to get to your store. For example, a customer living near a major transit route can live further away from the store than a customer living in a less well-served part of the city. To meet this need, an isochrone is a polygon (an area on a map) of expected travel time. It represents the locations that will take the specified time, or less, it will take to get to a specific point (your store, in this case). Estimating an isochrone correctly, including all the variables like traffic, road, and vehicle conditions, is very hard to do by yourself!

 

london.jpg

Using the Get Route Range API from Azure Maps makes it very easy to calculate the isochrone. For our store example, we need to calculate a 15-minute isochrone for every store we have. We only need the coordinates (longitude and latitude) from our stores and the drivetime in seconds (15 x 60 = 900 sec).

 

GET https://atlas.microsoft.com/route/range/json?subscription-key=[subscription-key]&api-version=1.0&query=47.65431,-122.1291891&timeBudgetInSec=900

Search Customer Address

To determine which customer is living inside the 15-minute drive isochrone, we first need the coordinates for every customer’s address. Then, we simply loop through all our customers and use the Get Search Address API to get the coordinates.

 
GET https://atlas.microsoft.com/search/address/json?subscription-key=[subscription-key]&api-version=1.0&query=15127 NE 24th Street, Redmond, WA 98052

Point In Polygon

The last step is to check if a customer coordinate is inside one of our store isochrones. We use the Point In Polygon API to determine if this is true.

 

POST https://atlas.microsoft.com/spatial/pointInPolygon/json?subscription-key=[subscription-key]&api-version=1.0&lat=33.5362475&lon=-111.9267386

And in the request body the store isochrone.

 

We now can target those customers with store-specific offers and promotions.

 

chicago.jpg

What schools are within a 20-minute walk from my home? What available jobs are within a 30-minute transit commute? Where you are located and what is near you brings context to the choice of where you want to live and Azure Maps Isochrone API can help you bring that location intelligence into your applications.

 

1 Comment
%3CLINGO-SUB%20id%3D%22lingo-sub-2770551%22%20slang%3D%22en-US%22%3EUse%20Azure%20Maps%20to%20calculate%20an%20isochrone%20to%20reach%20your%20customers%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2770551%22%20slang%3D%22en-US%22%3E%3CP%3EImagine%20you%20are%20a%20store%20owner%20and%20would%20like%20to%20target%20customers%20that%20live%20within%20a%2015-minute%20drive%20from%20your%20store%20with%20advertising%20for%20your%20weekly%20specials.%20You%20could%20draw%20a%20circle%20on%20a%20map%2C%20guessing%20that%20is%20about%2015%20minutes%20away%2C%20but%20it%20will%20not%20truly%20represent%20the%20time%20it%20will%20take%20for%20customers%20to%20get%20to%20your%20store.%20For%20example%2C%20a%20customer%20living%20near%20a%20major%20transit%20route%20can%20live%20further%20away%20from%20the%20store%20than%20a%20customer%20living%20in%20a%20less%20well-served%20part%20of%20the%20city.%20To%20meet%20this%20need%2C%20an%20%3CSTRONG%3Eisochrone%3C%2FSTRONG%3E%20is%20a%20polygon%20(an%20area%20on%20a%20map)%20of%20expected%20travel%20time.%20It%20represents%20the%20locations%20that%20will%20take%20the%20specified%20time%2C%20or%20less%2C%20it%20will%20take%20to%20get%20to%20a%20specific%20point%20(your%20store%2C%20in%20this%20case).%20Estimating%20an%20isochrone%20correctly%2C%20including%20all%20the%20variables%20like%20traffic%2C%20road%2C%20and%20vehicle%20conditions%2C%20is%20very%20hard%20to%20do%20by%20yourself!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22london.jpg%22%20style%3D%22width%3A%20795px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F311797i838A226F8B65BC2B%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22london.jpg%22%20alt%3D%22london.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20id%3D%22azure-maps-get-route-range%22%20class%3D%22headerLink%22%20id%3D%22toc-hId--350718189%22%20id%3D%22toc-hId--350717251%22%3EAzure%20Maps%20Get%20Route%20Range%3C%2FH2%3E%0A%3CP%3EUsing%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Fmaps%2Froute%2Fget-route-range%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreffer%20noreferrer%22%3EGet%20Route%20Range%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3EAPI%20from%20Azure%20Maps%20makes%20it%20very%20easy%20to%20calculate%20the%20isochrone.%20For%20our%20store%20example%2C%20we%20need%20to%20calculate%20a%2015-minute%20isochrone%20for%20every%20store%20we%20have.%20We%20only%20need%20the%20coordinates%20(longitude%20and%20latitude)%20from%20our%20stores%20and%20the%20drivetime%20in%20seconds%20(15%20x%2060%20%3D%20900%20sec).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22language-http%22%20data-lang%3D%22http%22%3E%3CSPAN%20class%3D%22err%22%3E%3CSTRONG%3EGET%3C%2FSTRONG%3E%20https%3A%2F%2Fatlas.microsoft.com%2Froute%2Frange%2Fjson%3Fsubscription-key%3D%5Bsubscription-key%5D%26amp%3Bapi-version%3D1.0%26amp%3Bquery%3D%3CSTRONG%3E47.65431%2C-122.1291891%3C%2FSTRONG%3E%26amp%3BtimeBudgetInSec%3D%3CSTRONG%3E900%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CDIV%20class%3D%22highlight%22%3E%0A%3CDIV%20class%3D%22chroma%20open%22%3E%0A%3CH2%20class%3D%22code-header%20language-http%22%20id%3D%22toc-hId-2136794644%22%20id%3D%22toc-hId-2136795582%22%3E%3CSPAN%20style%3D%22color%3A%20inherit%3B%20font-family%3A%20inherit%3B%20font-size%3A%2024px%3B%22%3ESearch%20Customer%20Address%3C%2FSPAN%3E%3C%2FH2%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3CP%3ETo%20determine%20which%20customer%20is%20living%20inside%20the%2015-minute%20drive%20isochrone%2C%20we%20first%20need%20the%20coordinates%20for%20every%20customer%E2%80%99s%20address.%20Then%2C%20we%20simply%20loop%20through%20all%20our%20customers%20and%20use%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Fmaps%2Fsearch%2Fget-search-address%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreffer%20noreferrer%22%3EGet%20Search%20Address%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3EAPI%20to%20get%20the%20coordinates.%3C%2FP%3E%0A%3CDIV%20class%3D%22highlight%22%3E%0A%3CDIV%20class%3D%22chroma%20open%22%3E%0A%3CDIV%20class%3D%22code-header%20language-http%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CPRE%20class%3D%22code-header%20%20language-http%22%20tabindex%3D%220%22%3E%3CCODE%3EGET%20https%3A%2F%2Fatlas.microsoft.com%2Fsearch%2Faddress%2Fjson%3Fsubscription-key%3D%5Bsubscription-key%5D%26amp%3Bapi-version%3D1.0%26amp%3Bquery%3D15127%20NE%2024th%20Street%2C%20Redmond%2C%20WA%2098052%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CH2%20class%3D%22table-wrapper%22%20id%3D%22toc-hId-329340181%22%20id%3D%22toc-hId-329341119%22%3E%3CSPAN%20style%3D%22color%3A%20inherit%3B%20font-family%3A%20inherit%3B%20font-size%3A%2024px%3B%22%3EPoint%20In%20Polygon%3C%2FSPAN%3E%3C%2FH2%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3CP%3EThe%20last%20step%20is%20to%20check%20if%20a%20customer%20coordinate%20is%20inside%20one%20of%20our%20store%20isochrones.%20We%20use%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Fmaps%2Fspatial%2Fpost-point-in-polygon%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreffer%20noreferrer%22%3EPoint%20In%20Polygon%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3EAPI%20to%20determine%20if%20this%20is%20true.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22language-http%22%20data-lang%3D%22http%22%3E%3CSPAN%20class%3D%22err%22%3E%3CSTRONG%3EPOST%3C%2FSTRONG%3E%20https%3A%2F%2Fatlas.microsoft.com%2Fspatial%2FpointInPolygon%2Fjson%3Fsubscription-key%3D%5Bsubscription-key%5D%26amp%3Bapi-version%3D1.0%26amp%3Blat%3D%3CSTRONG%3E33.5362475%3C%2FSTRONG%3E%26amp%3Blon%3D%3CSTRONG%3E-111.9267386%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EAnd%20in%20the%20request%20body%20the%20store%20isochrone.%3C%2FP%3E%0A%3CDIV%20class%3D%22highlight%22%3E%0A%3CDIV%20class%3D%22chroma%22%3E%0A%3CDIV%20class%3D%22table-wrapper%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3CP%3EWe%20now%20can%20target%20those%20customers%20with%20store-specific%20offers%20and%20promotions.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22chicago.jpg%22%20style%3D%22width%3A%20795px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F311798iC39DD328CB5E741E%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22chicago.jpg%22%20alt%3D%22chicago.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20id%3D%22examples%22%20class%3D%22headerLink%22%20id%3D%22toc-hId--1478114282%22%20id%3D%22toc-hId--1478113344%22%3EExamples%3C%2FH2%3E%0A%3CP%3EWhat%20schools%20are%20within%20a%2020-minute%20walk%20from%20my%20home%3F%20What%20available%20jobs%20are%20within%20a%2030-minute%20transit%20commute%3F%20Where%20you%20are%20located%20and%20what%20is%20near%20you%20brings%20context%20to%20the%20choice%20of%20where%20you%20want%20to%20live%20and%20Azure%20Maps%20Isochrone%20API%20can%20help%20you%20bring%20that%20location%20intelligence%20into%20your%20applications.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fazuremapscodesamples.azurewebsites.net%2F%3Fsearch%3DIsochrone%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreffer%20noreferrer%22%3EAzure%20Maps%20Isochrone%20Samples%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-maps%2Fhow-to-use-best-practices-for-search%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreffer%20noreferrer%22%3EBest%20practices%20for%20Azure%20Maps%20Search%20Service%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-maps%2Fhow-to-search-for-address%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreffer%20noreferrer%22%3ESearch%20for%20a%20location%20using%20Azure%20Maps%20Search%20services%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2770551%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22Picture1.png%22%20style%3D%22width%3A%20134px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F312407iA5D0C6E3FDC857DE%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Picture1.png%22%20alt%3D%22Picture1.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20inherit%3B%22%3EWhat%20schools%20are%20within%20a%2020%20minute%20walk%20from%20my%20home%3F%20What%20available%20jobs%20are%20within%20a%2030%20minute%20transit%20commute%3F%26nbsp%3B%20Where%20you%20are%20located%20and%20what%20is%20near%20you%20brings%20context%20to%20the%20choice%20of%20where%20you%20want%20to%20live%20and%20Azure%20Maps%20Isochrone%20API%20can%20help%20you%20bring%20that%20location%20intelligence%20into%20your%20applications.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2770551%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Maps%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Co-Authors
Version history
Last update:
‎Sep 23 2021 05:10 AM
Updated by: