# An Efficient GNSS Coordinate Recognition Algorithm for Epidemic Management
## 3 System Architecture and Problem Description  
In this section, we introduce the system architecture and describe the PtInPy problem. Figure 1 presents the system architecture. We assume that each target has a mobile device with a GNSS receiver. The mobile device can receive GNSS signals, convert them into coordinate data, and send the data to database-based storage according to the transmission mechanism of a wired or wireless network. Therefore, the targets' real-time latitude and longitude coordinates are stored in a database. By using Structured Query Language (SQL), the latitude and longitude coordinates in the database and the queried data can be sent back to a computer. The data related to a specific geographical area are also stored in the computer. A geographical area is represented as a polygon. The computer performs the operation of coordinate recognition with the input of a geographical area \(P\) and can obtain the targets in the area \(P\). Under the demand of epidemic prevention, we want to know in real-time whether the targets are in a specific range or stay within the official designation. Therefore, we only need to define this range as a polygon. Then, using this polygon as input, our method can obtain the answer. A target \(g\) is a geographic point with latitude \(g_{,x}\) and longitude \(g_{,y}\) coordinates. A targeted area is a polygon. A polygon is composed of edges with geographical points. These edges enclose a measurable interior. Accordingly, a polygon \(P\) with \(n\) points is defined as \(P=\{p_{0},p_{1},\ldots,p_{n-1},p_{n}\}\), where \(p_{0}=p_{n}\), and the straight line segment from point \(p_{i}\) to \(p_{i+1}\) is the edge for \(i=0,1,\ldots,n-1\). A ray from a point is a straight line that starts from that point and goes on in any fixed direction. In this article, \(\mathit{ray}(g)\) is a horizontal extension segment starting from point \(g=(g_{x,},g_{y})\) and going to the point \((0,g_{y})\). If the number of intersections between the edges of polygon \(P\) and \(\mathit{ray}(g)\) is odd, this indicates that point \(g\) is an inner point of polygon \(P\). Otherwise, if the number is even, this indicates that point \(g\) is an outer point of polygon \(P\). For example, let \(P\) and \(P^{\prime}\) be two different polygons, with the space of \(P\) being much larger than the space of \(P^{\prime}\). There are three statuses of spatial overlap between polygons \(P\) and \(P^{\prime}\). The first status is that in which polygon \(P^{\prime}\) is an inner polygon of polygon \(P\). This means that the entire space of \(P^{\prime}\) is part of \(P\). This second status is that in which polygon \(P^{\prime}\) is a polygon intersecting with polygon \(P\). This means that a certain part of the space of \(P^{\prime}\) is part of the space of \(P\). The third status is that in which polygon \(P^{\prime}\) is an outer polygon of polygon \(P\). This means that no part of the space of \(P^{\prime}\) is part of the space of \(P\). If \(P^{\prime}\) is a polygon intersecting with \(P\), \(P^{\prime}\) has at least one edge that intersects with the edges of \(P\). If polygon \(P^{\prime}\) is an inner polygon of \(P\), it must satisfy the following two conditions. * For any point \(p\) of \(P^{\prime}\), \(p\) is an inner point of \(P\). * For each edge \(e\) of \(P^{\prime}\), edge \(e\) and all edges of \(P\) have no intersections. Figure 2 provides an example of a polygon with point and space statuses. This polygon \(P\) is composed of six points (\(p_{0},p_{1},\ldots,\) and \(p_{6}\)), where \(p_{0}=p_{6}\), and the straight line segment from point \(p_{i}\) to \(p_{i+1}\) is the edge for \(i=0,1,\ldots,5\). There are three geographic points (\(g_{0},g_{1}\), and \(g_{2}\)) with their corresponding rays (\(\mathit{ray}(g_{0})\), \(\mathit{ray}(g_{1})\), and \(\mathit{ray}(g_{2})\)). The number of intersections between \(\mathit{ray}(g_{0})\) and the edges of \(P\) is 1 (odd number), meaning that \(g_{0}\) is an inner point of \(P\).