Technical summary WebGIS prototype exploration and practice hugos - crazy mouse
SUMMARY: This paper provides useful discussions on how to implement GIS electronic map browsing on the Internet, which proposes design ideas and methods, and finally completed a simple webgis prototype frame. Keywords: WebGIS GIS Electronic Map Java Applet CGI
1. Overview WebGIS is an emerging technology. Its main purpose is to facilitate the user's browsing, query and other conventional GIS functions for users without installing private client software. The Internet has developed a rapid development worldwide. With browser and HTTP servers, we can get a variety of information. But so far, there is no popular browser (including Internet Explorer and Netscape Navigator) to directly support the map and query features. However, through WebGIS can use the browser to browse and query online maps with the browser. This thesis uses map service components, CGI (public gateway interface) and Javaapplet technology to implement a webgis prototype frame. The development and operating environment of this frame is: operating system: Microsoft Windows2000 ServerHTTP server: Apache1.3.14 Win32 version CGI development tools: Visual C map service component development Tool: Visual C browser: Internet Explorer, Java2 Runtime EnvironmentApplet development tool: JDK1. 3.1
2. WebGIS Working principle WebGIS system structure block diagram is as follows:
The system workflow and principle are as follows: Internet User launches the browser to open the web page on the HTTP server. This web page contains Java Applet. Applets provide users with map operation functions and map display functions. Each time the user operates a map (including zooming, zooming, dragging), the applet will submit a request to the CGI on the server. After receiving the request, CGI automatically calls the map component. The map component automatically generates a JPG image file based on the parameters of the request. The CGI then sends the URL address of the image file to the Applet of the user. Applet The new map is displayed in your browser. This user can see the corresponding map view. In summary, three core components running in this system are map service components, CGI programs, and applets. The following sections will explain more detailed description of these three key components.
3. Map Service Components Design Map Service Components include two DLLs files: mapengine.dll and picengine.dll. They provide the following features respectively:
4. The main role of the CGI design CGI (Common Gateway InferFace program is to run, collect data sent by the client, and then generate the corresponding HTML page to the user-end browser based on the data. CGI is one of the methods used to realize dynamic pages for websites. In this system, the CGI main program is mycgi.cgi. The working principle of the program is as follows: 5. Applet Design This system has two Applets small programs consisting: japptoolsbar.class and jappmapaRea.class. Below are their structural descriptions form. Limited to the space, the implementation details of each method of Applets are not introduced.
JAppToolsBar members or methods described javax.swing.ButtonGroup RadioGroup1javax.swing.JRadioButton jRadioDragjavax.swing.JRadioButton jRadioZoomInjavax.swing.JRadioButton jRadioZoomOutjavax.swing.JRadioButton jRadioViewAll radio buttons for the user to select different operating mode maps: zoom, drag and full view in FIG cursor cursorZoomInCursor cursorZoomOutCursor cursorDrag cursor for setting JAppMapArea: zoom cursor, the cursor is narrow, the necessary Init reference drag the cursor initialization, the cursor is transferred to the layout setting InitComponent layout, add an event handler mapping function of jRadioViewAllMouseClicked JApplet mapJApplet JAppMapArea Make JAPPMAPAREA Display Full Figure JRADIOZOOMIMIMIMInStateChanged Setup Map The mode is "Zoom in" JRADIOZOOMOMOMOMOMOMOMOMOMOMOMOMOMOMOMOMOMOMOMOMOMOMOMOMOMOMOMINSTATECHANGED Setting the Map The operation mode is "Drag" JAPPMAPAREA Member or method Description Double Factor, Amount, X, Y view html file URLImage imageMap jpg file parameters String strJPG storage MyCGI.cgi returned to point jpg file String strHTML storage MyCGI.cgi output int W, H size int SelectedTools map map operation JApplet toolsbarJApplet reference JAppToolsBar of boolean MouseDown mark whether the mouse Press whether the Boolean mousedrag flag is dragging the first point of the Point OldPoint mouse Press the first point of the Point OldDrag mouse drag the first point rectangle OldRect mouse drag rectangular INIT makes the initialization work INitComponent Settings Layout, add event processing mapping functions Paint small program drawing function FormMouseDragg ed message handler formMouseReleased mouse to drag a mouse button release message handler formMousePressed the mouse button message handler zoomFromRect rectangular enlargement and reduction zoomFromPoint single point zoom view DPtoLP_XDPtoLP_Y zoomToViewAll full screen coordinates to map coordinates LPtoDP_XLPtoDP_Y FIG conversion map coordinates into screen coordinates ConnectTOSERVER Connect to the server, submits the 4 view parameters, requests the HTML data stream GetServeroutPut to resolve the JPG file path and the name in the HTML data stream (resolved 4 view parameters)
6. The system configuration and operational effect system need to do the following work: 1. Configure the APACHE server, set the CGI directory, allow the CGI program to be executed in this directory. In this system, this directory is the CGI-bin subdirectory in the directory where the home page is located. 2. Copy MaPENGINE.DLL and PICENGINE.DLL and mycgi.cgi programs to the CGI-bin subdirectory. 3. Copy a directory MAP in the home page, copy all the map project files to this directory. 4. Create a new HTML file to insert two applets into the file. Convert it with the HTMLCONVERTER tool included with JDK1.3.1. Copy the HTML file to the home page. The file name in this system is japphtml.html.5. Copy the two Applets of JAPPTOOLSBAR and JAPPMAPAREA to the home page. 6. So far, it has already been told. One thing to mention is that the user needs to install JRE, and if the user is not installed, the web page cannot be checked correctly. JRE can download from Sun's website. The operational renderings of this system are as follows: The effect map of the user seemed
After several enlarged rendering
7. Summary Of course, the concept, category and function of WebGIS itself are quite complicated. In fact, the system implemented in this paper uses "Simple Electronic Map Display System under Web" to call it very appropriate. Because it is the most original prototype of WebGIS, only the most basic features. However, this system provides a viable design idea and design method for the development of powerful WebGIS. As long as this idea is to achieve this idea, you should have a touch of yourself. In addition, it is necessary to specifically declare that there are still many defects in this system, without any practical value. I design this system for learning and practice. In fact, I want to understand the problem like this: How is WebGIS implemented? What are the technical support? What is its entire runtime process? If possible, can it apply its technology to the project? Of course, it's the advantage that it is not doubtful. I don't talk much here. Finally, I want to point out what is the most serious flaw of this system. The most serious defect is on the server side CGI program. Each time the user submits a request, the CGI program must perform a transfer of map engineering and close map engineering operations. This is very time consuming. Due to limited time, there is no time to improve. However, the solution has already been. That is great COM technology. Designing a Windows NT Service-based process COM server can completely solve this defect. I hope that I can solve this problem as soon as possible.