The Study and Implementation of Mobile GPS Navigation System Based On Google Maps
The Study and Implementation of Mobile GPS Navigation System Based On Google Maps
The Study and Implementation of Mobile GPS Navigation System Based on Google
Maps
III. SYSTEM ANALYSIS AND DESIGN The processing flow diagram of map query module is
shown in Figure2.
A. System function design Start
The objective of this mobile navigation system is to
allow users to use cell phones to obtain constant, dynamic Input
bus lines or location information. The whole system function place name
work flow diagram is shown in Figure1.
The system contains the following modules: bus lines Input map size
query module, map query, local orientation, map zoom in or
out etc. Connect
The client IDE programming language and environment network
is MyEclipse 5.5.1, and Web server is Tomcat5.5. The
testing mobile is Nokia N73. Success?
Y
Login
Interface Query coordinate
Configure
Server Judge place
number 2
1
Generate Generate
Function URL URL
Choice
N
Bus Lines Map Local Connect
network
Query Query Orientation
Success? N
Lines Input AddressInput
Y
GPS
6HUYHU Network connection Acquire map
&RQQHFWLRQ Connection bit torrent
Network Acquiring
Acquiring Local coordinate Convert map
Connectio coordinate
n
Network
Acquire Acquire Connection Display map
Line data Map
out Zoom in
( map size)+1 in (Map size) -1
Lines Map zoom or out
Display ( in or out)
N
Error message
B. Map query module design Figure 2. The processing flow diagram of map query module
The processing steps of map query module are as follows:
(1) Input one or two address name (Chinese or English),
and select the initial maps size. C. Bus lines query module design
(2) Judge the query methods: single or two locations The processing steps of bus lines query module are as
inquires. follows:
(3) Convert the address name to the UTF8 format, and (1) Select query methods according to bus lines or
query its coordinates. station name.
(4) Combine the map page URL (2) Inputting inquiring conditions.
(5) Connect HTTP and acquire map page (3) Connect Web server according to the server address,
(6) Convert map page to image and load image on cell port setting, and service page information.
phones (4) Obtain relevant line information through query string.
(7) Browse the map and zoom in or out the map. (5) Send line information back to cell phone.
(6) Display line information
88
International Conference on Computer and Information Application(ICCIA 2010)
This function module requires the correct server setting, throw new Exception("Google Maps Exception: "
such as the server information, and tomcat WEB server is in + getGeocodeError(errorCode)); }
the start-up status. return new double[] { Double.parseDouble(data[2]),
The web server setting parameters are shown in Table I. Double.parseDouble(data[3]) };
}
TABLE I. SERVER SETTING PARAMETERS
B. Generating URL technology
Name Default Value Note
The following codes are specific solutions.
Server private String getGeocodeUrl(String address) {
192.168.1.100 Server IP address
address return "http://ditu.google.com/maps/geo?q="+
Server port 8080 HTTP Server port: 8080 urlEncode(address) + "&output=csv&key=" + apiKey;
}
/BQServlet/query the servlet URL in The
Server Page
.do web.xml file C. Data conversion technology in the process of HTTP
transmission
D. Local orientation module design
Due to the limit of mobile phones and J2ME setting, in
The processing steps of local orientation module are as
many cases, using special data types and patterns of
follows:
transmission is often needed. So we should realize the
(1) Select "local orientation" query function. function of data conversion: (1) the conversion from input
(2) System startup GPS (or A-GPS) function, and text characters to UTF8 format. (2) The conversion between
acquire highly, longitude, latitude of the location. characters streams and bit streams. (3) The conversion from
(3) Call the single address query function of the bit streams to map images.
“address query” module, and form the map page URL. The followings are specific solutions.
(4) Connect HTTP and acquire map page
• Conversion from text characters to UTF8 format
(5) Convert map page to image and load image on cell
phones The realization codes are as follows:
(6) Browse the map and zoom in or out the map. private static String urlEncode(String str)
{ StringBuffer buf = new StringBuffer();
IV. SYSTEM IMPLEMENT TECHNIQUES byte[] bytes = null;
The following is the implementation of map query try
module. {ByteArrayOutputStream bos = new
Firstly, we should register a Google Maps API secret key, ByteArrayOutputStream();
in this mobile navigation system, the registered key is: DataOutputStream dos = new
ABQIAAAAli- DataOutputStream(bos);
bcTq8jGCP7KoQ2ANSThSUaLh9GPAk0u374U4nx- dos.writeUTF(str);
kcR8j1VhSxfbQujJrCkn4D-oEbseE0ejlWBw. bytes = bos.toByteArray(); }
Then, we create a "map" object by programming and catch (IOException e) {}
make the map in the center based on a given geographic for (int i = 2; i < bytes.length; i++)
point and configure user interface. {byte b = bytes[i];
Lastly, initialize the map object. if (URL_UNRESERVED.indexOf(b) >= 0) {
Thus, our system can display the Google Maps. However, buf.append((char) b); }
the map cannot be zoomed in or out. Each map contains a else { buf.append('%').append(HEX[(b >> 4)
number of attributes that may be inspected or set. To carry & 0x0f]).append( HEX[b & 0x0f]); }}
out these functions, map-controls are added to increase the • The conversion from bit streams to map images
ability to control maps. In this system, we added the
/* one address query */
following control options: GLargeMapControl,
GOverviewMapControl and GScaleControl etc. public Image retrieveStaticImage(int width, int
Now we take the map query module as an example and height, double lat,
describe the key implementation technology. double lng, int zoom, String format) throws IOException
{/* lat variable denoting longitude ˈ the lng variable
A. coordinates acquire technology according to the denoting latitude */
inputting place name byte[] imageData = null;
The following codes are specific solutions. imageData = loadHttpFile(getMapUrl(width, height, lng,
public double[] geocodeAddress(String address) throws lat, zoom, format));
Exception { return Image.createImage(imageData, 0,
byte[] res = loadHttpFile(getGeocodeUrl(address)); imageData.length); }
String[] data = split(new String(res), ','); /* two addresses query */
if (!data[0].equals("200")) public Image retrieveStaticImage(int width, int
{int errorCode = Integer.parseInt(data[0]); height, double lat1,
89
International Conference on Computer and Information Application(ICCIA 2010)
double lng1, double lat2, double lng2, int zoom, [4] Meiyu Zhang , JingHua Mei , Design and Implementation for Mobile-
String format) based GIS Urban Information System, ISISE 2008:464-467
throws IOException { [5] He Li, Fan Jin-hong. Research and Implementation of Mobile
Navigation System Based on GPS and GIS, ICISE2009:507-510
byte[] imageData = null;
[6] Thurston, J., Poiker, T.K. and J. Patrick Moore. (2003). Integrated,
imageData = loadHttpFile(getMapUrl(width, Geospatial Technologies: A Guide to GPS, GIS, and Data Logging.
height, lng1, lat1, lng2, lat2, zoom, format)); Hoboken, New Jersey: Wiley
return Image.createImage(imageData, 0, [7] http://baike.baidu.com/view/7125.htm?fr=ala0_1_1 , 2010-06-09
imageData.length); [8] http://wiki.forum.nokia.com/index.php/Google_Maps_API_in_Java_
} ME#Get_your_own_Google_Maps_API_Key , 2010-3-30
A case of map query module is shown as Figure 3.
After inputting the first place and the second place, and
choosing the display map size, a path marked by the orange
line is displayed in the map page center.
V. CONCLUSION
By use of Google Maps API, this paper develops a
mobile navigation system realizing map query and local
orientation. This system can apply to the popular cell phones
supporting Java. The test results on Nokia N73 show the
navigation system solution is valid and feasible. However,
there are many issues to be further researched deeply, such
as the more efficient spatial query algorithm and the more
accurate map match etc.
ACKNOWLEDGMENT
This paper is supported by Beijing Student Research and
Innovation Program (1018).
REFERENCES
[1] http://www.gpsworld.com/gps/assisted-gps-a-low-infrastructure-
approach-734
[2] Google Corporation, Jan. 2009; “Map Basics,”
http://code.google.com/intl/en/apis/maps/documentation/
[3] Google Corporation, Jan. 2009; “Google Maps API,”
http://code.google.com/intl/en/apis/maps/.
90