Implementation of Google Maps API 3 with Haversine Algorithm in
the Development of Geographic Information System Boarding
House Finder
Septian Eko Prasetyo, Aryo Baskoro Utomo, and Noor Hudallah
Electrical Engineering Department, Semarang State University, Indonesia
Keywords: Haversine Algorithm, Google Maps API, Geographic Information System, Boarding House, AJAX.
Abstract: Boarding house is a temporary shelter in the blocks of room in various size which are inhabited by students
and employees from outside the area. In reality, to find the boarding house on the outside area is need a
power, cost, and a lot of time. So it is necessary to the development an information system that can be
helping to solve this problem. The purpose of this research is developing the geographic information system
that can be find the boarding house according to the criteria of user wishes. This research is uses waterfall
development method. The programming language used is PHP, MySQL database and also implemented the
AJAX method to taking data to be more interactive. The use of API 3 on Google maps is able to provide a
picture of satellite imagery from the boarding house coordinates. This requires a coordinates point to display
the satellite imagery on this database. The system is also capable to analyse the distance of the coordinates
with haversine algorithm.
1 INTRODUCTION
Boarding house is a residence that is temporary and
in the form of blocks of rooms in various sizes
which are inhabited by students and employees from
outside the area (Anamisa et all., 2016). Some
students choose the boarding house as a temporary
dwelling place because the place to study and work
away from home (Reyes II, 2016).
Lack of information about boarding houses is
often an obstacle and an opportunity for boarding
house brokers (Setyarsih, 2016). Besides that, the
boarding houses must be able to use technology to
market their boarding houses (Gommans, 2014).
With the development of information technology, it
increases the ability of computers to solve problems
in various fields that need to provide the best
solution (Ichsan and Syah, 2014). So it is necessary
to develop an information system that be able to
facilitate of the users to find the ideal boarding
house in accordance with user wishes (Sulaiman et
all., 2012).
To support the information systems that can
provide mapping services, a geographic information
system that integrates spatial data into geospatial and
geographic data is needed (Ponce-Medellín et all.,
2009). Geographical Information Systems or
Geospatial Information Systems (GIS) is a collection
of tools that captures, stores, analysis, manages, and
presents data that are linked to geographical
locations (Bhat et all., 2011). GIS Provider
facilitates with geo-specific functionality for
application including map information, map
visualization and directory services. For example,
Google maps with its API can be considered as a
GIS Provider (Kushwaha and Kushwaha, 2011).
This research used the facilities of Google Maps
API 3 that can be visualize the map view into an
external website (Garude
and Haldikar, 2014). Google
maps provide an intuitive and highly responsive
mapping interface with aerial imagery and detailed
street data (Helshani, 2015). The google maps use
latitude and longitude to be able to display satellite
images on a map (Sharma and Morwal, 2015).
Beside the uses of Google Maps API 3, the
system is used haversine algorithm to calculated and
analyse the distance between two coordinates
(Essayad, 2011). Haversine algorithm for
measurement and estimation of distance with
improved efficiency in localization (Ganesh and
Vijay, 2015).
Prasetyo, S., Utomo, A. and Hudallah, N.
Implementation of Google Maps API 3 with Haversine Algorithm in the Development of Geographic Information System Boarding House Finder.
DOI: 10.5220/0009008902270233
In Proceedings of the 7th Engineering International Conference on Education, Concept and Application on Green Technology (EIC 2018), pages 227-233
ISBN: 978-989-758-411-4
Copyright
c
2020 by SCITEPRESS Science and Technology Publications, Lda. All rights reserved
227
To make the system more interactive, the data
retrieval is used AJAX method (Sneha and Khatwar,
2015). AJAX allows partial page update without the
need of refreshing the full page (Khanna and Mistry,
2012). AJAX can help to improve usability in many
situations while implementing an online information
system (Sachdeva and Singh, 2013).
2 METHOD
This research uses waterfall model for developing
the software. The Waterfall Model is the oldest and
the most wellknown software development model.
The special feature of this model is its sequential
steps. It goes downward through the phases of
requirements analysis, design, coding, testing, and
maintenance (Munassar and Govardhan, 2010).
Waterfall model can be seen in Figure 1. The
implementation of this research is in the area around
Semarang State University.
Figure 1: Waterfall Model.
2.1 Requirements Definition
Often known as Software Requirements
Specification (SRS) is a complete and
comprehensive description of the behaviour of the
software to be developed. The tools and materials
used to develop this information system consists of
software requirements and hardware requirements.
Software requirements can be seen in Table 1. While
hardware requirements can be seen in Table 2.
Table 1: Software Requirements.
Requirements Specification
Operation System Windows XP
Web Server XAMPP Version 3.2.1
Text Editor Notepad ++ / Sublime
Editor
Photo Editor Adobe Photoshop
Web Browser Mozilla / Google Chrome /
Safari
Table 2: Hardware Requirements.
Requirements Specification
Processor Intel Atom 1,6 Ghz
Random Access Memory 512 Mb
Video Graphic Adapter GMA 512 Mb
Processor Intel Atom 1,6 Ghz
Random Access Memory 512 Mb
The data in this study are the variables used to
determine the search filter on the system that is the
name of boarding house, facilities, type of boarding
house, rent duration, price, gender, and radius filter.
2.2 System and Software Design
The system and software design phase is the
planning and problem solving for a software
solution. It is begins with modelling the database
relation and data flow diagram. The database
relation is will be showed the flow of relationship
between tables that occur on the database system
(Suri and Sharma, 2011). In this table relation, there
are several related tables from the primary key to the
foreign key in another table. This shows that
between table A and table B are interconnected. To
provide an overview of the rule of system it is
requires Data Flow Diagrams (Ibrahim et all., 2011).
The Data Flow Diagram (DFD) that can be seen in
Figure 2.
Figure 2: Data Flow Diagram Level 0.
For display modelling is separation of user
permissions in which have different features and
menus. Based on the Data Flow Diagram, the
features and menu for various users are different.
The user is only can be searching and booking the
boarding house. The boarding house manager is can
manage the boarding data, booking data and setting
EIC 2018 - The 7th Engineering International Conference (EIC), Engineering International Conference on Education, Concept and
Application on Green Technology
228
the information about this management. And the
administrator controls the entire activity in this
system.
2.3 Implementation and Unit Testing
This phase is where the real code is written and
compiled into an operational application, and where
the database and text files are created. In other
words, it is the process of converting the whole
requirements and blueprints into a production
environment. At this stage, the system will be
programmed into three large sub-menus are users,
managers, and administrators. Where each sub menu
has different access.
The programming language that used in this
research is Hypertext Preprocessor (PHP) because
the PHP is have speed and easy to used by
programmer (Botwe and Davis, 2015). To access the
database, the system is programmed by SQL to
manage the query to retrieve the data from database.
This programming process becomes a bridge
between Google Maps API which is a means of
connecting the program with databases and satellite
imagery from Google. The data retrieval is used the
AJAX method to be more interactive design. AJAX
allows the partial page updates which improves the
efficiency of the information system (Khanna and
Mistry, 2012)
To calculate and measuring the distance of two
point is uses the haversine algorithm. The Haversine
algorithm is used to calculate the lengths of two
points on the surface of the earth based on latitude
and longitude (Chopde and Nichat, 2013). The
latitude and longitude obtained from the query of
SQL that execute from the database.
Equation 1 is the formula used to calculate the
distance of two point. The information of the
equation 1 is as follows:
d = distance
r = radius of the earth
arcsin = inverse sinus
sin = sinus
latt = latitude
cos = cosinus
long = longitude
In equation 1 of the haversine formula, we can
turn it into a function that can calculate the distance
between the coordinates that can seen in this code.
FunctionHaversineDt(lat1,long1,lat2,lon
g2){
Diameter=2*6372,8;
var dx,dy,dz;
ph1=degtorad(long1-long2);
th1=degtorad(lat1);
th2=degtorad(lat2);
dz=sin(lat1) –sn(lat2);
dx=cos(long1)*cos(lat1) –cos(lat2);
dy=sin(long1)*cos(lat1);
result=arcsin(sqrt(sqr(dx)+sqr(dy)+s
qr(dz))/2)*diameter;
}
2.4 Integration and System Testing
The system testing phase is performed by Web
experts, GIS experts and system users covering
interface mapping, information, and technic aspects.
Testing on the mapping interface aspect is aimed at
knowing the software quality assurance in the
geographic field shown in the map field. While
testing on the aspect of information is intended to
provide evaluation and assessment of information
provided by the system to the user. In addition, the
testing on the technic aspect is aimed to testing the
critical elements in systems that directly relate to
programming techniques, algorithm usage, data
security, and programming efficiency as well as the
resulting of system.
The testing instrument on this research is using
questionnaire to find out the validity of GIS. The
questions posed to web experts are reviewed in
terms of interface and usability aspects using 9
questions. The questions posed to Web experts are
reviewed in terms of interface, information and
technic aspects with 8 questions. And the questions
posed to users are reviewed in terms of interface,
information and technic quality aspects using 13
questions.
In addition, the testing with black-box is to test
the function of the entire system was created. And
after the system is not have a problems during this
test, it will be the next process of operation and
maintenance.
2.arcsin

