Implementing MapServer As Web Map Service (WMS) Applications for Spatial Data Sharing and Interoperability Case Study at Center For Marine Resources Surveys, National Coordinating Agency For Surveys And Mapping (BAKOSURTANAL)




3. System / Tools

There are several tools to create web service from free into commercial software. On This paper, Mapserver is the best choice on building Web Map Services (WMS). MapServer is an open source development environment for building spatially-enabled internet applications. It can run as a CGI program or via Mapscript which supports several programming languages.

4. An Implementation of Spatial Data as WMS

Mapserver that used to develop WMS is mapserver for windows (MS4W) and it run as CGI Program. Step by step to create WMS is :

a) Setting up Mapserver

WMS requests are handled by the "mapserv" CGI program. MS4W support already for this program. To access WMS server user need to complete HTTP URL including the http:// prefix, hostname, scriptname, potentially a "map=" parameter, and and terminated by "?" or "&".

Here is a valid online resource URL:
http://pssdal.bakosurtanal.go.id/cgi-bin/mapserv.exe?map=kodt.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities


By creating a wrapper script on the server it is possible to hide the "map=" parameter from the URL and then your server's online resource URL could be something like:

http:// pssdal.bakosurtanal.go.id/cgi-bin/map?

b) Mapfile

Each instance of WMS server needs to have its own mapfile. It is just a regular MapServer mapfile in which some parameters and some metadata entries are mandatory. Most of the metadata is required in order to produce a valid GetCapabilites output. GetCapabilities return an XML document with metadata of the Web Map Server's information.

NAME WMS-KODT

STATUS ON
EXTENT 117.76 0.74 118.50 1.19
SIZE 400 300
SHAPEPATH "/spasial/data/50000/"
IMAGECOLOR 255 255 255
FONTSET "/ms4w/apps/pssdalweb/spasial/etc/fonts.txt"
SYMBOLSET "/ms4w/apps/pssdalweb/spasial/etc/symbols.sym"
UNITS dd
WEB
IMAGEPATH "/ms4w/tmp/ms_tmp/"
IMAGEURL "/ms_tmp/"
METADATA
"wms_title" "Kutai Timur" ##required
"wms_onlineresource" "http://pssdal.bakosurtanal.go.id/cgi-bin/mapserv.exe?map=kodt.map&request=GetCapabilities&"
"wms_srs" "epsg:4326"
"wms_feature_info_mime_type" "plain/text"
END
END
PROJECTION
"init=epsg:4326" ##required
END
#
# Start of layer definitions
#
LAYER # Hidrologi
NAME hidr
METADATA
"wms_title" "Hidrologi" ##required
"wms_feature_info_mime_type" "plain/text"
END
DATA "hidr/hidr11"
STATUS ON
TYPE POLYGON
PROJECTION
"init=epsg:4326"
END
CLASS
NAME "Keterangan"
COLOR 190 198 97
OUTLINECOLOR 0 0 0
END
END # Hidrologi
.....
......
LAYER # Dissolved Oxygen Kutai Timur
Group "Dissolved Oxygen"
NAME diox1
METADATA
"wms_title" "Dissolved Oxygen" ##required
"wms_feature_info_mime_type" "plain/text"
"queryable" "true"
"searchfield" "DO"
"fields" "DO:DO"
END
DATA "diox/diox1"
STATUS ON
TYPE POINT
CLASS
TEMPLATE "ttt_query.html"
SYMBOL 7
SIZE 5
COLOR 128 0 128
OUTLINECOLOR 128 0 128
END
END # Dissolved Oxygen Kutai Timur
END # Map File

c) Testing

Mapfile have to check the XML capabilities returned by server to make sure nothing is missing. Using a web browser, access into server's online resource URL to which you add the parameters "SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities" to the end, e.g.

http://pssdal.bakosurtanal.go.id/cgi-

bin/mapserv?map=diox.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities& This should return a document of MIME type application/vnd.ogc.wms_xml, browser is likely going to prompt to save the file. Save and open it in a text editor and returned XML from the WMS server. If get an error message in the XML output then take necessary actions. If everything went well, you should have a complete XML capabilities document. Testing with real client to access a new WMS server.

5. WMS Snapshot


XML capabilities returned by server


Testing WMS using Real Client (ArcGIS)


Testing WMS using Real Client (GIS Portal)

6. Conclusion and future work

With WMS specification, it has become easy to publish and share any geo-spatial information on the Internet. WMS, which is currently popular in actual applications, basically creates maps (PNG – Portable Network Graphics, or JPEG formats) of the requested area, which standard browsers can render. Thus, users do not have to copy huge data sets to local systems. Spatial data sharing doesn’t made on WMS feature yet. For future work need to implement Web Feature Service (WMS) that returnig Geographic Markup Language, WFS supplies users with the geographic features that satisfy their filtering criteria.

References

Feng Wang, Yunfei Shi, Xuguang Qin, Huan Zhang, Spatial Data Sharing And Interoperability Based On Web Spatial Data Service And GML, ISPRS Workshop on Updating Geo-spatial Databases with Imagery & The 5th ISPRS Workshop on DMGISs

ESRI, 2005, Spatial Data Standards and GIS Interoperability, An ESRI White Paper

Mapserver, Documentation of MapServer, http://mapserver.gis.umn.edu/

Jeff McKenna, 2006, WMS Servers with MapServer, www.dmsolutions.ca

Maged N. Kamel Boulos; Kiyoshi Honda, 2004,Web GIS in Practice: Publishing Your Health Maps and Connecting to Remote WMS Sources Using the Open Source UMN MapServer and DM Solutions MapLab, http://www.medscape.com/viewarticle/524924

Page 2 of 2
Previous