Community Conundrums are live! Learn more

Creating "distance from store"

Level 1
Creating "distance from store"
Hi Team,

I working for a client which has multiple stores around the country. My client offers a loyalty program. I have the home address for all loyalty members, and of course the street address of all stores. I would like measure the distance from each clients address to the nearest store. What is the best way to do that in DataIku? Is there a particular plugin I need to install?

Many thanks,

Lilja
0 Kudos
6 Replies
Dataiker
Dataiker
Hi Lilja,

You can use the geocoding plugin on both datasets: https://www.dataiku.com/dss/plugins/info/geocoder.html. That will give you one new GEOPOINT column for each of the 2 datasets (stores and clients). You can decompose these GEOPOINTs in latitude and longitude.

Then you can use the "Geo-join" processor of a visual Prepare recipe to compute the "distance from store" column.

Cheers,

Alex
0 Kudos
Dataiker
Dataiker
Could you retry with the newest version of the plugin (1.0.9) please?
0 Kudos
Level 1
Author
Hi, I have the geocoder plugin (1.0.7). Should it not work on that version?

I tried the link you shared (https://www.bingmapsportal.com/) and I'm having creating a Bing Maps API for Enterprise because it does not allow me to "Review Legal Terms".

Then I created an API key from MapQuest and tried it in DSS. Then I got a different error:

Error while running a script step
NullPointerException
Additional technical details: HTTP code: 400, Code: STEP_RUN_EXCEPTION, type: ApplicativeException
0 Kudos
Dataiker
Dataiker
Hi, The Bing geocoder is working fine on my side. Have you installed the latest version of the geocoder plugin (1.0.9)? Have you followed the instructions on https://www.bingmapsportal.com/ to get an API key?
0 Kudos
Level 1
Author
Hi Alex,

I signed up for an API key from Bing (Azure Maps Account). However, I get this error message when I try to use the geocoding plugin.

Error while running a script step
Bing API error: 401: Unauthorized: {"authenticationResultCode":"InvalidCredentials","brandLogoUri":"http:\/\/spatial.virtualearth.net\/Branding\/logo_powered_by.png","copyright":"Copyright © 2018 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.","errorDetails":["Access was denied. You may have entered your credentials incorrectly, or you might not have access to the requested resource or operation."],"resourceSets":[],"statusCode":401,"statusDescription":"Unauthorized","traceId":"c18416f318ac4b20b1e450bd14bc2df8|DU00000139|7.7.0.0"}

Do you know what might be causing this error?

Thanks,
Lilja
0 Kudos
Dataiker
Dataiker
Hi Lilja,

There is a geo-join processor (https://doc.dataiku.com/dss/latest/preparation/processors/geo-join.html) in the Prepare recipe that should do it. You would create the Prepare recipe on the customer data, and then join the store data to it with the geo-join processor.

Best,
Alex
0 Kudos
Labels (3)