∆
2
cos
1
cos
2

∆
2

1
Implementation of Google Maps API 3 with Haversine Algorithm in the Development of Geographic Information System Boarding House
Finder
229
2.5 Operation and Maintenance
The last process in this research is operation and
maintenance. It is the launch and maintenance of
systems that have been made. System maintenance
is also included in the management and software
revisions that are likely to occur in the future. In
addition, the admin will also be a traffic monitor as
well as transaction processing performed within the
system.
3 RESULT AND DISCUSSION
3.1 Result
The result of this research is can be seen in
Figure 3 to Figure 4. In Figure 3, the Google Maps
API showed the marker on the field mapping. Data
has been processed based on the position of latitude
and longitude on the database system. Data
processing does not require the all refreshing of the
page because the data retrieval is used AJAX
method.
The result of distance analyses of haversine
algorithm can be seen in Figure 4. Function that
have been made before can be used and called to
calculate the distance. The distance analysis is
carried out on boarding house location with several
recognizable points.
The Haversine formula gives the most accurate
result and the error rate is very small, which is
negligible. The survey of the above experiment is
shown in the Table 3.
Based of the experiment, the error rate on the
Table 4 is the difference from actual distance and
calculated distance that have been calculated with
the haversine algorithm. The actual distance
obtained by measuring the 2 point of latitude and
longitude on the Google Maps. The Google maps
have a facilities that can be calculated the distance
between two points. The result of error rate
comparison based on Table 4 is 2-6 meter.
Figure 3: Search Result View.
EIC 2018 - The 7th Engineering International Conference (EIC), Engineering International Conference on Education, Concept and
Application on Green Technology
230
Figure 4: Result of Distance Analysis on Haversine Algorithm.
Table 3: Experiment Calculated Radius Distance with Haversine Algorithm.
Recognizable points Latitude Longitude Boarding House Sample Latitude Longitude Distance
Faculty of Social
Science
-7.050518 110.393586
Sample 1 -7.045607 110.394436 488 m
Sample 2 -7.053100 110.397661 440 m
Sample 3 -7.053534 110.399063 534 m
Faculty of Law -7.050771 110.397840
Sample 1 -7.045607 110.394436 686 m
Sample 2 -7.053100 110.397661 260 m
Sample 3 -7.053534 110.399063 336 m
Faculty of
Engineering
-7.049203 110.396964
Sample 1 -7.045607 110.394436 1.074 m
Sample 2 -7.053100 110.397661 495 m
Sample 3 -7.053534 110.399063 373 m
Faculty of Education
-7.048162 110.396862
Sample 1 -7.045607 110.394436 390 m
Sample 2 -7.053100 110.397661 556 m
Sample 3 -7.053534 110.399063 645 m
Table 4: Comparison Radius Distance with Google Maps Actual Distance.
Experiments Recognizable points
Boarding House
Sample
Actual
Distance
Calculated
Distance
Error Rate
1 Faculty of Engineering Sample 1
1.070 m
1.074 m 4 m
2 Faculty of Education Sample 3
639 m
645 m 6 m
3 Faculty of Law Sample 2 255 m
260 m 5 m
4 Faculty of Social Science Sample 1 486 m
488 m 2 m
The system testing phase is performed by Web
experts, GIS experts and system users. The first
testing about this system was carried out by web
expert that experienced on web development or web
programmer. In this phase that performed by 2 web
experts by obtaining the score of 100 with the
percentage of eligibility is 92.59%. So that entry in
the category is very feasible. This testing is
highlighted to test the system about the information
and technic aspects.
The next testing was carried out by GIS experts
that experienced in mapping area. In this test,
performed by 2 GIS experts by obtaining the score
of 57 with the percentage of eligibility is 89.06% so
that entry in the category is very feasible. GIS
Expert is more highlighted to test on aspects of
geographic and information display.
The users testing was carried out by 15
respondents that various regions from outside the
city. The scores obtained from user testing are 731
Implementation of Google Maps API 3 with Haversine Algorithm in the Development of Geographic Information System Boarding House
Finder
231
with a percentage of 93.72%. So that the feasibility
of web-based is entry into the category is very
feasible. The testing on users is to obtain evaluation
and assessment of information and interface aspects.
In addition, the testing with black-box is to test
the function of the entire system was created. Black-
box testing results show that the functional
application does not have an errors and in
accordance with the expected results with the
acquisition of 100% valid test. Black-box testing is
use to test the interface and technical function of 63
units.
3.2 Discussion
The development of information systems in the
geographical field has been widely carried out. In
this study, researchers compared information
systems created with previous studies that had
already been conducted developing a web-based
information system boarding house finder.
In previous studies, geographic information
systems boarding house finder were developed by
utilizing Google Maps API and success to show the
marking map (Mustika, 2017). Similar research have
been carried out using codeigniter framework and
Google Maps API to develop an application of
geographic information systems (GIS) for a web-
based help migrants in the city of Yogyakarta in the
process of finding and booking boarding houses
according to their needs, and help homeowners
boarding house boarding in marketing online
(Pratikto et all., 2014).
In addition, a web-based boarding house and
rented house information system has been developed
with PIECES analysis. But the system developed has
not been carried out geographically by utilizing the
Google Maps API facility (Gunawan and
Racmatullah, 2016). The SMS Gateway is also used
in the development of information systems for
boarding houses using PHP and MySQL. The study
did not use the AJAX method as the data collection
(Sundari and Komarudin, 2015).
Based on previous research, the system still has
some disadvantages. One of them is that there is no
analysis of the distance from the boarding house to a
particular place. In addition, the system developed
does not have an interactive display. In this research,
the system will be develop with implementation of
haversine algorithm to analyse the distance of the
boarding house from particular place that user
needed. The system also utilizes the AJAX data
retrieval feature to produce a more interactive web
display.
4 CONCLUSIONS
The paper has presented design and development of
Geographic Information System to find the boarding
house with waterfall model. This research was
implemented the Google Maps API 3 to embed
Google Maps site and showed the satellite imagery
from Google. To calculated the lengths of two points
on the surface of the earth based on haversine
algorithm. With haversine algorithm, the system can
be analysed the distance of two points of
coordinates. The system has many facilities to filter
the data of boarding house according to the user
wishes. AJAX was used to optimizing the taking
data to be more interactive.
REFERENCES
Anamisa, D.R., Rachmad, A. & Widiastutik, R., 2016.
‘Selection System Of The Boarding House Based On
Fuzzy Multi Attribute Decision Making Method’,
Journal of Theoretical and Applied Information
Technology, Vol. 92, No. 1, p. 52.
Bhat, M.A., Shah, R.M. & Ahmad, B., 2011. ‘Cloud
Computing: A solution to Geographical Information
Systems (GIS)’, International Journal on Computer
Science and Engineering, Vol. 3 No. 2, pp. 594-600.
Botwe, D.A. & Davis, J.G., 2015. ‘A Comparative Study
of Web Development Technologies Using Open
Source and Proprietary Software’, International
Journal of Computer Science and Mobile Computing,
Vol. 4, No. 2, pp. 154-165.
Chopde, N.R. & Nichat, M., 2013. ‘Landmark Based
Shortest Path Detection by Using A* and Haversine
Formula’, International Journal of Innovative
Research in Computer and Communication
Engineering, Vol. 1, No. 2, pp. 298-302.
Essayad, A., 2011. ‘Design and Implementation of a
Platform for Location Based Services : a Case Study
of GIS of Archaeological and Handicraft of Fez
Medina’, International Journal of Computer Science
Issues, Vol. 8, Issue. 5, No. 3, pp. 524-530.
Ganesh, L. & Vijaya, K., 2015. ‘Indoor Wireless
Localization using Haversine Formula’, International
Advanced Research Journal in Science, Engineering
and Technology,Vol. 2, No. 7, pp. 59-63.
Garude, M. & Haldikar, N., 2014. ‘Real Time Position
Tracking System using Google Maps’, International
Journal of Scientific and Research Publications, Vol.
4, No. 9, pp. 357-360.
Gommans, H.P., Njiru, G.M. & Owange, A.N., 2014.
‘Rental House Management System’, International
Journal of Scientific and Research Publications, Vol.
4, No. 11, pp. 1-24.
Gunawan, D. & Racmatullah, R., 2016. ‘Sistem Informasi
Sewa Rumah Kost dan Rumah Kontrakan Berbasis
EIC 2018 - The 7th Engineering International Conference (EIC), Engineering International Conference on Education, Concept and
Application on Green Technology
232
Web di Surakarta’, Jurnal Go Infotech, Vol. 22, No. 1,
pp. 31-36.
Helshani, L., 2015. ‘An Android Application for Google
Map Navigation System, Solving the Travelling
Salesman Problem, Optimization throught Genetic
Algorithm’, in Proceedings of FIKUSZ Symposium
for Young Researchers, Óbuda University Keleti
Károly Faculty of Economics, pp. 89-101.
Ibrahim, R. & Yen, S.Y., 2011. ‘A Formal Model for Data
Flow Diagram Rules’, ARPN Journal of Systems and
Software, Vol. 1, No. 2, pp. 60-69.
Ichsan, M. & Syah, M. R., 2014. ‘Development Model
Fuzzy Multiple Attribute Decision Making (FMADM)
for Management Jobs’, Journal of Informatic
Engineering Syiah Kuala University, Vol. 10, No 2,
2014, pp. 1-19.
Khanna, S. V. O. & Mistry, M., 2012. ‘Impact of AJAX in
Web Applications’, International Journal of Advanced
Engineering Technology, Vol. 3, No. 1, pp. 144-145.
Kushwaha, A. and Kushwaha, V., 2011. ‘Location Based
Services using Android Mobile Operating System’,
International Journal of Advances in Engineering &
Technology, Vol. 1, Issue 1, pp.14-20.
Munassar, N.M.A. & Govardhan, A., 2010. ‘A
Comparison Between Five Models of Software
Engineering’, International Journal of Computer
Science Issues (IJCSI), Vol. 7, No. 5, pp. 94 – 101.
Mustika, E., 2017. ‘Sistem Informasi Pencarian Tempat
Kos Berbasis Geografis di Bandar Lampung’, Jurnal
Cendikia, Vol.14, No.1, pp. 13-18.
Ponce-Medellin, R., Gonzalez-Serna, G., Vargas, R. &
Ruiz, L., 2009. ‘Technology Integration around the
Geographic Information: A State of the Art’,
International Journal of Computer Science Issues,
Vol. 5, pp.17-26.
Pratikto, H.S., Suraya & Sutanta, E., 2014. ‘Sistem
Pencarian dan Pemesanan Rumah Kos Menggunakan
Sistem Informasi Geografi (SIG)’, Jurnal Script, Vol.
1, No. 2, pp. 110-119.
Reyes II, P.P., 2016. ‘Profile Of Boarding Houses Of
Students Of The Kalingaapayao State College’,
International Journal of Advanced Research in
Management and Social Sciences, Vol. 5, No. 6, pp.1-
14.
Sachdeva, R.K. & Singh, S., 2013. ‘Use of AJAX to
Improve Usability of Online Information Systems’,
Global Journal of Computer Science and Technology
Software & Data Engineering, Vol 13, No. 8, pp. 13-
14.
Setyarsih, E., 2017. ‘Fenomena Makelar Kost dalam Sudut
Pandang Sosio Ekonomi Ditinjau dari Teori
Pertukaran Peter Michael Blau’, Jurnal Analisa
Sosiologi, Vol. 6, No. 2, pp. 76-90.
Sharma, M. & Morwal, S., 2015. ‘Location Tracking using
Google Geolocation API’, International Journal of
Science Technology & Engineering, Vol. 1, No. 11,
pp. 29-32.
Sneha, K. A. & Khatwar, D. M., 2015. ‘Evolving Web
Applications with AJAX - A Review’, International
Journal of Innovative Research in Science,
Engineering and Technology, Vol. 4, No. 11, pp.
11087-11093.
Sulaiman, A., Arifin, S.P. & Wibowo, A., 2012. ‘Boarding
Home Finder Menggunakan Algoritma Pencarian
MPE Berbasis PHP Codeigniter 2.0 Framework dan
AJAX’, Jurnal Aksara Komputer Terapan, Vol. 1 ,
No. 1.
Sundari, S.S. & Komarudin, I., 2015. ‘Perancangan Sistem
Informasi Rumah Kost Berbasis Web dan Short
Message Service (SMS) Menggunakan PHP dan
MySQL’, in Seminar Nasional Informatika (SNIf),
Vol. 1, No. 1, pp. 333-337.
Suri, P. & Sharma, M., 2011. ‘A Comparative Study
Between The Performance Of Relational & Object
Oriented Database in Data Warehousing’,
International Journal of Database Management
Systems, Vol.3, No.2, pp. 116-127.
Implementation of Google Maps API 3 with Haversine Algorithm in the Development of Geographic Information System Boarding House
Finder
233