Memulai menggunakan MapServer|Getting Started with MapServer

Latar Belakang BackGround
Tugas Akhir saya terkait dengan GIS, lebih spesifik lagi mengenai bagaimana peta digital dapat digunakan melalui device mobile. Aplikasi GIS yang saya pakai pertama kali adalah ArcGIS, setelah itu baru saya mengenal MapObject dan menggunakan MapWindow untuk pemrogramannya di PC dengan bahasa pemrograman C#. Seperti yang kita ketahui, visual studio .Net membuat pemrograman menjadi lebih mudah, sehingga ketika memrogram menggunakan MapWindow tidak terlalu bermasalah.
Fitur-fitur di ArcGIS membuat saya mempunyai gambaran umum mengenai manipulasi data GIS, seperti query, labeling, symbology, geoprocessing, dsb. Sebagian fitur standard di ArcGIS pun menjadi standard saya bagaimana aplikasi GIS itu seharusnya berfungsi (standard yang cukup tinggi, bukan?!). Begitu juga aplikasi peta yang ingin saya buat pada Tugas Akhir saya.

My Final Task is related to GIS, specifically about how digital map can be used in mobile device. The first GIS application i used was ArcGIS, then i knew MapObject and use MapWindow for programming in PC using C# programming language. As we know, Visual Studio .Net makes programming become easier, so programming using MapWindow becomes easier too. ArcGIS features give me some overview about GIS data manipulation, like query, labeling, symbology, geoprocessing, etc. Some standard features in ArcGIS become the standard of GIS application in terms how it should be worked.

Aplikasi mobile tentu mempunyai berbagai keterbatasan, ya memory, ya interface. Oleh karena itu tidak mungkin saya membuat aplikasi standalone pada sebuah device mobile untuk turis, oleh karena itu saya pilih arsitektur client server, dimana banyak data dapat disimpan di server sehingga keterbatasan memori pada device mobile dapat diatasi. Dari sinilah saya mulai mencari engine apa yang memungkinkan implementasi arsitektur client server, yaitu MapServer.

Mobile applications have many constraints, both memory and interface. So i use client-server architecture to gain the external memory of mobile device. I try to explore GIS engine that allows client-server architecture implementation, it is MapServer.

Mengenal MapServer Knowing MapServer

Pertama mendengar kata mapServer, gambaran yang saya dapat adalah mudah digunakan dan user friendly dilihat dari tampilannya. Tapi ternyata membuatnya benar-benar hardcode. Struktur map server lebih kurang sebagai berikut:

Firstly i heard MapServer, i got overview that it’s easy to use and has a user friendly interface. But it’s really hardcode to make it (before i knew chameleon). MapServer structure can be seen as below:

Map
a.    Layer#1
                                                          i.      Class#1
1.    Style
2.    Lable
                                                      ii.      Class#2
1.    Style
2.    Label
b.    Layer#2
                                                          i.      Class#1
1.    Style
2.    Lable

File mapServer berekstensi .map, dan di dalamnya kita bisa mendefinisikan banyak layer sekaligus, dimana tiap layer peta dapat kita definisikan kelasnya, meliputi style(pewarnaan, tampilan), label (penampilan nilai atribut), dan lainnya. Data dari tiap layer yang berekstensi .shp (shapefile, ekstensi data GIS di ArcGIS) kemudian diubah menjadi gambar (.png) sebelum ditampilkan di halaman html.

Mapfile has .map extension, we can define many layers here. Each layer has classes, and each class has styles and labels. Format data in MapServer is shapefile. MapServer convert it into image before display it into html page.

Navigasi MapServer MapServer Navigation
Karena web-based, navigasinya pun terbatas, dan untuk membuat navigasi seperti aplikasi desain ataupun GIS yang desktop-based jauh berbeda. Biasanya panning dapat dilakukan dengan mudah dengan ‘menarik’ peta untuk menggeser tampilannya, begitu pula zooming bisa dilakukan dengan menyorot area mana yang ingin diperbesar. Dengan mapServer, untuk dapat melakukan hal ‘sederhana’ yang dengan mudah sudah tersedia pada aplikasi desktop (mudah karena sudah tersedia library yang dapat langsung kita gunakan), kita harus menyisipkan kode javascript yang cukup kompleks.

MapServer is web-based, the navigation is limited. We can easily doing panning in desktop application (just drag the map to the desired view). We can also easly zooming map in desktop application by making a rectangle using mouse gesture to zoom the map into rectangle’s size. It can’t be that easy in MapServer. It’s easy because in desktop application, MapWindow provides us some libraries. We can just use it. To do that simple task in MapServer, we may insert complex javascript codes.

Bagaimana MapServer Bekerja How MapServer Work

Jika Anda pernah download tutorial dari sini, berikut merupakan salah satu URL yang dapat menampilkan peta example1-1.map dengan menggunakan alamat berikut
If you have download the tutorial from here, you can see the examples by typing this url in your browser

http://localhost/cgi-bin/mapserv.exe?map=C:/Program Files/ms4w /Apache/htdocs/ms4w/apps/tutorial/htdocs/example1-1.map&layer=states&mode=map

URL tersebut terbagi menjadi tiga bagian:
This URL is divided into three parts:

1. http://localhost/cgi-bin/mapserv.exe?

Bagian ini memanggil program CGI MapServer.This part call MapServer CGI program.

2. map=C:/Program Files/ms4w /Apache/htdocs/ms4w/apps/tutorial/htdocs/example1-1.map&layer=states&mode=map

Bagian ini merupakan parameter CGI untuk mendeskripsikan query, tiap query dipisah dengan tanda ‘&’.This part is CGI parameters that describing query. Each query is separated by ‘&’.

a. variable ‘map’ diisi dengan direktori tempat file .map disimpan.a. parameter ‘map’ tells the MapServer CGI program what mapfile to process/parse by showing the map path.

b. variable layer diisi dengan nama layer yang ingin ditampilkan.b. parameter ‘layer’ tells mapserv.exe which layer will be displayed.

c. variable mode diisi dengan mode tampilan peta. Mode tampilan diantaranya ada dua, mode map dan mode browse.c. parameter ‘mode’ tells mapserver.exe what to do with the output from the mapfile. There are two modes of output mapfile, “map” mode and “browse” mode.

Mode Tampilan Peta pada MapServer Output Mode in MapServer
Mode menentukan output dari peta. Mode tampilan “map” akan menampilkan langsung peta ke browser (klien) tanpa membuat file gambar temporary di server. Mode tampilan “browse” akan mengubah peta menjadi file gambar temporary di server terlebih dahulu sebelum menampilkannya ke browser.

Mode define the output of the map. “map” mode will display the map directly into browser/client without creating any temporary data in server. “browse” mode will convert the map to temporary image that saved in the server before displaying it into browser.

Berikut tampilan peta menggunakan MapServer yang sejauh ini saya explore:

Here is the example of output map using “map” mode:

Saya sangat menghargai partisipasi Anda untuk berdiskusi atau share pengetahuan mengenai MapServer (karena saya masih termasuk newbi juga ^_^). Semoga bermanfaat :)

I really appreciate your participation to discuss or share knowledge about MapServer, because i’m still newbi in MapServer. Hopefully this short essay will be useful for us :)

51 thoughts on “Memulai menggunakan MapServer|Getting Started with MapServer

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>