.. _ogrs2009_lab: OGRS 2009 - State of the art of the creation of GIS rich internet application ***************************************************************************** This document provides information necessary to follow the lab provided during `OGR 2009 `_. Here is the :download:`associated presentation `.eric General information =================== * Link to Studio instance: `Instance 1 `_ * Detailed studio documentation: :ref:`work_with_studio` Lab 1: Create a WMS Service =========================== * Create your own account with the register function * Login in Studio with this new account * In the MapFiles tab, create your own Mapfile * Add the layer "countries" (data :download:`countries.zip ` were uploaded previously through the "data" tab) * Define your own symbology * When it's ready, you can come back to the MapFile list and download the MapFile generated by Studio Check the WMS Service --------------------- .. note:: Studio takes care of the management of the OGC Webservices. So, this step is only done for the purpose of this lab. The name of the mapfile indicates the path where it is stored on the server. You have to replace the "_" by "/" in order to know the correct path: * Example of MapFile name: _var_www_studio_private_studio_Studio_data_mapfiles_RTnEfxcc.map * Corresponding path: /var/www/studio/private/studio/Studio/data/mapfiles/RTnEfxcc.map With this information, you can check your newly created WMS by calling the GetCapabilities request: http://ec2-79-125-52-245.eu-west-1.compute.amazonaws.com/cgi-bin/mapserv?map=/var/www/studio/private/studio/Studio/data/mapfiles/RTnEfxcc.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities or view-source:http://ec2-79-125-52-245.eu-west-1.compute.amazonaws.com/cgi-bin/mapserv?map=/var/www/studio/private/studio/Studio/data/mapfiles/RTnEfxcc.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities And, of course, you can use the GetMap request: http://ec2-79-125-52-245.eu-west-1.compute.amazonaws.com/cgi-bin/mapserv?map=/var/www/studio/private/studio/Studio/data/mapfiles/RTnEfxcc.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=countries&STYLES=&SRS=EPSG:4326&BBOX=-10,30,20,60&WIDTH=400&HEIGHT=300&FORMAT=image/png Lab 2: Create a Map Viewer ========================== Use your favourite text editor to create an :download:`HTML page `: .. code-block:: html
You can adapt the WMS path to your newly created WMS server (for example: http://ec2-79-125-52-245.eu-west-1.compute.amazonaws.com/cgi-bin/mapserv?map=/var/www/studio/private/studio/Studio/data/mapfiles/RTnEfxcc.map): Using a WMS layer implies several query to MapServer per Zoom or Pan. This is not particularly performant. We recommend to use a pure tilecache layer (OpenLayers.Layer.TileCache), with pregenerated tiles. In this lab, you have seen three ways of getting maps: * from a WMS server * from a Tilecache server. The tilecache server is able to understand a WMS query and to transfer the tiles * from a pregenerated tile repository Lab 3: Create a MapFish application =================================== In the "MapFish" tab of Studio, you can create a new MapFish applications with the following settings: * Configure layer by adding the countries layer and a remote WMS layer * Configure the data source to provide a tooltip on a countries layer * Configure the print module * ... and start the server to see your newly created MapFish You can observe with Firebug the client server communication (for a tooltip, for example). You will see the MapFish REST protocol in action. It is also possible to have a look at file mapfish.js which contains the generated Javascript code. You can download it from the MapFish list. Lab 4: Test OpenScales capabilities =================================== `OpenScales demonstration `_ The source code can be found here: `OpenScales source code `_