-
Notifications
You must be signed in to change notification settings - Fork 0
/
Documentation.tex
143 lines (112 loc) · 5.13 KB
/
Documentation.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
\documentclass[12pt,titlepage]{article}
\usepackage[utf8]{inputenc}
\usepackage{a4wide}
\usepackage{graphicx}
\usepackage[british]{babel}
\usepackage{multicol}
\title{Project Documentation}
\author{Bačinská, Koutský, Němec}
\begin{document}
\begin{titlepage}
\begin{center}
\textsc{\LARGE PA193 Project Documentation}\\[0.6cm]
\textsc{\Large GPS Parser}\\[1cm]
\begin{multicols}{3}
\Large{Lenka Bačinská}\\[1cm]
\columnbreak
\Large{Ondřej Koutský}\\[1cm]
\columnbreak
\Large{Lukáš Němec}\\[1cm]
\end{multicols}
\bigskip
\bigskip
\Large{1.12. 2013}
\end{center}
\end{titlepage}
\tableofcontents
\newpage
\section{Introduction}
Main goal of project it to program parser for GPS coordinates in human readable form.
Various formats are supported, as described later. Program accepts two ways of input. These are
command line input and input from file. Processed coordinates are visualised in form of dots in
SVG image.
\section{Input}
\subsection{Input source}
As said before, two possibilities of input are supported. These are distinguished by command line
parameter to program. when parameter is present, then it is considered as path to file with input
and program tries to open file with given filepath. Other option is to run program without parameter
and then program accepts command line input. In this mode, every input is considered to be coordinate
and is procesed this way. To end input from command line enter \textit{quit}.
Program supposes every new coordinate on new line, multiple coordinates on one line are not
supported.
\subsection{Coordinates formats}
There are 18 different supported formats. Commonly used $\circ$ is substituted with \textbf{D},
because degree symbol isn't part of 8-bit ASCII table, only the extended one. This could problems
with flaweless operation of program on different platforms, so we decided to use capital letter D
instead.
Formats are:
\begin{itemize}
\item{dd:mm:ss[NS] ddd:mm:ss[WE] }
\item{dd:mm.mmmmm[NS] ddd:mm.mmmmm[WE]}
\item{ddDmm'ss"[NS] dddDmm'ss"[WE]}
\item{ddDmm.mmmmm'[NS] dddDmm.mmmmm'[WE]}
\item{dd.dddddd[NS] ddd.dddddd[WE]}
\item{dd.ddddddD[NS] ddd.ddddddD[WE]}
\item{(-)dd:mm:ss (-)ddd:mm:ss}
\item{(-)dd:mm.mmmmm (-)ddd:mm.mmmmm}
\item{(-)ddDmm'ss" (-)dddDmm'ss"}
\item{(-)ddDmm.mmmmm' (-)dddDmm.mmmmm'}
\item{(-)dd.dddddd (-)ddd.dddddd}
\item{(-)dd.ddddddD (-)ddd.ddddddD}
\item{[NS]dd:mm:ss.sss [WE]ddd:mm:ss.sss}
\item{[NS]dd:mm.mmmmm [WE]ddd:mm.mmmmm}
\item{[NS]ddDmm'ss" [WE]dddDmm'ss"}
\item{[NS]ddDmm.mmmmm' [WE]dddDmm.mmmmm'}
\item{[NS]dd.dddddd [WE]ddd.dddddd}
\item{[NS]dd.ddddddD [WE]ddd.ddddddD}
\end{itemize}
\paragraph{whitespaces}
Each of these formats can be padded with any amount of spaces before and after.
Between longitude and latitude must be at least one space. No other whitespace characters are
supported and no whitespace characters are allowed inside of longitude or latitude declaration.
\paragraph{Coordinates dimensions}
In case of real numbers, any number of numerals behind
dot is supported, but only first six in case of degrees and first five in case of minutes are
counted in final result, since such precision if more than enough with current GPS systems.
Also there is required at least one numeral after comma, so 49.0D 16.0D is valid, but 49D 16D
is not. This applies to all similar formats.
\subparagraph{latitude}
Latitude cannot exceed $90\circ$ as it is considered as overflow, ad generally there isn't place
on earth with latitude greater than $90\circ$. Hemispheres of the Earth can be specified either with capital letters (\textbf{N} or \textbf{S}) or minus sign for south, as specified with each of the formats.
\subparagraph{longitude}
Longitude cannot exceed $180\circ$ for same reasons as latitude. And hemisperes can be specified
as previously, but different letters (\textbf{E} or \textbf{W}) or minus sign for east.
\subsection{Coordinates examples}
\begin{itemize}
\item{49:12:34N 016:36:00E }
\item{49:12.577N 16:36.006E}
\item{49D12'34"N 16D36'00"E}
\item{49D12.577'N 16D36.00'E}
\item{49.21096N 16.59796E}
\item{49.21096DN 16.59796DE}
\item{49:12:34 016:36:00 }
\item{49:12.577 16:36.006}
\item{49D12'34" 16D36'00"}
\item{49D12.577' 16D36.00'}
\item{49.21096 16.59796}
\item{49.21096D 16.59796D}
\item{N49:12:34 E016:36:00 }
\item{N49:12.577 E16:36.006}
\item{N49D12'34" E16D36'00"}
\item{N49D12.577' E16D36.00'}
\item{N49.21096 E16.59796}
\item{N49.21096D E16.59796D}
\end{itemize}
\section{Output}
There are two output formats, one is SVG file, which contains dots representing coordinates on Earth surface.\footnote{Not all browsers display SVG file correctly, Google Chrome is recomended} Other output is just text which is produced after all coordinates are processed.
\section{Summary}
Whole project is quite large (about 5000 lines of code) which is caused by forbidden use of regular expresions. Thus pattern recognition to one
format from eighteen possible and the verifiacion of this format showed up to be quite complex task. We tried to use automata based programing
for this task, which caused code to be longer than normally would be expected. On the other hand, we hope that this solution will lead to more
secure way of input procesing.
\end{document}