chapter{Methodology}label{chap:met}In form because of the moving object in a

chapter{Methodology}label{chap:met}In this Chapter, we discussed the representation of the geographic data in a trajectory and we discussed the descriptions of libraries used to implement our methods.To assess the visualization and performance in this Thesis, we used a set of  GPS trajectory dataset collected in Microsoft Research Asia, in Geolife project, as shown in table
ef{tab:tabl} where each user is a directory containing a set of points representing a trajectory. Each point is a vector of coordinates system settings in form of latitude and longitude with the values recorded in decimal degrees unit because the degree decimal is more easily converted into UTM(Universal Transverse Mercator coordinate system) and they contain the date as well as time on which each coordinate was recorded to ease the analysis.The analysis of these users is made with respect to the most visited location by these users to see the similarities and relationships, in order to make recommendations for the future use or to improve services provided in that given particular location.We visualized all the geospatial data points on the map, exploring interactively the mobility of the users to facilitate the understanding process and the hypothesis formation as discussed in chapter
ef{chap:impl} and chapter
ef{chap:eval}. egin{center}egin{longtable}{c c c}caption{Dataset Unit Representation.} label{tab:tabl} \hline multicolumn{1}{|c|}{ extbf{Title}} & multicolumn{1}{c|}{ extbf{Units Representation}} \ hline endheadhlineendfoot Latitude  & decimal  \ Longitude & decimal \ Date String & dd-mm-yy \ Time String & hh:mm:ss\end{longtable}end{center}section{Geo-spatial representation}Stationary or moving object in a trajectory are represented geographically on the map as a finite sequences:egin{equation}label{eq10}T = (x_1, t_1), (x_2, t_2), … , (x_n, t_n)end{equation}Where, x = Data points or the coordinate vector for the user.\ with $x_i extless x_{i+1}$$(i = 1,2, … , n-1)$\ and\ t = timeIn formula
ef{eq10}, $x_1, …. x_n$ are represented in vector form because of the moving object in a trajectory, change it’s location at specific time threshold.so at every time second, $x$ has different values.Which means that all points, $x_i  epsilon  mathbb{R}^2 $ represents the approximated location of the object in 2-dimensional plane noted by latitude and longitude angular distances at a given time threshold $t_i $ When we analyse the structure of moving object in a trajectory, we get tremendous useful informations like existence of some interactions between bodies and properties of these interactions that can be very supportive in developing some new applications based on the analysis we discovered in the network and we can make some new assumptions prior to our analysis such as predicting the next location of a moving object or destination for our moving object or traffic jams ahead.With help of the rate of accidents recorded to a particular location, we can predict what is likely to happen in the coming time period and help to take some precautions (Eg: if it was found that more accidents happen at that particular location like Entertainment hall due to massive traffic in a particular month like end of December during the celebrations, more traffic police can be deployed to that particular location or take some other measures) etc..section{Software Analysis}subsection{Digital Globes}We used extbf{OpenStreetMap and leaflets}, They are free editable mapping services accessible from any device and provide interactive features to the user to customize the map and the ability to scale it up or down to their preferences and providing easy connections of data points on the road segments and real-time monitoring of the geo-data.  subsection{Map Depiction} extbf{Python} was used because it has high-level built-in data structures.There is no compilation step required in python which makes the editing and debugging test of the code much faster and more productive. Python has dynamic typing and dynamic binding which makes it more useful for fast application development and for connecting existing components with each other.  In this Thesis, Python was used for creating the server, converting the geographic dataset into a Jsonfootnote{Json – JavaScript Object Notation} and creating the animation of the user movement in time.Creating a server the following libraries were used:egin{itemize}item Socket.io: for fast real-time communication between server and web client. item SimmpleHTTPserver: for creating a simple HTTP server with GET and HEAD request handlers.item Socket Server : for establishing the connection between the web client and the server.end{itemize}Creating the animated trajectories of the users and statistical analysis, the following libraries were used:egin{itemize}item folium: to visualize the trajectories of the geospatial coordinates to the map.item matplotlib.pyplot : to plot the representations and analysis into a simple graph. item seaborn: is based on Matplotlib and was used for statistical visualization of the data.item Scipy: is based on NumPy and was used for scientific computation of operations during the analysis of the data.item Pandas: was used to read the geographic files stored in CSV format.end{itemize} extbf{JavaScript} libraries were used also to depict the trajectories on the web map application for visualizing and analyzing the geographic information in the trajectory.With the geospatial dataset stored in JSON format, is synchronized with the web client with help of the server and it’s values are retrieved in real-time by the JavaScript web application and visualized to the map accordingly.subsection{Network Design}In this section, we are going to emphasis on the communication between the client and the server.Defining the client as the web browser, and the server as a location where the data is kept, and the server share that stored data efficiently with the client on request.The client and server share the information through a network communication protocol. The connection between a client and a server is called network namefootnote{network name: is defined as a connect string used to establish a connection from the client to the server} and the server listens to the network name using some protocols like TCP or UDP and the server port number.For sharing the information between the client and the server, the server should be started, to make the server in a ready state to start listing to the coming requests from the client.The client uses connect stringfootnote{connect string: is a process the client uses to identify which server it should connect to} when connecting to the server and communicate with the server through the same protocol and the client should know the network listening namefootnote{network listening name: identifies the server in the network} of the server for a successful sharing of information between the client and the server.The client initiates the communication and sends a request to the server about the information it needs to retrieve, the server waiting for the request from the client, once it detects that request from the client, it acknowledge that request and transfer a stream of bytes to the client over a connection using TCP/IPfootnote{TCP: Transfer Control Protocol} protocol with a defined port number. The port number range from $”1024 to 65535″$, where the port number below $1023$ are reserved ports.The server closes the socketfootnote{socket: is a data connection path between terminals and it is always required at the client and the server sides}Eg: In this thesis, we have defined a port number to be 8221, so the whole URL link to connect to the server is $http:localhost:8221/$.HTTP:footnote{HTTP: HyperText Transfer Protocol} is the standard application protocol over the TCP/IP designed for communication between the client and server, defining how a message is transmitted and the response of the server with respect to the client request.In the Transport protocol, we choose TCP over UDP because TCP is a connection-oriented protocol which is more reliable and more secure and that provide features like the flow of data control, the acknowledgment of the request, the guarantee of the arrived message and the ability of error checking.Whereas, UDP does not provide these features to the user.