Searching of Near Me places using JSON Parsing

advertisement
Searching of Near Me places using JSON Parsing
Pooja Gavhane1,Dipali Bhakare2,Manisha Zurunge3 and Pooja Dalvi4
Student, Department of Computer Engineering, SavitribaiPhule Pune University
Pune, Maharashtra, India
poojagavhane26@gmail.com
dipabhakare21@gmail.com
manishazurunge@gmail.com
poojandalvi@gmail.com
Abstract
Sometimes you visit a place and there comes the situation that you want to recommend that visited place to your
friends, but you might forget the actual location of that visited place; which lefts bad impression of yours . Google chart
tools were developed which supports basic map charts which are also referred as 2D charts and it doesn’t support
drawing graphs. To address this problem Google Maps API has been introduced to the curriculum. Google Maps API
allows user to find customized locations according to their direction and allows user to make spatial queries to get the
exact required location. Google Map API is free service but it has some technical restrictions such as limitations on
number of queries a user can submit to Google Map services per day and per second [1]. To overcome from these
problems, we are developing new application called “Searching of Near-Me places Using JSON Parsing".
Keywords:JSON, Place query, Location Based Near-place, Query By Impression, Adjacency
Constraints.
1. Introduction
The user interaction with mobile is increasing day by day. For reaching at particular place has become so
much easier as more attention is paid to map services. There are various maps available namely Google
Maps, Bing Maps, Yahoo Maps etc. To get information of particular location for this there is only one prerequisite that user should be well experienced of usage of online Map.For surfing places there are various
applications developed which provides number of facilities for user to reach over specified location.
Google Maps API is one of the most important applications which are widely used all over the world. This
integrates web and map specification to reach over a place. It uses Map along with marker to specify
location of the user and distance between source and destination.
Initially Google Maps API was showing number of markers at the same time on map, which degrades the
performance of Google Map API, to overcome from this problem Grid based filtering algorithm and
DBSCAN algorithm is used [2]. The main disadvantage of Google Map API is whenever user sends its
request to the server, the response received from server is in the form of XML which is quiet lengthy and
parsing becomes time consuming process. To get rid of this problem we are proposing an application
"Searching of Near Me places Using JSON Parsing" in which the response is received in the form of JSON
format, which is combination of array and object [3]; which takes lesser time for parsing as compared to
Google Maps API [4].To propose this application we are using three algorithms namely naive approach,
Distance pre-calculating algorithm and grid indexed filtering algorithm [5].
2. Existing Algorithm
Google Maps is mostly used by number of users around the world to search location which is unknown to
the user. In Google Maps API features and functionalities are less helpful when the time comes to display
large number of locations on the map, because thousands of markers are displayed on the map which
eventually degrades the performance of Google Maps API.
1
IJRIT
Fig. 1 Large number of location on map
To overcome from this poor performance two algorithms are proposed namely:
2.1 Grid Based Filtering
The plotting of thousands of points on Map affects the visualization of places on Map, which results in
degradation with user interaction. The emergency solution was introduced to reduce the number of markers
within the map and that is establishing top-k places, based on ranking [8] instead of showing all the places
on map. To solve these issues Grid Based filtering algorithm is introduced. The current viewport /part of
map are divided into several grid cells for effective filtering. Reference is unique key for all its cells (see
fig. 2). The value for reference cell can be calculated using following formula:
[๐‘™๐‘œ๐‘›๐‘”๐‘–๐‘ก๐‘ข๐‘‘๐‘’๐‘– /โˆ†๐‘ฅ] ∗ โˆ†๐‘ฅ
Reference (longitudei ,latitudei) ={
… … … (1)
[๐‘™๐‘Ž๐‘ก๐‘–๐‘ก๐‘ข๐‘‘๐‘’๐‘– /โˆ†๐‘ฆ] ∗ โˆ†๐‘ฆ
Here longitudei, latitudeiare longitude and latitude of current place Δx&Δy are grid cells size in X & Y axis
respectively. Following figure shows mapping places to the belonging cell reference. After mapping
process is done we will obtain sorted list of various reference points. Sorting is done in descending order
which will easily retrieve top-k ranked places from each list for each reference.
Fig.2 Mapping places to the belonging cell references
2.2 Clustering geographically overlapped places
The main disadvantage of previous algorithm is two adjacent places gets overlapped, which results in loss
of information on the map, which means user is not able to choose desired place if necessary. To solve this
problem, Clustering is introduced. In DBSCAN (Density Based Spatial Clustering of Application with
Noise) [8] the top ranked places amongst all places are considered and they are grouped with other adjacent
places to form cluster. The cluster size and shapes may be different.
2
IJRIT
Fig.3 Overlapped places before clustering (left), Places after clustering (right)
3. Proposed Algorithm
Google map API is free service but it has technical restrictions on searching required places in Grid based
filtering algorithm finding reference cell is not relatively that much easier, so there was introduction of
DBSCAN algorithm in which only top ranked places are considered to form clusters which results in
loosing appropriate information of require place if it has lowest rank in the table. For this purpose we are
introducing "Searching of Near-Me places Using JSON Parsing" which is using three algorithms namely
Naive Approach, Distance Pre-calculating algorithm and Grid Indexing Algorithm [5]. The appropriate
working is being explained further, Suppose person A wants to give the recommendation[10] of Exotica
hotel to person B but person A is new in that area but he don’t remember the actual location of Exotica
hotel for this the person A recalls the near places which are adjacent to hotel, so person A will inform to
person B it’s physical location such as “Chinese food provider hotel”, it’s geographical location such as
“located in Vimannagar” and it’s semantic location[7] such as “situated near by IBM company” [6]. So
person B will follow this information given by person A to find Exotica hotel, person B will most probably
search “A Chinese food provider hotel in Vimannagar”. There might be possibility of number of such hotel
in that area but exact hotel recommended by person A is not that much easier to find. Therefore to
overcome this problem there was introduction of a query called PQAC [5]. That means Problem Query
Adjacency Constraints. This can get information in following format from user:
i. Target place and its type.
ii. Range in which the target place is located.
iii. No. of places those are adjacent to target place.
But this is consuming lot of memory to store all information given by user. In case to overcome from this
problem we introduce QBI (Query By Impression). QBI will generate the table with number of places
according to specification of user in certain range (radius). Next step is to calculate the distance for this we
are using Naive Approach. This explanation is given further,
3.1 Naïve Approach
Input: t: the type of target place
R: the spatial range that the target place is located in
AC: the set of adjacency constraints
Output: L: the ranking list of candidate places
1. Find P*={pi|pi type=t, pi . location is in R , pi is an element of P};
2. For each pi in P*
3. s(pi)=0;
4. For each acjin AC;
5. Find S={ pk|pktype=acj, dis (pk,pi )<dmax};
6. If S is not empty
7. Find dp_k=min {dis (pi,pk),where pkis an element of S};
8. s(pi)=s(pi)+gain(dp_k);
3
IJRIT
9. Sort the elements in P* by relevance scores in descending order;
10. Output the top-10 elements in P* as the ranking list L;
1: The places which are having similar target type and those are located in specified radius are derived from
the database.
2: Relevance degree s(pi) is derived using adjacency constraints.
3: This line demonstrates that initially degree of Relevance is set to zero for avoiding garbage data.
4-5: In these lines we came to know that pkis nothing but the place type selected by the user, p i is current
location of the user and distance between pi and pk should be less than value of d max and accordingly we can
retrieve the value of acj, after evaluation it is stored in S.
6: Initially it is compulsory that value of S should not be empty.
7: There might be the possibility of getting number of answers of S, amongst all of them the value which is
lowest is selected. This result is stored into d (p, k) and is being forwarded to gaining function to calculate
relevance score.
8-9-10: Relevance degree s(pi) is calculated by summing Relevance degree s(pi) and gaining function gain
d(p,k).The resulting answer is stored in the descending order referred as top-k [9] ranked places.
Gaining function consider the nearest place amongst the available places in the list. For calculation of
gaining function formula for gaind(p, k) is illustrated further in equation number (2).
Formula used in gaining function:
Gain (d) =
1.5×๐‘‘๐‘š๐‘Ž๐‘ฅ −๐‘‘
1.5×๐‘‘๐‘š๐‘Ž๐‘ฅ −0.5×๐‘‘
… … … (2)
Here ๐‘‘๐‘š๐‘Ž๐‘ฅ is nothing but maximum distance for checking whether two places are adjacent or not (value of
radius). The value of ๐‘‘ is lying between 0 to ๐‘‘๐‘š๐‘Ž๐‘ฅ . The answer of gaining function is in between 0.5 to 1.
To evaluate this let us consider the value of ๐‘‘ and ๐‘‘๐‘š๐‘Ž๐‘ฅ as 30 and 200 respectively. The final answer will
be 0.947.
In Distance pre calculating algorithm top-10 candidates with highest score are stored into the table and
adjacency graph is generated, if new place gets added into the list there is an overhead of changing in
adjacency graph. All the data retrieved in this algorithm needs large database for storage which results cost
increment. So as to remove all the disadvantages occurred in this algorithm we are using another algorithm
named grid indexing algorithm.
3.2 Grid indexing algorithm:
This algorithm simply divides the map into number of grids of size 100 X 100 square meter. Which
enhance the usage of finding near places from certain range. This algorithm prefers searching based on
grids instead of places. Following diagram shows the pictorial representation of grid indexing algorithm.
Table 1 represents the tabular format of type of places available in particular square.
The main advantage is newly added near place is easily added to the table which was not possible in
Distance Pre-Calculating algorithm. As newly added places are directly entered into the table so there is no
wastage of memory.
Fig. 4 Pictorial Representation of Grid indexing algorithm
4
IJRIT
Table 1: Types of Places
Grid
(2,2)
(2,5)
(3,3)
(3,5)
(5,3)
(5,4)
Café
1
0
0
1
0
1
Park
0
0
0
1
1
0
Bakery
0
1
1
0
0
0
…
…
…
…
…
…
…
Total
1
1
1
2
1
1
We can calculate the gaining function’s value can be calculated using following formula:
Gain (d) =
1.5×๐ถ−๐‘‘
1.5×๐ถ−0.5×๐‘‘
,๐ถ = ⌊
๐‘‘๐‘š๐‘Ž๐‘ฅ
๐‘ค๐‘–๐‘‘๐‘กโ„Ž๐‘”๐‘Ÿ๐‘–๐‘‘
⌋ … … … (3)
Consider that user is waiting at café C3 and its location is (2, 2) so as to reach over bakery B2 that person
needs to cross over one block, finally the value of ๐‘‘ is considered as 1. To avoid the calculation overhead
introduced in Distance Pre Calculating algorithm we are introducing new terminology C. For the
calculation of C, ๐‘‘๐‘š๐‘Ž๐‘ฅ and ๐‘ค๐‘–๐‘‘๐‘กโ„Ž๐‘”๐‘Ÿ๐‘–๐‘‘ are considered and their values are 200(earlier we have considered it
as 200 for calculation) and 100(size of each grid is 100 X 100 Square meter) respectively so the value of C
is 2. After calculation we are getting answer 0.8, which is less time consuming as compared to Distance Pre
Calculating algorithm.
4. Conclusion
Google Map API is free service but it has some technical restrictions that are limitations on number of
queries a user can submit to Google Map services per day and per second. The Google Places API has
certain restrictions on the query processing and those users are allowed only 1000 requests per 24 hour
period which are having the API Key. In this paper, explains the comparison between “Google Maps API”
and “Searching of Near-Me Places Using JSON parsing". It is allowing user to search 2400 requests per
day there are no restrictions applied on query to be asked the server by the user. In Google Maps API is
applying two algorithms namely Grid Based Filtering and DBSCAN algorithm and in Searching of Near
Me places are using algorithms namely Naïve Approach, Distance Pre-calculating algorithm and Grid
based Indexing algorithm which are providing the distance calculation answers in more productive and
effective format.
References
[1]Ying Zhu, “Introducing Google Chart Tools and Google Maps API in Data Visualization Courses”,
Published by the IEEE Computer Society, November/December 2012.
[2]GayratjonKholmuradovHabibullayevich, Xian Chen, and Hyoseop Shin, “Efficient Filtering and
Clustering Mechanism for Google Maps”, Journalof Advanced Management Science, Vol. 1, No. 1, March
2013.
[3]KalyanNetti, “Interactive Guided Online/Off-line search using Google API andJSON”,IJCSI
International Journal of Computer Science Issues, Vol. 7, Issue 5, September 2010.
[4]Dunlu PENG, Lidong CAO, Wenjie XU, “Using JSON for Data Exchanging in Web Service
Applications”, School of Optical-Electrical and Computer Engineering, University of Shanghai for Science
and Technology, Shanghai 200093, China,2011.
[5]Chi-Yao Tseng, Shih-Han Lin, and Ming-Syan,”Query By Impression: A Novel Place Query System
with Adjacency Constraints”, Department of Electrical Engineering, National Taiwan University,Taipei,
Taiwan, 2013.
[6]Jorg Roth, “Flexible Positioning For Location Based Services”, IADIS International Journal on
WWW/Internet, Vol.1, No.2, pp. 18-32.
5
IJRIT
[7]Chang Choi 1, MiyoungCho1, Eui-young Kang 2, Pankoo Kim 3,” Travel Ontology for recommendation
System based on Semantic Web”,1 Department of Computer Science, Chosun University 2Department of
Computer Education, Cheju National University 3Department of Computer Engineering, Chosun
University, 2006.
[8]Yu Zheng, Lizhu Zhang, Xing Xie, Wei-Ying Ma,”Mining Interesting Locations and Travel Sequences
from GPS Trajectories”, Madrid, Spain, April 2009.
[9]Surajit Chaudhuri 1, Luis Gravano2,”Evaluating Top-k Selection Queries”, 1Microsoft Research,
2
Columbia University, Proceedings of the 25th VLDB Conference, Edinburgh, Scotland, 1999.
[10]Karol Waga, Andrei Tabarcea, PasiFranti,” Context Aware Recommendation of Location-based
Data”,Speech & Image Processing Unit, School of Computing, University of Eastern Finland, Joensuu.
6
IJRIT
Download