Last 3 weeks, I have been working on my hobby project. In this project, I collected restaurants datas in UK from biggest online food order website and used for some of map dashboards. I am not used only restaurant names. I used restaurant coordinates, cuisines, menus, foods, and food prices and added some different datas.
When I collecting this data from the online food order website, I wrote a python script and used basic http requests. Their global website is using post-code for restaurant search operation. When you decided to restaurant, they using restaurant name and restaurant id for showing restaurant menu. In the python script I used same methods.
First step (preparation):
I got all post-codes in UK and used this post-codes for restaurant list. (They are using first part of post-code like SW1, EC2, W12, E10. You don't need to use all post-codes.) I downloaded all post-codes (2619895) in UK from doogal's website and parsed the first part of post-codes. For this operation, I used PostgreSQL but if you want, you can use Python, shell or other databases. After parse and group operation, I got 2960 different post-codes.
Second Step :
In this step I made basic http request to online food order website and collect restaurant list for each post-code. I used python script for this operation. When you check the request result, you can see the restaurant dataset as json format in the "data-ga-values" section. I used grep command for getting restaurant data, but if you want you can use different ways.
Third Step :
In this step we collecting menu datas like food name, food price, bundles, extras and etc. Again, for this operation I used python and made basic http request. But this request containing restaurant names and restaurant ids. That's why I used python and I parsed json outputs that comes from second step.
Fourth Step :
This step is not necessary but I wanted to create area graph. (not a map graph) I used Elasticsearch and Kibana for store and visualise data. For the area map, Kibana is using GSS codes and ISO-3166-2 codes. But they are not storing this data. They are using map coordinates. I used geometric Polygon-coordinate data and easily convert from GSS to coordinate and ISO-3166-2 to coordinate values. (https://maps.elastic.co/#file/uk_subdivisions) Python has a shapely library for polygon operations. With this library, I easily converted coordinate datas to area datas. After the basic http request and conversation operations I wrote data to Elasticsearch. Then I used Kibana and created map dashboards.
That's it.
Yes, It took 3 weeks and it's too long for this. But I never worked with area maps on Kibana. Learning the area maps at Kibana took time. Also, I tried 4 different way for convert operation from coordiante to GSS and ISO codes. But, Kibana is using open map and some of their GSS and ISO datas are not latest. So, it took time to find correct data. Finally, I get GSS and ISO datas from Elastic Map service and used.
Avarage Maps:
Avarage Menu Price
Avarage Menu Price (Area Map)
Avarage Food Maps:
Avarage Doner Price (Area Map)
Avarage Wrap Price (Area Map)
Counts :
Restauran Count
Restauran Count (Area Map)
PS: Below images contains only Kebab restaurants