Home

USER MANUAL - the Open Source Geospatial Laboratory at ETH

image

Contents

1. Publish Cancel Overview E x UI 85 0 9365 0 8912 Scale 1 304708 EX Render ia Figure 58 Publish to Web for point svmbolization As a result a new folder called Point is created inside the qgis map server directory as seen in Figure 59 44 QGIS Mapserver 7 Examples I wamp 2 ID Apache Bin cgi bin qqis map server ID Line i Point IC ggis_wrns ID conf 5 error icons OD lib IE logs IO modules ID logs C php ID war Figure 59 Folder structure for point symbolization Inside this folder the file called admin sld can be opened with any text editor It will be structured as follows lt StyledLayerDescriptor xmIns http www opengis net sld units mm gt lt UserLayer xmIns http www opengis net sld gt lt Name xmins http www opengis net sld gt Point lt Name gt lt Title xmins http www opengis net sld gt lt Title gt lt Abstract xmIns http www opengis net sld gt lt Abstract gt lt HostedVDS xmins http www opengis net sld providerType ogr uri D PointExample Point shp gt lt UserStyle xmIns http www opengis net sld gt lt Name xmins http www opengis net sld gt point lt Name gt lt FeatureTypeStyle xmIns http www opengis net sld gt lt Rule xmIns http www opengis net sld gt lt PointSymbolizer xmIns http www opengis net sld gt lt Graphic xmlns http www opengis net sld gt lt Mark
2. A dl HEE RREE Figure 42 Example of a Cartonet map CARTONET 2009 6 4 Map Bender MapBender is programmed in PHP and JavaScript and supports PostGIS and MySQL databases A great advantage of this client is the comprehensive documentation in a Wiki It also offers many tools as zooming or panning A further useful tool is the offering of authentication and authorization services The following link provides detailed information about the product http www mapbender org 29 QGIS Mapserver users Mapbender ea ie eb 5 Germanv topographv lowands lowmountain range 77 highland mi upland places mes places postcode areas f postcode areas railroad lines s f railroad rivers V rivers Digitize your location Figure 43 Example of aMapBender map MapBender 2009 6 Clients 30 QGIS Mapserver 7 Examples 7 Examples The following pages offer different examples of the creation of a web map for different data tvpes The used dataset is a generalized dataset which comprises of feature data countries that are derived from the CIA World DataBank Il and a satellite image by NASA Futhermore a simple point and line layer are used All data intermediate results and definitive results can be found in the ZIP folder complementing this User Manual If the data is used make sure to change the path in the HostedVDS tag to the directory that contains the data The general workflow fo
3. Reinhardt u a Handbuch Ingenieurgeod sie Raumbezogene Informationssysteme Herbert Wichmann Verlag H thig GmbH amp Co KG Heidelberg 2004 Styled Layer Descriptor Styled Layer Descriptor profile of the Web Map Service Implementation Specification OGC 05 07r4 2007 UMN Mapserver http mapserver org 01 05 2009 World Wide Web Consortium http www w3 org 15 05 2009 59 QGIS Mapserver 10 Appendix 10 Appendix Appendix A Example of the integration of an admin sld file in OpenLayers lt html xmIns http www w3 org 1999 xhtml gt lt head gt lt title gt test lt title gt lt style type text css gt map width 100 height 100 border 1px solid black div olControlMousePosition font family Verdana font size 0 9em background color white opacity 0 70 olControlScaleLine left 10px bottom 15px font size small background color white opacity 0 70 lt style gt lt script src map lib OpenLayers js gt lt script gt lt script type text javascript gt lt var map function init var options projection new OpenLayers Projection EPSG 21781 units m maxExtent new OpenLayers Bounds 420000 50000 890000 340000 maxResolution auto numZoomLevels 11 restrictedExtent new OpenLayers Bounds 450000 50000 880000 330000 i map new OpenLavers Map map options var kar wms5 new OpenLavers Laver WMS
4. a 0 Server il Path to QGIS WMS server directory D jfWorkSpacejwampjapache jegqi binjqqis map server Enter sudo password we BoBE gi Si WE Ell Service metadata Q Title r Q gt Enter layer and style information Abstract A Q Title ContactPerson Name Countries Q Contact e mail Abstract Style name countr Contact phone a y Server URL Layers Title Name Abstract Style name Countries country 4 gt Publish Cancel x Overview 81 38 3 155 1 Scale 1835425 Render is Figure 45 Publish to Web for polygon symbolization As a result a new folder called Countries is created inside the qgis_map_server directory as seen in Figure 46 IE wamp Apache2 CO bin 5 cgi bin CO qqis map server O Countries DO qgis_wms conf IO error IO icons D lib logs O modules i logs O php O www Figure 46 Folder structure for polygon symbolization Inside this folder the file called admin sld can be opened with any text editor It will be structured as follows lt StyledLayerDescriptor xmlns http www opengis net sld units mm gt lt UserLayer xmlns http www opengis net sld gt 33 QGIS Mapserver 7 Examples lt Name xmins http www opengis net sld sCountriesc Namer lt Title xmins http www opengis net sld gt lt Title gt lt Abstract xmIns http www opengi
5. 1 1 5 Stvled Laver Descriptor For the display of user defined styles the Styled Layer Descriptor SLD has to be used It is a XML standard extending the WMS Implementation Specification released by the OGC With it symbols and colours can be rendered as wished Therefore it allows a focus on cartographic claims In 2007 SLD was divided into Symbology Encoding SE and SLD profile Symbology Encoding is independent from service descriptions so it can also be used for user defined stvling with other svstems than services SLD profile is the remaining part where the appliance of SE onto WMS layers is described SE 2006 Further extensions to the SLD standards have been developed e g for the svmbolization of diagrams losifescu 2007 1 2 GIS Large amounts of data are most easily managed in databases Data is stored in tables which hold attributes of importance But how are geographical facts like the geometry or topology stored In case of geographical data there are databases called geodatabases which have special functions to store information so that it can be visualised in geographical information systems GIS A GIS is defined as a system which consists of hardware software and data In it all data with a relation to the earth s surface can be captured visualised managed analysed and manipulated Examples for such data are geological phenomena the vegetation or constructions such as buildings or bridges Reinhardt 2009 However
6. 2009 Please visit the official website at http www gnu org licenses gpl htmi for further information QGIS Mapserver 3 Installation of QGIS and QGIS Mapserver 31 Windows All packages are available under http 1 Prior to any installation of QGIS or QGIS mapserver a web server software has to be available or installed first A good and easy to use choice for windows is wampserver which already supports the karlinapp ethz ch use of Apache PHP and mySQL 2 Download the package qgis map server zip and unzip it to the directory of the cgi bin of your web server QGIS mapserver Home What is it Download Configuration Documentation Sample Requests Development Team Publications Links If the package is unpacked in the right directory the directory tree should look as follows i http www wampserver com en Download and Installation of QGIS mapserver From binaries QGIS map server for Windows new version qgis map server zip Download and unzip QGIS mapserver is t bin qgis map server Open Open in New Tab Open in New Window Save Target As Print Target QGIS map server f cartographic exter le with the official QGIS 0 9 pac http gisalaska com COPY Shortcut graphic extensions will not E Add to Favorites qgis mapserver ubu An vorhandene PDF Datei anf gen In Adobe PDF konvertieren Linkziel an vorhandene PDF Datei anh ngen Linkziel in Adobe PDF konv
7. a GIS is not simply a mapping program The main advantage of using a GIS and not a simple graphics program is the possibility to give a certain object a variety of attributes By selecting this object all attributes become visible Furthermore the ability to analyse and manipulate data exists The queries below can all be answered with GIS functionalitv e What river is longer than 100 km e How many buildings are closer to a lake than to a mountain e What city is built on a hill that is higher than 500 meters above sea level Adding to this data can be altered by applying a manipulation functionality Examples are listed below e Erase all regions that are smaller than 2 km e Create a buffer around all rivers It is apparent that GIS are not only used in classical surveying or cadastral tasks They are nowadays used in infrastructure or recycling offices geological agencies tourist informations and many more Examples for such geographical information systems are ArcGIS Geomedia or QGIS QGIS Mapserver 1 Basics 1 2 1 Data formats Geospatial data can be stored in two different wavs vector data or raster data Vector Data Vector data can be explained with various objects that fill an emptv space These objects can be points lines or polygons and can hold any number of attributes An example for the use of such a data structure is a dataset which contains the geometrical place of buildings Brovelli 2008 There are three bas
8. gt lt Name xmins http www opengis net sld gt Bild lt Name gt lt Title xmins http www opengis net sld gt lt Title gt lt Abstract xmIns http www opengis net sld gt lt Abstract gt lt HostedRDS xmins http www opengis net sld uri U Bild land_ocean_ice_8192 tif gt lt UserStyle xmIns http www opengis net sld gt lt Name xmins http www opengis net sld gt default lt Name gt lt UserStyle gt lt UserLayer gt lt StyledLayerDescriptor gt To view the symbolization of this file a WMS layer can be imported in QGIS To do that the admin sld file first has to be placed in the main qgis_ map server directory as explained in chapter 5 6 Editing an admin sld file Afterwards this layer can be opened in QGIS with the instructions of chapter 6 1 QGIS which leads to the following visualization of the style Figure 74 Extract of a WMS layer for raster symbolization For further styling options please refer to Appendix B Definition of symbolizing options where all implemented possibilities are listed 56 QGIS Mapserver 8 Index AQ MES IA se e 24 Filter ENCOCING ccccccssecccesseceeesceeeeeeeeeeeees 26 SUCUT Oe di l 24 SYMDOlIZERS An 25 WS CO UVC nee 24 EICH SAM A ME ee 27 CANO MCC nern 29 Map Bender sess eeeenenenzznnnnnnzzonrnnzenznranznzzonna 29 Open LAV EFS sass 28 GIS esterase ascii astuicatetheiseate N 27 Client server architecture ss ssessss
9. http www opengis net sld name stroke gt 000000 lt CssParameter gt lt CssParameter xmins http www opengis net sld name stroke width gt 1 lt CssParameter gt lt CssParameter xmIns http www opengis net sld name stroke dasharray gt 2 1 3 lt CssParameter gt lt Stroke gt The result can be viewed in QGIS after a reload of the layer Note To refresh the layer visualization move the layer with the panning tool in QGIS desktop version The outline strokes will change consequently Figure 48 Outline style polygon symbolization 7 1 3 Creation of a User defined Pattern in SVG A very useful functionality is the implementation of user defined patterns To do so the pattern has to be available in the Scalable Vector Graphics format SVG The easiest way to create such a pattern is the use of a graphics program such as Adobe Illustrator or Inkscape The graphic can be exported as a SVG File and opened in any text editor Inside the polygon symbolizer and the fill tag a new tag named lt pattern gt has to be created with the size of the SVG pattern Inside the tag lt pattern gt a new group lt g gt is implemented in which the SVG symbol is pasted from the text document The example below shows the structure the admin sld file should have after the editing lt PolygonSymbolizer xmIns http www opengis net sld gt lt Stroke xmIns http www opengis net sld gt lt CssParameter xmins http www opengis net s
10. lt HostedVDS xmins http www opengis net sld providerType ogr uri D LineExamples Line gt lt UserStyle xmIns http www opengis net sld gt lt Name xmins http www opengis net sld gt line lt Name gt lt FeatureTypeStyle xmIns http www opengis net sld gt lt Rule xmIns http www opengis net sld gt lt LineSymbolizer xmIns http www opengis net sld gt lt Stroke xmIns http www opengis net sld gt lt CssParameter xmins http www opengis net sld name stroke gt 79aee5 lt CssParameter gt lt CssParameter xmins http www opengis net sld name stroke width gt 10 lt CssParameter gt lt Stroke gt lt LineSymbolizer gt lt Rule gt lt FeatureTypeStyle gt lt UserStyle gt lt UserLayer gt lt StyledLayerDescriptor gt To view the symbolization of this file a WMS layer can be imported in QGIS To do that the admin sld file first has to be placed in the main qgis_map_server directory as explained in chapter 5 6 Editing an admin sld file Afterwards this layer can be opened in QGIS with the instructions of chapter 6 1 QGIS which leads to the following visualization of the stvle Figure 55 Extract of a WMS layer for line symbolization 7 2 2 Adaption of the Line cap If this visualization result does not turn out satisfactorv the style can directly be changed in the admin sld file The symbolization of the river is in a light blue color with square line caps
11. lt Title xmins http www opengis net sld gt lt Title gt lt Abstract xmIns http www opengis net sld gt lt Abstract gt lt HostedVDS xmIns http www opengis net sld providerType ogr uri D user geodata_eu eu_countries_them shp gt lt UserStyle xmIns http www opengis net sld gt lt Name xmins http www opengis net sld gt diagram lt Name gt lt FeatureTypeStyle xmIns http www opengis net sld gt lt Rule xmIns http www opengis net sld gt lt PolygonSymbolizer xmIns http www opengis net sld gt lt Stroke xmIns http www opengis net sld gt lt CssParameter xmins http www opengis net sld name stroke gt 000000 lt CssParameter gt lt CssParameter xmins http www opengis net sld name stroke width gt 0 lt CssParameter gt lt Stroke gt lt Fill xmIns http www opengis net sld gt lt CssParameter xmins http www opengis net sld name fill gt daffc9 lt CssParameter gt lt Fill gt lt PolygonSymbolizer gt lt Rule gt lt Rule xmIns http www opengis net sld gt lt DiagramSymbolizer xmIns http www opengis net sld gt lt Diagram xmIns http www opengis net sld gt lt WellKnownName xmins http www opengis net sld gt Pie lt WellKnownName gt lt Category xmins http www opengis net sld gt lt PropertyName xmlns http www opengis net ogc gt INDUSTRY lt PropertyName gt lt SvgParameter name fill gt ffba7e lt SvgParameter gt lt Category gt lt
12. synoptische karte http karlinapp ethz ch fcgi bin qgis map server webgisluzern qgis map serv fcgi2 transparent true format image png layers svnoptische Karte styles syn isBaseLaver false opacity 0 7 kar wms5 setVisibilitv true map addLaver kar wms5 var kar wms6 new OpenLavers Laver WMS synoptische kart2e http karlinapp ethz ch fcgi bin qgis map server webgisluzern qgis map serv fcgi2 transparent true format image png layers map2 styles sym isBaseLayer false opacity 0 7 kar wms6 setVisibilitv true map addLaver kar wms6 var layerswitch new OpenLayers Control LayerSwitcher ascending false map addControl layerswitch laverswitch maximizeControl var navtbar new OpenLayers Control NavToolbar position new OpenLayers Pixel 40 290 var nav new OpenLavers Control NavigationHistorv map addControl nav navtbar addControls nav next nav previous map addControl navtbar map addControl new OpenLayers Control MousePosition map addControl new OpenLayers Control KeyboardDefaults var vo size w 250 h 160 layers overview_wms 60 QGIS Mapserver mapOptions projection new OpenLayers Projection EPSG 21781 units m maxExtent new OpenLayers Bounds 420000 50000 890000 340000 numZoomLevels 1 map addControl new OpenLayers Control OverviewMap vo map zoomToMaxExtent map setCenter new OpenLayers
13. 20926 500 27902 001 General Svmbologv Metadata Labels Actions Attributes dia 4 ia d A Legend type Graduated Symbol Transparency 0 FF C ismi Classification field SERVICE v Mod Equal Int ode qual Interva oa w Number of classes 4 gt O Classify Delete class EN ce ol iR 0 001 6975 500 WI 6975 500 13951 000 nr gt W 13951 000 20926 500 K l Label N WK 20926 500 27902 001 2 Style Options Outline style Solid Line v Outline width 0 26 A E Fill color Fil style mmc v Save As Default Restore Default Style Load Style Save Style Help OK Apply Cancel Overview ex 8 75 3 151 6 Scale 1 835425 Qx Render E Figure 44 Layer properties for polygon symbolization With the plugin Publish to Web the SLD file is automatically generated as described in chapter 5 5 Data Publishing with QGIS Mapserver Absolutely required are the project name the path to the server directory and an appropriate name and style name for the published layer 32 QGIS Mapserver 7 Examples g uantum ul PTN nstapie truni ml X File Edit View Layer Settings Plugins Help ABASK e rn ba L iu NO SAM Layers ex y irrent proj b X x B eu countries them 3 0 001 6975 500 l q 6975 500 amp 13951 000 Project name Countries 13951 000 20926 500 20926 500 27902 001
14. 48 49 50 51 51 53 54 54 54 55 56 56 QGIS Mapserver 1 Basics 1 Basics 1 1 Web Mapping Web Mapping is as the name indicates a term for maps that are used over the internet Web maps offer options that extend the usual visualisation of the geographic reality of analogue maps With the possibility to enhance maps with further interactivity elements navigation and orientation tools and the combination of different media as sound visuals and movies maps are more easily interpreted Sieber 2009 Further advantages of web maps are the accessibility to the public and the augmented information content compared to analogue maps Although the visualisation is still the main part of a web map further functionalities are expected Moreover knowledge can be cross linked and generate new knowledge The actuality of a map is a further advantage of a web map compared to an analogue map which however comes along with expectations by the public of actuality correctness and reliability of the map Dickmann 2001 A possible classification of web maps could look as follows Web Maps Figure 1 Map types Kraak 2001 e Static maps are defined as maps that only show a map at one point in time e Dynamic maps are maps that show some kind of change be it in space or time e View only maps have no interactive approach For static maps this means that they consist of one single image Dynamic maps show the changing attribute with aid of an an
15. Gateway Interface which prepares the request for a geographical information system A Common Gateway Interface CGI is a server sided protocol used for the linking of a web server to another program It is an interface used for the subsequent processing of an html request that allows a called program to respond to it These programs can be programmed in different programming languages After the program handled the request the CGI translates its results in an HTML message and forwards it to the web server The web server receives the requested data in a readable format and displays the data in the client browser Dickmann 2001 As an example the following request can be interpreted http karlinapp ethz ch fcgi bin qgis wms dir europe qgis map serv fcgi7 SERVICE WMS amp REQUEST GetMap amp LAYERS hillshade cost amp STYLES default default amp BBOX 2164760 28423 2600000 4000000 amp FORMAT png amp WIDTH 500 amp HEIGHT 500 A variation of the CGI is a FastCGI The main advantage of a FCGI is the ability to process several requests with only one transport connection whereas a CGI exits an application process after responding to a request http www fastcgi com devkit doc fcgi spec html 01 05 2009 QGIS Mapserver 1 Basics The path points to the executable program qgis map serv fcgi via the HTTP protocol The successive terms after the and divided by amp define the parameters that have to be processed with the called program
16. layer and style information 6 Change the name and style name to memorable names They will be needed for further editing and have to be memorized If desired give the Layer a Title and an abstract 7 Click on ar 8 Click on _Publish After this procedure the plugin saves a folder with the project name to the path specified This should look as follows l E wamp E Apachez l E bin B cgi bin B C qqis map server HazardMap ggis_wms conf error 4 icons i lib I logs I modules IS logs l E php I woran Figure 34 Folder structure after the creation of amap Inside the newly created folder in this example it is the folder HazardMap the file called admin sld is saved Opening this file shows a SLD document which defines the representation of the lavers An example of such a document can be found in 7 Examples In chapter 5 6 Editing an admin sld file the structure of the admin sld file is explained The published data can now be made visible with aid of a WMS client A number of such clients is described in chapter 6 Clients If the style of the generated admin sld file is the way it should be published the admin sld file has to be copied into the q gis map server folder because only if the admin sld file is in this position of the folder structure it is published 23 QGIS Mapserver 5 Data Processing in QGIS 5 6 Editing an admin sid file 5 6 1 Structure A
17. line2468 gt lt line style fill url Unnamed_Pattern_1 stroke 445c72 stroke width 2 stroke opacity 1 xl 9 0443783 y1 2 396369 x2 1 5954781 y2 8 1631575 id line2470 gt lt g gt lt svg gt 10 Appendix 66
18. of Data in QGIS and chapter 5 4 3 Diagram Overlay The symbolization properties have the following values 49 QGIS Mapserver 7 Examples Quantum GIS 1 1 0 Unstable trunk ee x File Edit View Layer Settings Plugins Help J EG o4RBRC RP KEER ZUIO 0 M Layers EX eu L P rti LS o x B eu_countries them J Layer Properties General Symbology Metadata Labels Actions Attributes diagram overlay X Display diagrams Diagram type Pie chart Attributes OBJECTID Add attribute INDUSTRY SERVICE CONSTRUCTI AGRICULTUR FINANCIAL WHOLESALE Classification type linearly scaling OHPALY Os Bep E oF fi WW ES HI ii Classification attribute TOTALEMPL Scale linearly between 0 and the following attribute value diagram size find maximum Value 68169 Size 10 Size unit Millimeter v Restore Default Style Save As Default Load Style Save Style Help Cancel Overview ex Bl 84 3 151 7 scale 1 3028314 Render E Figure 65 Layer properties for diagram symbolization With the plugin Publish to Web the SLD file is automatically generated as described in chapter 5 5 Data Publishing with QGIS Mapserver Absolutely required are the project name the path to the server directory and an appropriate name and style name for the published layer 50 QGIS Mapserver 4 File Edit View Layer Settings Plugins Help JEUB SR RCP KEER LUADO 0 MW Layers ex 4 Publist Heng b tg x
19. password of your PostGIS database 5 Click on Test connect 6 A pop up window will explain whether the connection was successful or not If the connection failed please check your port database and host If it was successful click on ti 14 QGIS Mapserver 5 Data Processing in QGIS PostgreSQL Connections karlinapp Connect Mew Edit Remove Import options and shapefile list Use Default Geometry Column Name or specify here the gear X Use Default SRID or specify here 1 Primary Key Column Name gid Global Schema public File Name Feature Class Features 1B Relation Nami schema F Backupsiz009_03_07 Daten ETH Masteri MSc frojektarbejtiDatenikarton LuzerniKanton LuzermiDatemakExiina _ PY shp MULTIPOLPGON 136 GKRY YO PY public mnn att aeo jaa summer nik Add Remove Remove All Help OK Cancel Figure 18 Add Shapefiles to PostgreSQL 7 Inthe window Shapefile in PostGIS Import Tool click on ace 8 Choose the relevant shapefiles 9 Click on BA As a result all shapefiles have been added to the geodatabase with the chosen name on the chosen host To import data from that database do the following 10 Click on the button or on Layers gt Add a PostGIS Layer The following window will open PostgreSQL Connections Connect Mew Edit Delete Search options Help Add Close Figure 19 Add PostGIS Table 11 Click o
20. sld gt 0 lt Data gt lt Value xmins http www opengis net sld gt 0 lt Value gt lt InterpolationPoint gt 52 QGIS Mapserver lt InterpolationPoint xmIns http www opengis net sld gt lt Data xmIns http www opengis net sld gt 68169 lt Data gt lt Value xmins http www opengis net sld gt 10 lt Value gt lt InterpolationPoint gt lt Interpolate gt lt Size gt lt Diagram gt lt DiagramSymbolizer gt lt Rule gt lt FeatureTypeStyle gt lt UserStyle gt lt UserLayer gt lt StyledLayerDescriptor gt 7 5 2 Adaption of the Zoom Dependency of Diagram Size 7 Examples To view the symbolization of this file a WMS layer can be imported in QGIS To do that the admin sld file first has to be placed in the main qgis_map_server directory as explained in chapter 5 6 Editing an admin sld file Afterwards this layer can be opened in QGIS with the instructions of chapter 6 1 QGIS which leads to the following visualization of the style Figure 68 WMS layer for diagram symbolization If this visualization result does not turn out satisfactory the style can directly be changed in the admin sld file The visualization of the admin sld file now returns the diagrams but the size of the diagrams stays exactly the same independent of the zoom level To change this fact the following code can be inserted lt Diagram xmIns http www opengis net sld gt lt Scale gt lt M
21. 00 svg xmins http www w3 org 2000 svg xmins sodipodi http sodipodi sourceforge net DTD sodipodi 0 dtd xmins inkscape http www inkscape org namespaces inkscape version 1 1 id Layer_1 x 0px y 0px width 29 936px height 29 77px viewBox 0 0 29 936 29 77 style enable background new 0 0 29 936 29 77 xml space preserve sodipodi version 0 32 inkscape version 0 46 sodipodi docname Luzern_neu_Wasser svg inkscape output_extension org inkscape output svg inkscape gt lt metadata id metadata2475 gt lt rdf RDF gt lt cc Work rdf about gt lt dc format gt image svg xml lt dc format gt lt dc type rdf resource http purl org dc dcmitype Stilllmage gt lt cc Work gt lt rdf RDF gt lt metadata gt lt defs id defs2473 gt lt inkscape perspective sodipodi type inkscape persp3d inkscape vp_x 0 14 885 1 inkscape vp_y 0 1000 0 inkscape vp_z 29 936001 14 885 1 inkscape persp3d origin 14 968 9 9233335 1 id perspective2477 gt lt defs gt lt sodipodi namedview inkscape window height 968 inkscape window width 1280 inkscape pageshadow 2 inkscape pageopacity 0 0 guidetolerance 10 0 gridtolerance 10 0 objecttolerance 10 0 borderopacity 1 0 bordercolor 666666 pagecolor ffffff id base showgrid false inkscape zoom 21 94715 inkscape cx 4 6609352 inkscape cy 15 27984 inkscape window x 4 inkscape window y 4 inkscape current layer g2452 gt
22. 00ffff gt lt g gt lt svg gt lt SvgSymbol gt lt Mark gt lt Size xmIns http www opengis net sld gt 15 lt Size gt 48 QGIS Mapserver 7 Examples lt Graphic gt lt PointSymbolizer gt lt Rule gt lt FeatureTypeStyle gt lt UserStyle gt lt UserLayer gt lt StyledLayerDescriptor gt To insert a label for every point on the right of the point symbol the following lines have to be placed inside the rule element lt TextSymbolizer xmIns http www opengis net sld gt lt Label xmIns http www opengis net sld gt lt PropertyName xmlns http www opengis net sld gt PointExamp lt PropertyName gt lt Label gt lt LabelPlacement xmIns http www opengis net sld gt lt PointPlacement xmlns http www opengis net sld gt lt DisplacementX xmIns http www opengis net sld gt 30 lt DisplacementX gt lt PointPlacement gt lt LabelPlacement gt lt TextSymbolizer gt The following graphic will result thereafter Basel iii Zurich Lucerne Figure 64 Text symbolization For further styling options please refer to Appendix B Definition of symbolizing options where all implemented possibilities are listed 7 5 Diagram Symbolization 7 5 1 Creation of an admin sld file for Diagrams To demonstrate the symbolization possibilities of thematic data in diagrams the layer eu_countries is used The data is processed in QGIS desktop version as described in chapter 5 4 Preparation
23. 24 25 25 27 27 28 29 29 30 32 33 33 35 QGIS Mapserver Figure 48 Figure 49 Figure 50 Figure 51 Figure 52 Figure 53 Figure 54 Figure 55 Figure 56 Figure 57 Figure 58 Figure 59 Figure 60 Figure 61 Figure 62 Figure 63 Figure 64 Figure 65 Figure 66 Figure 67 Figure 68 Figure 69 Figure 70 Figure 71 Figure 72 Figure 73 Figure 74 Outline style polygon symbolization User defined pattern Creation of a pattern in Inkscape User defined pattern created in Inkscape Layer properties for line symbolization Publish to Web for line symbolization Folder structure for line symbolization Extract of a WMS layer for line symbolization Line cap in line symbolization Layer properties for point symbolization Publish to Web for point symbolization Folder structure for point symbolization Extract of a WMS layer for point symbolization Line cap in line symbolization Placing the SVG Symbol User defined symbolization Text symbolization Layer properties for diagram symbolization Publish to Web for diagram symbolization Folder structure for diagram symbolization WMS layer for diagram symbolization Diagram size before editing Diagram size after editing Layer properties for raster symbolization Publish to Web for raster symbolization Folder structure for raster svmbolization Extract of a WMS laver for raster svmbolization Table of Figures 36 3 3 38 40 41 41 42 43 43 44 45 46 46 47
24. A 4 ONG RAT AT T TAMERA 3 Publish to Web isa iu ta dekan dro iii ada 21 AG a ee 12 Add a PostGIS Layer L sseennennnenzznnenzennnnz 15 Change Coordinate Reference System 16 Diagram OVerlay aiana a a 20 Manage Plugins s ss sesenenenezennenzzznnsanzenenenensa 12 Preparation of Data ss sessseneneenzznnnenzznnni 16 Shapefile in PostGIS Import Too 13 Starting QGIS Desktop Version eesneseeseeseeen 12 Symbolization of Data ss eennnnenenzzna 18 QAGIS Mapse Vet iii niekes jaq nee 7 Raster Data nun 6 Static Ma D een 2 Styled Layer Descriptor5 24 33 36 38 42 45 48 49 52 53 56 Vector Data i ga a i e a 6 VIEWS oniy MaD iii i a taa 2 Web Map Service xi ika ae i R 3 Web Mappe ii pi a aa 2 57 QGIS Mapserver 9 Bibliographv 9 Bibliographv Brovelli 2008 CARTO 2009 CARTONET 2009 Chameleon 2009 Cartouche 2009 Dickmann 2001 FCGI 2009 FE 2005 GNU 2009 Hugentobler et al 2009 losifescu 2007 Karlinapp 2009 Kraak 2001 MapBender 2009 Brovelli Maria http www gis ethz ch teaching lecture gis3 script GIS3lessoni pdf 01 05 2009 Carto http www carto net 01 05 2009 CartoNet Example http www carto net schnabel europe 01 05 2009 Chameleon http chameleon maptools org 01 05 2009 Cartouche http www ecartouche ch content_reg cartouche formats en html Client_lea rningObje
25. B eu countries them irrent pl x 6 Project name Diagrams Server Path to QGIS WMS server directory D f WorkSpacejwampjApache jeqi binjqqis map serverj Enter sudo password Service metadata 7 Examples OfPLLY Ys DOBE WESEL ii Title Enter laver and stvle information Abstract Title ContactPerson Nana Diagrams Contact e mail Abstract Contact phone Style name diagram Server URL Layers Title Name Abstract Style name Diagrams diagram al Jr Publish Cancel Overview ex S 51 3 149 0 scale 1 3028314 Render io Figure 66 Publish to Web for diagram symbolization As a result a new folder called Diagrams is created inside the qgis map server directory as seen in Figure 67 IE wamp 2 b Apache I bin IE cgi bin 2 IO qqis map server E I Cities C Countries i Diagrams Mn qqis Mrs D amp D Rivers O tmp CI cont error IC icons DO lib IE logs 3 modules ID logs DO php ID an Figure 67 Folder structure for diagram symbolization E 51 QGIS Mapserver 7 Examples Inside this folder the file called admin sld can be opened with anv text editor It will be structured as follows lt StyledLayerDescriptor xmIns http www opengis net sld units mm gt lt UserLayer xmIns http www opengis net sld gt lt Name xmins http www opengis net sld gt Diagrams lt Name gt
26. Category xmIns http www opengis net sld gt lt PropertyName xmlins http www opengis net ogc gt SERVICE lt PropertyName gt lt SvgParameter name fill gt d19767 lt SvgParameter gt lt Category gt lt Category xmIns http www opengis net sld gt lt PropertyName xmlins http www opengis net ogc gt CONSTRUCTI lt PropertyName gt lt SvgParameter name fill gt c08b5f lt SvgParameter gt lt Category gt lt Category xmIns http www opengis net sld gt lt PropertyName xmIns http www opengis net ogc gt AGRICULTUR lt PropertyName gt lt SvgParameter name fill gt a67852 lt SvgParameter gt lt Category gt lt Category xmins http www opengis net sld gt lt PropertyName xmlns http www opengis net ogc gt FINANCIAL lt PropertyName gt lt SvgParameter name fill gt 815d3f lt SvgParameter gt lt Category gt lt Category xmins http www opengis net sld gt lt PropertyName xmlins http www opengis net ogc gt WHOLESALE lt PropertyName gt lt SvgParameter name fill gt 4a3524 lt SvgParameter gt lt Category gt lt Size xmIns http www opengis net sld gt lt Interpolate xmins http www opengis net ogc mode linear gt lt LookupValue xmIns http www opengis net sld gt lt PropertyName xmlns http www opengis net ogc gt TOTALEMPL lt PropertyName gt lt LookupValue gt lt InterpolationPoint xmIns http www opengis net sld gt lt Data xmins http www opengis net
27. D cmake u 9 crake templates Cross2 s vq ID debian SYG Document IE doc l kB IS it n _ross4 5 0 ID images 9 include gt lib I mac I ms windows I plugins OD python OD resources DO scripts ID svg I biology 9 emergency entertainment oO geometric Oo gpsicans oO icon IE landmark I north_ arrows oO Services oO sport io symbol 3 transport E tests C themes IC tools G a Document 1 KE Crosso swg Ga Document 1 EB _ross5h 5 0 G a Document 1 EB Skarl swg Ga Document 1 EB Stare swg G a Document 1 KE Skara swg Ga Document 2 EB Figure 62 Placing the SVG Symbol Alternatively the SVG code can be opened inside any text editor The code can then be inserted into the admin sld file Inside the mark tag a new tag called SvgSymbol has to be created in which the SVG code has to be inserted 47 QGIS Mapserver 7 Examples lt Mark xmIns http www opengis net sld gt lt SvgSymbol xmins http www opengis net sld gt lt svg width 100 height 100 xmIns http www w3 org 2000 svg gt lt g xmin http www w2 org 2000 svg gt lt rect x 0 y 0 height 30 width 30 style fill 0000b9 gt lt line x1 6 y1 0 x2 30 y2 12 style stroke 00ffff gt lt g gt lt svg gt lt SvgSymbol gt lt Mark gt The following output is created Figure 63 User defined symbolization For further styling options please
28. For rounded line caps the stroke code has to be changed into the following lines lt Stroke xmIns http www opengis net sld gt lt CssParameter xmins http www opengis net sld name stroke gt 79aee5 lt CssParameter gt lt CssParameter xmins http www opengis net sld name stroke width gt 10 lt CssParameter gt lt CssParameter xmins http www opengis net sld name stroke linecap gt round lt CssParameter gt lt Stroke gt The result can be viewed in OGIS after a reload of the layer Note To refresh the layer visualization move the layer with the panning tool in QGIS desktop version The line cap will change consequentiv 42 QGIS Mapserver 7 Examples Figure 56 Line cap in line svmbolization For further styling options please refer to Appendix B Definition of symbolizing options where all implemented possibilities are listed 7 3 Point Symbolization 7 3 1 Creation of an admin sld file for Points To demonstrate the symbolization possibilities of point symbols the layer Point is used The data is processed in QGIS desktop version as described in chapter 5 4 Preparation of Data in QGIS The svmbolization properties have the following values g Fie Edit view Layer Settings Plugins Help ABBAS SREO KEER 47 228 gt O au a ex ku Laver Properties s Point a 0 x General Symbology Metadata Labels Actions Attributes d lt d a Legend type Single Symbol v T
29. GIS mapserver USER MANUAL Preface This documentation was created in Mav 2009 and represents the state of QGIS mapserver at the time of Mav 22 2009 It is intended to guide first time users through the workflow of publishing and editing a web based map with QGIS mapserver QGIS mapserver is a cartographically advanced mapserver published under the GPL license Author Sandra Zeder ETH Zurich Table of Contents Table of Figures 1 1 1 1 2 3 1 3 2 3 3 3 1 5 2 3 3 5 4 5 5 5 6 6 1 6 2 6 3 6 4 Pi 142 Basics Web Mapping 1 1 1 Client server architecture 1 1 2 OGC 1 1 3 Web Map Service 1 1 4 Map server 1 1 5 Styled Layer Descriptor GIS 1 2 1 Data formats What should know about QGIS Mapserver Installation of QGIS and QGIS Mapserver Windows Linux Mac OS X Folder Structure of QGIS Mapserver Data Processing in QGIS Starting QGIS Desktop Version Manage Plugins Shapefile in PostGIS Import Tool Preparation of Data in QGIS 5 4 1 Changing the Coordinate Reference System 5 4 2 Symbolization of Data 5 4 3 Diagram Overlay Data Publishing with QGIS Mapserver Editing an admin sld file 5 6 1 Structure 5 6 2 Svmbolizers 5 6 3 Filter Encoding Clients QGIS Open Layers Carto net Map Bender Examples Polygon Symbolization 7 1 1 Creation of an admin sld file for Polygons 7 1 2 Adaption of the Dasharray of an Outline Stroke 7 1 3 Creation of a User d
30. Hue sat 4k dr dk Val 253 Blue T 4h 4h Ar Cancel Figure 28 Choosing the color 6 With Fill style Outline color and Outline style further symbolization options are possible General Symbology Metadata Labels Actions Attributes diagram overlay Legend type Unique Value Transparency 0 Q Classification field GEFSTUF e Classify Add class Delete classes Randomize Colors Reset Colors o 1 amp amp 4 4 Label Style Options Outline style Solid Line ovine cr O OOOO O O Outline width 0 26 coo EN Fill style Solid JIR see lt Horizontal rm Vertical Cross BDiagonal FDiagonal Diagonal x BE Restore Default Style Save As Default Load St mm Densel we mu Dense BR Help c mm Dense3 m Cancel mm Dense4 mA Figure 29 Fill style 5 4 3 Diagram Overlay With this plugin diagrams can be generated in QGIS Note that before this plugin works it has to be enabled as described in chapter 5 2 Manage Plugins To execute it do the following 1 Double click on the layer in the Layers list which holds the data to be generated a diagram from The following window will open 20 QGIS Mapserver 5 Data Processing in QGIS General Symbology Metadata Labels Actions Attributes diagram overlay X Display diagrams Diagram type Pie chart Attributes GS_R z Add attribute Remove attribute Attribute Color G5 W Ti 651 655 Cl
31. LonLat 619528 163817 3 fp lt script gt lt head gt lt body onload init gt lt p id map gt lt p gt lt body gt lt html gt 10 Appendix 61 QGIS Mapserver 10 Appendix Appendix B Definition of svmbolizing options Green are available options red are not supported options Note This list was created in Mav 2009 Further options mav be available bv the meantime LineSymbolizer See Ogc PropertvName Stroke Stroke Stroke width Stroke opacity Stroke linejoin Stroke linecap Stroke dasharrav Stroke dashoffset PolygonSymbolizer See Ogc PropertvName 7 Rr Fill Fill opacity po ke Stroke Stroke width Stroke opacity Stroke linejoin Stroke linecap Stroke dasharray Stroke dashoffset PointSymbolizer See Ogc PropertvName Graphic Graphic Opacity Size Rotation Mark WellKnownName Fill Stroke SvgSvmbol TextSymbolizer See Ogc PropertvName See Dogpiroperig amel p Label Font lt Font style Font weight Font size LabelPlacement PointPlacement AnchorPointX AnchorPointY DisplacementX DisplacementY LinePlacement Rotation PerpendicularOffset Fill Fill Fill opacity 62 QGIS Mapserver 10 Appendix RasterSvmbolizer Geometrv See Ogc PropertvName Opacity Cis ChannelSelection RedChannel GreenChannel BlueChannel GrayChannel OverlapBehavior LATEST ON TOP EARLIEST ON TOP AVERAGE RANDOM ColorMap ColorMapEntry Opacity Quantity Cont
32. Processing in QGIS g Quantum GIS 1 1 0 Unstable trunk File Edit View Laver Settings Plugins Help E CA Manage Plugins r Publish ta web 44 Publish to web Manage web projects Figure 31 Opening the Publish to Web plugin Layers 2 Choose Publish to Web gt Publish to Web The following window will open Project name Server Path to QGIS WMS server directory amp binlapache Apache 2 11 cgi bin qgis_map_ server Enter sudo password Service metadata Title Abstract i ontactPerson Contact e mail Contact phone Server URL Layers Title Name Abstract Style name Awalar che ava Slide slide water 0 was Synoptic syn Ferimeter per Publish Cancel Figure 32 Publishing the project to web 3 Enter a project name path to the endpoint of the server directory and your password The path to the endpoint of the mapserver will be as follows in Linux lt path to your web server gt fcgi bin qgis_map_server qgis_map_serv fcgi and accordingly in Windows lt path to your web server gt cgi bin qgis_map_server qgis_map_serv cgi A password is only necessary when working with Linux 22 QGIS Mapserver 5 Data Processing in QGIS 4 Fillout the service metadata 5 Double click on the individual lavers The following window will open Title Name Avalanche Abstract Style name aval OK Cancel Figure 33 Entering
33. QGIS 1 Tosvmbolize data in QGIS desktop version select the tab Symbology The following tab will open Figure 24 Legend tvpe continuous color and unique value 3 Choose the field which holds the data for the classification General Symbology Metadata Labels Actions Attributes diagram overlay Legend type Unique Value w Transparency 0 Q General Symbology Metadata Labels Actions Attributes diagram overlay Legend type Unique Value Transparency 0 Q Single Symbol Classification Field Graduated Symbol FSTUF Continuous Color T j Delete classes Randomize Colors Reset Colors Wi Mo M 3 uA 4 Label Style Options Outline style Solid Line v Outline color Outline width 0 00 Te Fill color Fill style mm Solid z si Restore Default Style Save As Default Load Style Save Style Help Apply Cancel Choose the legend type The following options are possible Single symbol graduated symbol Classification field GEFSTUF Classify G55 GSR GEFSTUF RRO om s8sss8ssssssssssssssssssssssssssssssssssssssesss iG GW Add class cs L Label Style Options Outline style Solid Line Outline color Outline width 0 00 Fill color Fill style Solid Restore Default Style Save As Default Load Style Figure 25 Classification field Help Apply Save Style en Canc
34. Save File Q Do this automatically for files like this from now on Figure 9 Download of qgis_mapserver_ubuntu8 04 0 6 bin deb and libqgisO_ubuntu8 04 0 11 deb 3 Double click on the packages in the download list 4 Clickon Install Packages 3 3 MacOSX At the moment of the preparation of this documentation the packages for Mac OS X have not been available Please check on http karlinapp ethz ch qgis wms download index html if they have been published 10 QGIS Mapserver 4 Folder Structure of QGIS Mapserver 4 Folder Structure of QGIS Mapserver The basis for working with QGIS mapserver is to understand its file and folder structure As explained in chapter 3 Installation of QGIS and QGIS Mapserver the main folder qgis_ map server is saved into the cgi bin of the web server for Windows and into the fcgi bin of the web server for Linux Inside this folder there are different libraries which are of no importance for simplv using QGIS mapserver Note however that there is a file called qgis map serv cgi respectively qgis map server fcgi for Linux which is the core element of QGIS mapserver Another important file contained is called admin sld This is the configuration file based on SLD as described in chapter 1 1 5 Styled Layer Descriptor Whenever a project according to chapter 5 5 Data Publishing with QGIS Mapserver is created a new folder will appear Inside this folder a new admin sld file can be fo
35. aps and client sided web maps Client and server are connected via the internet they only understand HTML messages HTML is a markup language defined by the World Wide Web Consortium and is not extensible So only predefined syntax can be used and understood and displayed by a web browser W3 2009 To display web maps a plugin has to be available which enables either the browser to display the received information or the server to translate the information into a browser readable format Examples for client sided extensions are JavaScript or ActiveX controls Examples for server sided extensions are PHP PERL or Java servlets Dickmann 2001 1 1 2 OGC The Open Geospatial Consortium consists of 382 governmental organisations universities and companies with the aim to accelerate the development of interface specifications for geospatial data The resulting standards are detailed interfaces and encodings that can be used to develop software which may be interoperable in the future A document is only passed after all members have had the opportunity of commenting and discussing the standard An unanimous resolution is aimed at for the sake of acceptance by allmembers Further information can be found under www opengeospatial org Reinhardt 2004 1 1 3 Web Map Service WMS is a specification published by the OGC to standardize the exchange of geospatial data over the internet It consists of an http interface which enables queries for one or more
36. assification type linearly scaling Classification attribute GSW Figure 30 Diagram Overlav In the tab diagram overlay activate the Display diagrams checkbox Choose vour diagram tvpe and the classification tvpe 4 Add the attributes to be put into the diagram by selecting the attribute and clicking on Add attribute The colour of the attribute can be changed by double clicking on the current colour Choose the classification attribute The diagram size will appear proportional to the value of that attribute Click on 2K to confirm 7 Inthe layer property window see Error Reference source not found Diagram Overlay click on find maximum value for the program to find an appropriate size 8 Choose your desired diagram size 9 Click on Aal to preview your choices 10 Click on OK 5 5 Data Publishing with QGIS Mapserver The Publish to Web plugin generates a file in aXML schema called SLD styled layer descriptor which defines how the data is represented in the internet The generated file is the configuration file and is named admin sld Before publishing your data with the mentioned plugin the data has to be prepared in QGIS After the data looks as you wish to have it seen on the web execute this plugin Note Before this plugin works it has to be enabled as described in chapter 5 2 Manage Plugins 1 Inthe menu toolbar in QGIS click on Plugins or on the button u 21 QGIS Mapserver 5 Data
37. ce frame of a project choose the tab General 16 QGIS Mapserver General Symbology Metadata Labels Actions Attributes d Options Display name GKLEYS O_PY Display Field gid proj longlat ellps W5594 datum W O594 no defs Create Spatial Index Change CRS Use scale dependent rendering Minimum ji HE maximum 100000000 H Subset Query Builder Restore Default Style Save As Default Load Style Save Style Help OK Apply Cancel Figure 22 Changing the CRS 2 Click on Lange CRS The following window will open Define this laver s projection This layer appears ta have no projection specification By default this layer will now have its projection set to that of the project but you may override this by selecting a different projection below Coordinate Reference System EPSG ID m WGS B4 f SCAR IMW 5R45 46 3234 1193 Wis 94 f SCAR IMW SR47 46 3235 1194 GS 84 f SCAR IMM SR49 50 3236 1155 ru Wis B4 f SCAR IMW SRS1 52 3237 1196 proj lec Hat_1 72 66666666666667 Hat 2 75 33333333333333 lat_O 90 Han 1 155 x 0 0 v 0 0 elns eWwssad4 dah m nS Hinitsem nn ders KI Search EPSGID Name Find Wis 84 f SCAR IMW 5504 06 EPSG 3242 was 84 EPSG 4326 OK Cancel Figure 23 Defining the projection 3 Choose the relevant coordinate reference system and click on or 5 Data Processing in QGIS 17 QGIS Mapserver 5 4 2 Symbolization of Data 5 Data Processing in
38. ceTelephone gt lt ContactElectronicMailAddress gt your email address here lt ContactElectronic MailAddress gt lt ContactInformation gt lt Service gt lt Capability gt lt Request gt lt GetCapabilities gt lt Format gt text xml lt Format gt lt DCPType gt lt HTIP gt lt Get gt lt OnlineResource xlink type simple xlink href http localhost cgi bin qgis_map_server qgis_map_serv cgi gt lt Get gt lt HTTP gt lt DCPType gt lt GetCapabilities gt Figure 8 XML document with available functionalities 4 Download the package QGISPublishToWeb zip and unzip it In this package the necessary plugin Publish to Web is bundled with the QGIS 1 1 desktop version 3 2 Linux All packages are available under http karlinapp ethz ch qgis wms download index html 1 Prior to any installation of QGIS or QGIS mapserver a web server software has to be downloaded The commonly used open source server Apache can be downloaded under http httpd apache org download cgi 2 Download the packages qgis mapserver ubuntu8 04 0 6 bin deb and libqgisO ubuntu8 O4 0 11 deb QGIS Mapserver 3 Installation of QGIS and QGIS Mapserver Opening QQIS Mapserver ubuntuB 04 0 6 bin deb You have chosen to open qgis_ mapserver ubuntu8 04 0 6 bin deb which is a Software Paket from http karlinapp ethz ch What should Firefox do with this file Open with GDebi Package Installer default r O
39. ct1 html 01 05 2009 Dickmann Frank COMPASS 1 Das geographische Seminar Westermann Schulbuchverlad GmbH Braunschweig 2001 FastCGI http www fastcgi com devkit doc fcgi spec html 01 05 2009 OpenGIS Filter Encoding Implementation Specification OGC 04 095 2005 GNU http www gnu org licenses gpl html 01 05 2009 Hugentobler M losifescu Enescu l Hurni L A Design Concept for Implementing Interoperable Cartographic Services based on reusable GIS Components http karlinapp ethz ch qgis wms publications pdf ImplementationDesign pdf 01 05 2009 losifescu Enescu lonut WMS Extensions to Support Thematic Mapping OGC Change Request SE 1 1 0 CR 07 105 2007 QGIS Mapserver http karlinapp ethz ch 01 05 2009 Kraak M J Brown A Web Cartography Taylor amp Francis London and New Vork 2001 Map Bender http www mapbender org 01 05 2009 58 QGIS Mapserver WMS 2006 SE 2006 Sieber 2009 OpenLayers 2009 QGIS 2009 Reinhardt 2009 SLD 2007 UMN 2009 W3 2009 9 Bibliography OGC OpenGIS Web Map Server Implementation Specification OGC 06 042 2006 OGC Symbology Encoding Implementation Specification OGC 05 077r4 2006 Sieber Ren Introduction to Multimedia Cartography Cartographic Web Design Vorlesung in Multimedia Cartrography Fruhjahrssemester 2009 22 05 2009 OpenLayers http openlayers org 01 05 2009 QGIS http qgis org 01 05 2009
40. ect name Line a EE Server Q f Path to QGIS WMS server directory Ka D workSpace wamp Apachez cgi bin ggis_map_serverf ce Wi imm Enter sudo password LN Enter layer and style information O e Service metadata O i Title lt T Title Name Line Bi oa Abstract Abstract Q Style name line Q ContactPerson OK Cancel B Contact e mail m Ki e G Contact phone Server URL Layers Title Name Abstract Style name Line line 4 Jr Publish Cancel Overview ex 881 1 571 1 748 Scale 1 1000943 amp Render Figure 53 Publish to Web for line symbolization As a result a new folder called Line is created inside the qgis map server directory as seen in Figure 54 wamp 2 I Apache kal a l lI i bin I cgi bin B qqis map server IC Line ID ggis_wrns I conf I error icons 9 lib ID logs IS modules I logs php ID vr Figure 54 Folder structure for line symbolization Inside this folder the file called admin sld can be opened with any text editor It will be structured as follows 41 QGIS Mapserver 7 Examples lt StyledLayerDescriptor xmins http www opengis net sld units mm gt lt UserLayer xmIns http www opengis net sld gt lt Name xmins http www opengis net sld gt Line lt Name gt lt Title xmins http www opengis net sld gt lt Title gt lt Abstract xmIns http www opengis net sld gt lt Abstract gt
41. eennzznnenzannenzz 3 Common Gateway Interface ss seessnnnenenzznneni 4 Data TOMA lS in d obo a ka a Ti 6 Data Publishing 11 21 31 32 40 44 50 55 Dynamic IMAP ixicwaccecssnensasavedeetatonswesasteosiacenosdeansenbas 2 EX PIES asec ee a aa uta 31 Diagram Svmbolization ss eeennnnnnnzznna 49 Diagram creation ccesccsccesccscesecesceseees 49 Diagram Editing in admin sld 53 Line Symbolization 220s2220002enne nennen 40 FINECFEA IO A a kai An a TA Diga 40 Line editing in admin sld 42 Point Spmbolization e eeennennnnzennznnnnnz 43 POME Creation noorena A 43 Point editing in admin sld 46 Point with user defined symbol 47 Polygon Symbolization ss eenennnenzennenz 32 Filter ENCOOINE ne 38 Polygon creation hide 32 Polygon editing in admin sld 36 Polygon with user defined pattern 36 RasterSvmbolization ccccccsseceeeseceeeeeeeeees 54 Text Svmpolizatiot ii iii iii 48 8 Index Feste Gelesen 4 Folder Structure ss seeeennnnenzzsnennnzannzznnenzannna 11 geodatabase een 5 Get CaP abilities iii ee 3 GetfFestureltito su 3 GEIN ID een 3 Se ee 5 Installation na ee 8 11 31 i G PA ens 9 MaC OS A een 10 WVHA OWS senansa a 8 Interactive Map sssssssessesssssesessessssessesessrssrssess 2 Map Server g A AN
42. efined Pattern in SVG 7 1 4 Filter Encoding Line Symbolization vo ON oo m um RPwww N N 4 O e e N e eere OUNEN MNhN Pr OW DD N NN DU A N N NNN N WO WO OO N UW 4 UJ N WWW W won Dn N B QGIS Mapserver 7 3 1 4 LD 7 2 1 Creation of an admin sld file for Lines 7 2 2 Adaption of the Line cap Point Symbolization 7 3 1 Creation of an admin sld file for Points 7 3 2 Adaption to a different Point Symbol 7 3 3 Adaption to a User defined Point Symbol Text Symbolization Diagram Symbolization 7 5 1 Creation of an admin sld file for Diagrams 7 5 2 Adaption of the Zoom Dependency of Diagram Size RasterSymbolization Index Bibliography Appendix Table of Contents 40 42 43 43 46 47 48 49 49 53 54 57 58 60 QGIS Mapserver Table Figure 1 Figure 2 Figure 3 Figure 4 Figure 5 Figure 6 Figure 7 Figure 8 Figure 9 of Figures Map tvpes Kraak 2001 Structure of a WMS request Client Server Architecture Vector data Raster image Download of qgis map server zip Folder structure in Windows XML document with available functionalities Download of qgis mapserver ubuntu8 04 0 6 bin deb and libqgisO ubuntu8 04 0 11 deb Figure 10 Figure 11 Figure 12 Figure 13 Figure 14 Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 20 Figure 21 Figure 22 Figure 23 Figure 24 Figure 25 Figure 26 F
43. el 18 QGIS Mapserver 5 Data Processing in QGIS 4 Incase of the legend type unique graduated symbol or unique value click on C assify General Symbology Metadata Labels Actions Attributes diagram overlay Legend type Unique Value Transparency 0 Q Classification field GEFSTUF Classify Add class Delete classes Randomize Colors Reset Colors MK o Wi u z M 3 iy 4 Label Style Options Outline style Solid Line Ls Outline color Outline width 0 00 Fill color Fill style mem Solid Ly Restore Default Style Save As Default Load Style Save Style Help OK Apply Cancel Figure 26 Classify 5 To change the color of any value click on the value and the color field beside Fill Color General Symbology Metadata Labels Actions Attributes diagram overlay Legend type Unique Value Transparency 0 Q Classification field GEFSTUF Classify Add class Delete classes Randomize Colors Reset Colors Wi Mo M3 iA 4 Label Style Options Outline style Solid Line L Outline width 0 26 c N Fill style mm Solid Bi Restore Default Style Save s Default Load Style Save Style Help Applv Figure 27 Changing the color Cancel 19 QGIS Mapserver 5 Data Processing in QGIS Basic colors HILL III m MM E 0 5 Da I2 EI I g fel E a ee EE a d U NEMMEN LA Custom colors 22 Red 1 224 Green Add to Custom Colors
44. elp JBGA RRPE K R T Layers ex a 2 o xa land oce r Fr ji p kal Project name Bild u Server Path to QGIS WMS server directory A D jfWorkSpacejwampjApache jegi binjqqis map server S Enter sudo password e Service metadata i q C gi Si 9 ES El Title Abstract ContactPerson Contact e mail OMAP LR Contact phone Server URL Layers Title Name Abstract Style name Bild bild O Y Enter layer and style information Eu KI le Publish Cancel Title Name Abstract Style name bild Cancel Overview x LI IS 62 2 144 0 Figure 72 Publish to Web for raster symbolization Scale 1 152279518 Render iz As a result a new folder called Bild is created inside the qgis map server directory as seen in Figure 73 ED wamp Apachez El I bin 2 IE cgi bin S ggis map server E IC Bild i OD Line IC Point ID qais O tmp ID conf Mn error Mn icons i lib ID logs ID modules i logs php ic WARS MMS 55 QGIS Mapserver 7 Examples Figure 73 Folder structure for raster svmbolization Inside this folder the file called admin sld can be opened with any text editor It will be structured as follows lt StyledLayerDescriptor xmIns http www opengis net sld units mm gt lt UserLayer xmIns http www opengis net sld
45. ent sided extension that has to be downloaded and unpacked first If a map is to be published on the web this client cannot be used To view maps with QGIS desktop version do the following 1 On the menu toolbar click on Layers gt Add WMS Layer or on the symbol 2 Click on New The following window will open Connection details Mame URL Help OK Cancel Figure 38 Create a new WMS connection 3 Insert a name for the connection and the URL to the WMS layer you wish to add Click on ar 4 In the following window click on Connect Server Connections best Connect New Edit Delete Add default servers Image encoding e Pha Layers ID Name Title Abstract m E 10 Perimeter m il per per E 8 Synoptisch q syn syn lid E 6 Wasser b Coordinate Reference System 3520 available CH1903 LOS Change Help Add Close Response is complete Figure 39 Add Layer s from a server 27 QGIS Mapserver 6 Clients 5 Choose the desired layer by clicking on the beside the layer then choosing the User Style in this example per Choosing the User Style leads to the visualisation of the layer as described in the admin sld file If the layer itself is added in this example Perimeter then the symbolization is not added This means the layer will appear with default styling which is in black strokes without any fills 6 Change the coordinate system if required by clicking on
46. ertieren QGIS map server f extensions Thest version of QGIS dia The packages provic QGIS in the default as binary package it is better to compile from source qgis_mapserver_ubuntu8 04 0 6 bin deb libqgisO_ubuntu8 04 0 11 deb ographic ment xtensions llations of Properties IS installed source tarball Figure 6 Download of qgis map server zip g IE wamp 5 Apaches IE bin E 5 cgi bin E IE qgis_map_server E ggis wms 5 conf IC error I icons i lib i logs I modules i logs C php I ar Figure 7 Folder structure in Windows 3 Installation of QGIS and QGIS Mapserver is wms download index html QGIS Mapserver 3 Installation of QGIS and QGIS Mapserver 3 Testif QGIS mapserver is installed properlv bv opening a web browser and tvping in the following line http lt path to your webserver gt cgi bin qgis map server qgis map serv cgi7 SERVICE WMS amp REQUEST GetCapabilities amp Version 1 3 0 The following lines should be displayed lt WMS_ Capabilities version 1 3 0 xsi schemaLocation http www opengis net wms http schemas opengis net wms 1 3 0 capabilites 1 3 Oxsd 9 lt Service gt lt Name gt WMS lt Name gt lt Title gt lt Abstract gt lt OnlneResource type simple href http localhost gt lt ContactInformation gt lt ContactPersonPrimary gt lt ContactPerson gt your name here lt s ContactPerson gt lt ContactPersonPrimary gt lt ContactVoi
47. geo coded map images from geospatial databases The three following basic operations are standardized e GetCapabilities This operation returns metadata of the requested map e GetMap This operation returns a map with defined referencing parameters defined height and width of the map image defined information and in a limited number of predefined stvles e Getreaturelnfo This operation is optional and returns information about features in the map The procedure of a WMS request has the following structure QGIS Mapserver 1 Basics CLIENT SERVER GetCapabilites XML document with available functionalities GetMap Displav of Map GetFeaturelnfo Information for certain Features Figure 2 Structure of a WMS request If the number and appearance of the predefined styles is not adequate the possibility of applying user defined stvles with the Stvled Laver Descriptor as specified in chapter 1 1 5 Stvled Laver Descriptor is available WMS 2006 1 1 4 Map server A map server is basicallv a server that is able to answer a WMS request The following diagram shows its purpose Web server Map server Client Server server Figure 3 Client Server Architecture A client requests functionalitv from a web server A web server only comprehends HTML messages So in case of geographical data or other complex data where the web server has to request data from a database the web server passes the command to a map server e g a Common
48. hanee 7 Clicking on FEE completes the procedure g Quantum GIS 1 1 0 Unstable trunk Joe File Edit View Layer Settings Plugins Help JA AE ALJR gt ff Layers ex karlinapp_ptj Overview ex u Sl 638524 197879 Scale 1 1568106577 ex Render lo Figure 40 Example of a QGIS map 6 2 Open Layers Open Layers is a free Javascript library which allows dynamic maps to be displayed in any web browser without any server sided dependencies It offers diverse widgets for easily implementing functions as zooming panning or centering to any displayed map OpenLayers offers an extensive gallery with examples for its utilization For further information please visit http openlayers org An example of the integration of a map in Open Layers can be found in Appendix A Example of the integration of an admin sld file in OpenLayers 28 QGIS Mapserver 6 Clients AWII E Rutschungen L Lawine E Wasser synoptische karte Base Layer Swisstopo a Sa 9 hs 72 lt 20 00000 0 00000 6 3 Carto net Carto net is a framework client developed by the institute of cartography at the ETH Zurich It is based on JavaScript and SVG and offers a list of widgets For reasons of popularity of JavaScript the visualisation of the framework client has many options The only disadvantage of this client is the rather short documentation of the product Further information can be found on http www carto net
49. ic tvpes of vector data distinguishable points lines and polvgons U Figure 4 Vector data Raster Data On the other hand raster data are informations that cover everv part of the relevant area The area is divided into a regular grid with pixels Each pixel can hold only one value which is normallv used for the visualisation An example of usage is a digital terrain model or a JPEG image Brovelli 2008 Figure 5 Raster image QGIS Mapserver 2 What should I know about QGIS Mapserver 2 What should I know about QGIS Mapserver e tis an open source WMS released under the GPL license Its sources are therefore freely accessible which allows all transparency possible e tis a FastCGI CGI application written in C e It allows the visualization and publication of maps on the internet whether it be raster or vector data according to cartographic rules e It allows the symbolization and management of geospatial data in a desktop version of QGIS This is a user friendly way of symbolizing data and allows the immediate visualization of the results With the aid of a plugin the results are easily published even without fundamental programming or scripting knowledge e With the extension diagram overlay diagrams can be generated and therefore thematic information is easily published The general public license GPL is a license which intends to guarantee the freedom of alternation and distribution of software GNU
50. igure 27 Figure 28 Figure 29 Figure 30 Figure 31 Figure 32 Figure 33 Figure 34 Figure 35 Figure 36 Figure 37 Figure 38 Figure 39 Figure 40 Figure 41 Figure 42 Figure 43 Figure 44 Figure 45 Figure 46 Figure 47 Basic contents of qgis map server folder Structure of package QGISPublishtoWeb Publish to Web Plugin Manager Plugins Publish to Web Plugins SPIT Shapefile to PostGIS Import Tool New PostGIS connection Add Shapefiles to PostgreSQL Add PostGIS Table Connection Information Properties of alaver Changing the CRS Defining the projection Legend tvpe Classification field Classifv Changing the color Choosing the color Fill stvle Diagram Overlav Opening the Publish to Web plugin Publishing the project to web Entering laver and stvle information Folder structure after the creation of a map Basic structure of an admin sld file Structure of the tag UserStyle Svmbolizers Create a new WMS connection Add Layer s from a server Example of a QGIS map Example of an Open Layers map Example of a Cartonet map CARTONET 2009 Example of a MapBender map MapBender 2009 Layer properties for polygon symbolization Publish to Web for polygon symbolization Folder structure for polygon symbolization WMS layer for polygon symbolization Table of Figures vo ron KAN 10 11 12 12 13 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 22 22 23 23
51. imation or slide show However there is still no interaction possible e Interactive maps offer the possibility to interact with the map This interaction can be in terms of navigation toolbars with panning and zooming options different layer options or in dynamic maps in terms of animations Cartouche 2009 In the last few years many web maps have been set up and now circulate in the internet However the potential of cartographic rules has not yet been exploited Kraak 2001 QGIS mapserver offers a great potential for cartographic applications The following subchapters describe the basics for the creation of a web map QGIS Mapserver 1 Basics 1 1 1 Client server architecture Two basic architecture types can be distinguished in information technology The first one is a local system where the user works with an operating system on which the application is directly executed An example for this architecture is a Desktop GIS The second architecture is the Client Server architecture where the client requests data or functionality from a server In such architecture the server is passive and waits on requests from an active client In case of aweb map the map has to be provided by a server The client consists of any web browser that sends a request to view the map or get information about it Cartouche 2009 With this concept of the client server architecture at hand two different kinds of web maps can be kept apart server sided web m
52. inScaleDenominator gt 5000000 lt MinScaleDenominator gt lt MaxScaleDenominator gt 5000000 lt MaxScaleDenominator gt lt MinScaleSizeMultiplication gt 5 lt MinScaleSizeMultiplication gt lt MaxScaleSizeMultiplication gt 1 lt MaxScaleSizeMultiplication gt lt Scale gt lt Diagram gt The result can be viewed in QGIS after a reload of the layer 53 QGIS Mapserver 7 Examples Note To refresh the laver visualization move the laver with the panning tool in QGIS desktop version The symbol will change consequently Figure 69 Diagram size before editing Figure 70 Diagram size after editing For further styling options please refer to Appendix B Definition of symbolizing options where all implemented possibilities are listed 7 6 RasterSvmbolization To demonstrate the symbolization possibilities of raster datasets the layer eu_cities is used The data is processed in QGIS desktop version as described in chapter 5 4 Preparation of Data in QGIS The symbolization properties have the following values Figure 71 Layer properties for raster symbolization 54 QGIS Mapserver 7 Examples With the plugin Publish to Web the SLD file is automaticallv generated as described in chapter 5 5 Data Publishing with QGIS Mapserver Absolutelv required are the project name the path to the server directorv and an appropriate name and stvle name for the published laver g File Edit View Layer Settings Plugins H
53. iteral gt lt LowerBoundary gt lt UpperBoundary xmIns http www opengis net ogc gt lt Literal xmIns http www opengis net ogc gt 20926 500 lt Literal gt lt UpperBoundary gt 34 QGIS Mapserver 7 Examples lt PropertyIlsBetween gt lt Filter gt lt PolygonSymbolizer xmIns http www opengis net sld gt lt Stroke xmIns http www opengis net sld gt lt CssParameter xmins http www opengis net sld name stroke gt 000000 lt CssParameter gt lt CssParameter xmins http www opengis net sld name stroke width gt 1 lt CssParameter gt lt Stroke gt lt Fill xmIns http www opengis net sld gt lt CssParameter xmins http www opengis net sld name fill gt 869b7b lt CssParameter gt lt Fill gt lt PolygonSymbolizer gt lt Rule gt lt Rule xmIns http www opengis net sld gt lt Filter xmIns http www opengis net ogc gt lt PropertylsBetween xmIns http www opengis net ogc gt lt PropertyName xmlns http www opengis net ogc gt SERVICE lt PropertyName gt lt LowerBoundary xmIns http www opengis net ogc gt lt Literal xmIns http www opengis net ogc gt 20926 500 lt Literal gt lt LowerBoundary gt lt UpperBoundary xmIns http www opengis net ogc gt lt Literal xmIns http www opengis net ogc gt 27902 001 lt Literal gt lt UpperBoundary gt lt PropertyIsBetween gt lt Filter gt lt PolygonSymbolizer xmIns http www opengis net sld gt lt Stroke x
54. ld name stroke gt 000000 lt CssParameter gt lt CssParameter xmins http www opengis net sld name stroke width gt 0 lt CssParameter gt lt Stroke gt lt Fill xmIns http www opengis net sld gt lt pattern x 0 y 0 width 12 height 12 gt lt g gt lt sVg gt lt g gt lt rect style fill none width 12 height 12 gt lt line style fill none stroke FEDC00 stroke width 2 x1 6 y1 12 x2 6 y2 0 gt lt g gt 36 QGIS Mapserver 7 Examples lt svg gt lt g gt lt pattern gt lt Fill gt lt PolygonSymbolizer gt The resulting pattern will look as follows when published 9 User defined pattern D Figure The following example demonstrates the use of Inkscape to define more advanced patterns The screenshot below shows an example of the created pattern Pattern_ex sve Inkscape File Edit View Layer Object Path Text Effects Whiteboard Help LBA a4 HEle ee 3 0 QaeaQinutse y gt Oo Bim amp 2 A 8 se Er ET x 16 737 eva B w 15 751 6 A FEEEERENA a 5 10 15 20 z5 30 i i A E f AE nl ee a nL m A E Li al rlo balas laol faoli lael or el jil Ta A l NEBBENQSONROBOOBAT go 5 x Ill E b 4 Em A e Wh o 100 E a 92452 No objects selected Click shift xih aa sa Zijissew B Figure 50 Creation of a pattern in Inkscape This Inkscape file is saved in the SVG format Afterwards it is opened in a text edito
55. lt id g2452 gt lt line style fill url Unnamed_Pattern_1 stroke 445c72 stroke width 2 stroke opacity 1 x1 31 826143 y1 22 839552 10 Appendix 65 QGIS Mapserver x2 24 017271 y2 30 535725 id line2454 gt lt line style fill url Unnamed_Pattern_1 stroke 445c72 stroke width 2 stroke opacity 1 x1 31 500111 y1 17 182501 x2 17 736534 y2 30 800545 id line2456 gt lt line style fill url Unnamed_Pattern_1 stroke 445c72 stroke width 2 stroke opacity 1 x1 31 684469 y1 11 000681 x2 10 958408 y2 31 575134 id line2458 gt lt line style fill url Unnamed_Pattern_1 stroke 445c72 stroke width 2 stroke opacity 1 x1 31 980234 y1 4 712297 x2 6 4546394 y2 30 071522 id line2460 gt lt line style fill url Unnamed_Pattern_1 stroke 445c72 stroke width 2 stroke opacity 1 x1 32 373138 y1 1 6827757 x2 0 81054503 y2 31 337877 id line2462 gt lt line style fill url Unnamed_Pattern_1 stroke 445c72 stroke width 2 stroke opacity 1 x1 25 471237 y1 0 78149611 x2 0 82361865 y2 25 35257 id line2464 gt lt line style fill url Unnamed_Pattern_1 stroke 445c72 stroke width 2 stroke opacity 1 x1 20 65983 y1 1 9817268 x2 2 1523352 y2 20 692924 id line2466 gt lt line style fill url Unnamed_Pattern_1 stroke 445c72 stroke width 2 stroke opacity 1 x1 14 857673 y1 2 191546 x2 2 7882533 y2 15 339822 id
56. mIns http www opengis net sld gt lt CssParameter xmins http www opengis net sld name stroke gt 000000 lt CssParameter gt lt CssParameter xmins http www opengis net sld name stroke width gt 1 lt CssParameter gt lt Stroke gt lt Fill xmIns http www opengis net sld gt lt CssParameter xmins http www opengis net sld name fill gt 62735b lt CssParameter gt lt Fill gt lt PolygonSymbolizer gt lt Rule gt lt FeatureTypeStyle gt lt UserStyle gt lt UserLayer gt lt StyledLayerDescriptor gt To view the symbolization of this file a WMS layer can be imported in QGIS To do that the admin sld file first has to be placed in the main qgis_ map server directory as explained in chapter 5 6 Editing an admin sld file Afterwards this layer can be opened in QGIS with the instructions of chapter 6 1 QGIS which leads to the following visualization of the style Figure 47 WMS layer for polygon symbolization 35 QGIS Mapserver 7 Examples 7 1 2 Adaption of the Dasharrav of an Outline Stroke If this visualization result does not turn out satisfactorv the style can directly be changed in the admin sld file The outline color which is at the moment black and a solid line wants to be changed to a darkbrown color and dashed line To do this all stroke paragraphs have to be changed into the following code lt Stroke xmIns http www opengis net sld gt lt CssParameter xmins
57. n NEW to establish a connection to a database Shapefile in PostGIS Import Tool according to chapter 5 3 Shapefile in PostGIS Import Tool will open 15 QGIS Mapserver 5 Data Processing in QGIS Connection Information Name eh Cancel Database Help Port 432 Username Password Save Password Test Connect Only look in the geometry_columns table Only look in the public schema Figure 20 Connection Information 12 Select the relevant data 13 Click on Add After all data have been loaded into QGIS the whole editing of it can be done 5 4 Preparation of Data in QGIS For more detailed description of editing tools in QGIS please visit http www qgis org documentation html For the property options of a specific layer double click on the layer in the Layers list or right click on the layer in the Layers list as shown in Figure 21 K Quantum GIS 1 1 0 Unstable trunk File Edit View Layer Settings Plugins Help JB 440858 8 CBE Dh x Layers AV DE c 3 2 eu cities O mD m E X eu rivers gt o x eu countries them i as lm re Zen W4 Zoom to layer extent rc we Show in overview mm x Remove Open attribute table 7 Toggle editing N Save as shapefile aa Q ak Properties ETA ki Rename lt Add group F Expand all TF Collapse all SN Show file groups Figure 21 Properties of a layer 5 4 1 Changing the Coordinate Reference System 1 To change the referen
58. on of an admin sld file for Lines For this symbolization method the layer Line is used The data is processed in QGIS desktop version as described in chapter 5 4 Preparation of Data in QGIS The svmbolization properties have the following values g File Edit View Layer Settings Plugins Help JE Bu So REP Se areas ECLOG DW ax ea ex Layer Properties ahd 9 G ii Line ma ch General Symbology Metadata Labels Actions Attributes d 4 P ae Legend type Single Symbol Transparency 0 I 0 u rm 8 ie LE O z WA K l 7 Style Options Q Outline style Solid Line 94 Outline color 6 Outline width AS Fill color Fill style No Brush Restore Default Style Save As Default Load Style Save Style Help Apply Cancel Overview ex 881 2 443 1 699 Scale 11000943 9 x Render io Figure 52 Layer properties for line symbolization With the plugin Publish to Web the SLD file is automatically generated as described in chapter 5 5 Data Publishing with QGIS Mapserver Absolutely required are the project name the path to the server directory and an appropriate name and style name for the published layer 40 QGIS Mapserver 7 Examples File Edit View Layer Settings Plugins Help x ur JBBBSRRFEL CREO ZUA gt vr Layers x A ahd De c jik Line DI a Proj
59. option End of rule End of feature layer style End of style Figure 36 Structure of the tag UserStyle 5 6 2 Symbolizers Depending on whether the object to be displayed is a point line polygon text or diagram different symbolizing options can be used lt PointSymbolizer gt Point symbol lt LineSymbolizer gt Line symbol lt PolygonSymbolizer gt Polygon symbol lt TextSymbolizer gt Text Symbol lt DiagramSymbolizer gt Diagram symbol Figure 37 Symbolizers Within these symbolization options numerous definitions can be changed A list of implemented options can be found in Appendix B Definition of symbolizing options Note that not all standards as published by the OGC in Document 05 078r4 are yet supported 25 QGIS Mapserver 5 Data Processing in QGIS 5 6 3 Filter Encoding Another implementation is called filter encoding With this the Filter Encoding Implementation Specifications published bv the OGC are supported Therefore svmbolization depending on an attribute value is possible For an example please consult chapter 7 1 4 Filter Encoding 26 QGIS Mapserver 6 Clients 6 Clients To display the prepared map in a web browser a framework client is needed All described clients are open source products 6 1 QGIS QGIS desktop version is a WMS Client as well The main advantage of using QGIS as a client is the easy and fast display of data without having to deal with source codes However it is a cli
60. plugins do the following steps 1 Onthe menu toolbar click on Plugins File Edit View Layer Settings Plugins Help H 73 Manage Plugins da iBS Publish to web b Figure 12 Publish to Web i Fi 2 2 2 Choose Manage Plugins 12 QGIS Mapserver 5 Data Processing in QGIS To enable f disable a plugin click its checkbox or description Publish ta web plugin x A plugin ta publish a project with the QGIS WMS server Quick Print Quick Print is a plugin ta quickly print 3 map with minimal effort ro ED GME nlunoin Filter Plugin Directory C QGISfQGISPublishTa Mebfplugiris Select All Clear All OK Cancel Figure 13 Plugin Manager 3 Choose Publish to Web SPIT or any other plugin you wish to enable 4 Click on ok 5 If once again clicking on Plugins in the toolbar new elements in the dropdown list should be visible Plugins Help Co Manage Plugins Fi 7 Fi Add Sensor layer Interpolation d Publish to web Er Publish to web Spit Manage web projects Figure 14 Plugins Publish to Web 5 3 Shapefile in PostGIS Import Tool For big amounts of data it is advisable to import all data into a geodatabase The advantages are numerous beside multiuser support the performance is much higher if stored in a database PostGIS is an open source database which supports geospatial data It can be downloaded under http postgis refractions net A plugin to im
61. port shapefiles directly into a PostGIS database is automatically included in the download package of QGIS mapserver Note Before this plugin works it has to be enabled as described in chapter 5 2 Manage Plugins To execute it do the following 1 Onthe menu toolbar click on Plugins or the button Plugins Help C Manage Plugins a 2 u in S 2 Fo Add Sensor layer H i Interpolation i Publish ta web k Spit kJ Import Shapefiles to PostgreSQL Figure 15 Plugins SPIT 2 Choose SPIT gt Shapefile in PostGIS Import Tool The following window will open 13 QGIS Mapserver 5 Data Processing in QGIS PostgreSQL Connections Connect New Edit Remove Import options and shapefile list X Use Default Geometry Column Name or specify here the qeom Use Default SRID or specify here l 1 Primary Key Column Mame gid Global Schema File Name Feature Class Features DE Relation Mame Schema Add Remove Remove All Help OK Cancel Figure 16 Shapefile to PostGIS Import Tool 3 Toset up a PostGIS connection click on pew The following window will appear Connection Information Mame Cancel Hast Database Help Port 5432 Username Password Save Password Test Connect Only look in the geometry columns table Only look in the public schema Figure 17 New PostGIS connection 4 Enter the name host database name port user name and
62. r and shows the structure shown below Note that this is onlv an extraction of the complete file which can be found in the ZIP folder complementing this User Manual 37 QGIS Mapserver 7 Examples lt xml version 1 0 encoding iso 8859 1 gt lt Generator Adobe Illustrator 13 0 2 SVG Export Plug In SVG Version 6 00 Build 14948 gt lt DOCTYPE svg PUBLIC W3C DTD SVG 1 1 EN http www w3 org Graphics SVG 1 1 DTD svg11 dtd gt lt svg lt svg gt This code is now included in the admin sld file until it looks as seen in the following code lt PolygonSymbolizer xmIns http www opengis net sld gt lt Fill xmIns http www opengis net sld gt lt pattern width 29 height 29 x 0 y 0 gt lt g gt lt svg xmins dc http purl org dc elements 1 1 7 xmins cc http creativecommons org ns xmins rdf http www w3 org 1999 02 22 rdf syntax ns xmins svg http www w3 org 2000 svg xmins http www w3 0rg 2000 sv lt svg gt lt g gt lt pattern gt lt Fill gt lt PolygonSymbolizer gt The code leads to the following result p 4 Figure 51 User defined pattern created in Inkscape 7 1 4 Filter Encoding Another helpful symbolization option is the use of filter encoding With it objects with a certain attribute value can be svmbolized separatelv The following code shows an example of its use All objects that have a value between 0 001 and 6975 500 in the attribu
63. r the production of a web map is the following 1 Installation of a webserver Chapter3 Installation of QGIS and QGIS Mapserver 2 Installation of QGIS mapserver Chapter3 Installation of QGIS and QGIS Mapserver 3 Download of QGIS desktop version Chapter3 Installation of QGIS and QGIS Mapserver 4 Data Processing in QGIS desktop version Chapter5 Data Processing in QGIS 5 Publishing Data Chapter 5 5 Data Publishing with QGIS Mapserver 6 Editing the admin sid file Chapter 5 6 Editing an admin sld file 7 Integration of the map in a framework client Chapter6 Clients All examples presume a completion of steps 1 to 3 which is the proper installation of a webserver and QGIS mapserver see chapter 3 Installation of QGIS and QGIS Mapserver opening QGIS desktop version chapter 5 1 Starting QGIS Desktop Version management of plugins chapter 5 2 Manage Plugins and the management of data chapter 5 3 Shapefile in PostGIS Import Tool 31 QGIS Mapserver 7 Examples 7 1 Polygon Symbolization 7 1 1 Creation of an admin sld file for Polygons For this example the laver eu countries is used The data is processed in QGIS desktop version as described in chapter 5 4 Preparation of Data in QGIS The svmbolization properties have the following values 4 File Edit View Layer Settings Plugins Help JABHALKRPF CREWE FILHO JUM AV LY o xe eu_countries_them 0 001 6975 500 E 6975 500 13951 000 r 13951 000 20926 500
64. ransparency 0 Label Point Symbol OHPO XAAAATAP LOBBHEZSBMMBNOE i mi to AA QADI LA Rotation Field Area scale field Size lt off gt vw lt off gt w 15 00 Style Options Outline style Solid Line OfPOLYP OS DOB si Sl BB EL ji Outline color Outline width Fill color Fill style mm Solid Restore Default Style Save As Default Load Style Save Style Help OK Apply Cancel Overview x m 85 1 0855 0 9088 Scale 1 304708 QX Render jig Figure 57 Layer properties for point symbolization 43 QGIS Mapserver 7 Examples With the plugin Publish to Web the SLD file is automaticallv generated as described in chapter 5 5 Data Publishing with QGIS Mapserver Absolutelv required are the project name the path to the server directorv and an appropriate name and stvle name for the published laver File Edit View Layer Settings Plugins Help J QA RKRPEL EWWA FILLHO JUM Layers IBJIXI ahd 9 B 2 25 Point w G Project name Point a q Server Path to QGIS WMS server directory g u D fWorkSpacejwampjApache jeqi binjqqis map serverj amp WI u Enter sudo password Pad _ Service metadata fe Title X D p a Ww Title ae Abstract Q Name Point ContactPerson Abstract Q Contact e mail Style name point AS Contact phone OK Cancel Server URL Lavers Title Name Abstract Style name Point point KI l gt
65. rastEnhancement Normalize Histogram GammaValue ShadedRelief BrightnessOnly ReliefFactor ImageOutline LineSymbolizer PolygonSymbolizer DiagramSymbolizer See Ogc PropertyName IN Diagram WellKnownName Pie Bar Line Area Ring Polar Subtype Normal Stacked Percent Category Title See ogc PropertvName SvgParameter Symbolizer Gap 3D SvgSymbol Size SizeType Scale Opacity Rotation AnchorPoint Anchorline Displacement Halo 63 QGIS Mapserver Filter Rule 10 Appendix Equals Disjoint Touches Within Overlaps Crosses Intersects Contains DWithin Beyond BBOX PropertylsEqualTo PropertylsNotEqualTo PropertylsLessThan PropertylsGreaterThan PropertylsLessThanOrEqualTo PropertyIsGreaterThanOrEqualTo PropertylsLike PropertylsNull PropertylsBetween And Or Not logicOps id Featureld GmlObjectld Add Sub Mul Div PropertyName Function Literal Function Filter Capabilities 64 QGIS Mapserver Appendix C Example of an SVG file lt xml version 1 0 encoding iso 8859 1 gt lt Generator Adobe Illustrator 13 0 2 SVG Export Plug In SVG Version 6 00 Build 14948 gt lt DOCTYPE svg PUBLIC W3C DTD SVG 1 1 EN http www w3 org Graphics SVG 1 1 DTD svg11 dtd gt lt svg xmins dc http purl org dc elements 1 1 7 xmins cc http creativecommons org ns xmins rdf http www w3 org 1999 02 22 rdf syntax ns xmins svg http www w3 org 20
66. refer to Appendix B Definition of symbolizing options where all implemented possibilities are listed 7 4 Text Symbolization Text symbolization is not yet implemented to appear automatically However by editing an admin sld file manually labels can easily be displayed The following SLD file shows the point symbolization from the example above lt StyledLayerDescriptor xmIns http www opengis net sld units mm gt lt UserLayer xmIns http www opengis net sld gt lt Name xmins http www opengis net sld gt Point lt Name gt lt Title xmIns http www opengis net sld gt lt Title gt lt Abstract xmIns http www opengis net sld gt lt Abstract gt lt HostedVDS xmIns http www opengis net sld providerType ogr uri D PointExample Point shp gt lt UserStyle xmIns http www opengis net sld gt lt Name xmins http www opengis net sld gt point lt Name gt lt FeatureTypeStyle xmIns http www opengis net sld gt lt Rule xmIns http www opengis net sld gt lt PointSymbolizer xmIns http www opengis net sld gt lt Graphic xmlns http www opengis net sld gt lt Mark xmins http www opengis net sld gt lt SvgSymbol xmins http www opengis net sld gt lt svg width 100 height 100 xmIns http www w3 org 2000 svg gt lt g xmin http www w2 org 2000 svg gt lt rect x 0 y 0 height 30 width 30 style fill 0000b9 gt lt line x1 6 y1 0 x2 30 y2 12 style stroke
67. s earlier mentioned the admin sld file is the heart of QGIS mapserver All configurations are made with this file Understanding how to edit this file leads to a variety of visualisation possibilities For simple symbologies such as plain fills of polygons or strokes the file does not have to be edited manually However if more complex structures or individual patterns are intended to be visualised the admin sld file has to be edited manuallv Examples of the editing are demonstrated in chapter 7 Examples The basic structure of an admin sld file is as follows lt StyledLayerDescriptor gt Root element start of sid file lt UserLayer gt Start of layer lt Name gt lt Name gt Name of layer lt Title gt lt Title gt Title of layer lt Abstract gt lt Abstract gt Description of layer lt HostedVDS gt Data Source of layer lt UserStyle gt Start of style lt Name gt lt Name gt Name of style lt UserStyle gt End of style lt UserLayer gt End of layer lt StyledLayerDescriptor gt End of sld file Figure 35 Basic structure of an admin sld file This structure is generated automatically when a project is created with the Publish to Web plugin provided by QGIS mapserver The succeeding example shows an admin sld file which defines a raster layer For feature layers there are further definitions to be found Inside the lt UserStyle gt tag there is a number of subtabs This may look as follo
68. s net sld gt lt Abstract gt lt HostedVDS xmins http www opengis net sld providerType ogr uri U user geodata_eu eu_countries_them shp gt lt UserStyle xmIns http www opengis net sld gt lt Name xmins http www opengis net sld gt country lt Name gt lt FeatureTypeStyle xmIns http www opengis net sld gt lt Rule xmIns http www opengis net sld gt lt Filter xmIns http www opengis net ogc gt lt PropertylsBetween xmIns http www opengis net ogc gt lt PropertyName xmlns http www opengis net ogc gt SERVICE lt PropertyName gt lt LowerBoundary xmIns http www opengis net ogc gt lt Literal xmIns http www opengis net ogc gt 0 001 lt Literal gt lt LowerBoundary gt lt UpperBoundary xmIns http www opengis net ogc gt lt Literal xmIns http www opengis net ogc gt 6975 500 lt Literal gt lt UpperBoundary gt lt PropertyIsBetween gt lt Filter gt lt PolygonSymbolizer xmIns http www opengis net sld gt lt Stroke xmIns http www opengis net sld gt lt CssParameter xmins http www opengis net sld name stroke gt 000000 lt CssParameter gt lt CssParameter xmins http www opengis net sld name stroke width gt 1 lt CssParameter gt lt Stroke gt lt Fill xmIns http www opengis net sld gt lt CssParameter xmins http www opengis net sld name fill gt daffc9 lt CssParameter gt lt Fill gt lt PolygonSymbolizer gt lt Rule gt lt Rule xmIns h
69. te called SERVICE will be symbolized as defined between the lt PolygonSymbolizer gt tags lt Rule xmIns http www opengis net sld gt lt Filter xmIns http www opengis net ogc gt lt PropertylsBetween xmIns http www opengis net ogc gt lt PropertyName xmlns http www opengis net ogc gt SERVICE lt PropertyName gt lt LowerBoundary xmIns http www opengis net ogc gt lt Literal xmIns http www opengis net ogc gt 0 001 lt Literal gt lt LowerBoundary gt lt UpperBoundary xmIns http www opengis net ogc gt lt Literal xmIns http www opengis net ogc gt 6975 500 lt Literal gt 38 QGIS Mapserver 7 Examples lt UpperBoundary gt lt PropertyIsBetween gt lt Filter gt lt PolygonSymbolizer xmIns http www opengis net sld gt lt Stroke xmIns http www opengis net sld gt lt CssParameter xmins http www opengis net sld name stroke gt 000000 lt CssParameter gt lt CssParameter xmins http www opengis net sld name stroke width gt 0 lt CssParameter gt lt Stroke gt lt Fill xmIns http www opengis net sld gt lt CssParameter xmins http www opengis net sld name fill gt daffc9 lt CssParameter gt lt Fill gt lt PolygonSymbolizer gt lt Rule gt For further styling options please refer to Appendix B Definition of symbolizing options where all implemented possibilities are listed 39 QGIS Mapserver 7 Examples 7 2 Line Symbolization 7 2 1 Creati
70. to the following visualization of the style Figure 60 Extract of a WMS layer for point symbolization If this visualization result does not turn out satisfactory the style can directly be changed in the admin sld file At the moment the point symbols are orange squares To change that symbolization to another well known name symbol exchange the WellKnownName tag with the following lt WellKnownName xmins http www opengis net sld gt star lt WellKnownName gt The result can be viewed in OGIS after a reload of the layer Note To refresh the layer visualization move the layer with the panning tool in QGIS desktop version The symbol will change consequently Figure 61 Line cap in line symbolization 46 QGIS Mapserver 7 Examples 7 3 3 Adaption to a User defined Point Symbol A user defined symbol can be visualized as well To do so the symbol has to be available in the Scalable Vector Graphics format SVG The easiest way to create such a symbol is the use of a graphics program such as Adobe Illustrator or Inkscape The graphic can be exported as a SVG file To be able to use this user created symbol it has to be copied into the SVG file inside the QGISPublishtoweb folder as shown in the screenshot below 22 symbol File Edit View Favorites Tools Help Back gt a pe Search ie Folders Address IC De Workspace OGISPublisiTowebisvalsembol ka 3 Folders gi Crossi srg 5 OGISPublishToWeb en I
71. ttp www opengis net sld gt lt Filter xmIns http www opengis net ogc gt lt PropertylsBetween xmIns http www opengis net ogc gt lt PropertyName xmlns http www opengis net ogc gt SERVICE lt PropertyName gt lt LowerBoundary xmIns http www opengis net ogc gt lt Literal xmIns http www opengis net ogc gt 6975 500 lt Literal gt lt LowerBoundary gt lt UpperBoundary xmIns http www opengis net ogc gt lt Literal xmIns http www opengis net ogc gt 13951 000 lt Literal gt lt UpperBoundary gt lt PropertyIsBetween gt lt Filter gt lt PolygonSymbolizer xmIns http www opengis net sld gt lt Stroke xmIns http www opengis net sld gt lt CssParameter xmins http www opengis net sld name stroke gt 000000 lt CssParameter gt lt CssParameter xmins http www opengis net sld name stroke width gt 1 lt CssParameter gt lt Stroke gt lt Fill xmIns http www opengis net sld gt lt CssParameter xmins http www opengis net sld name fill gt a1bb94 lt CssParameter gt lt Fill gt lt PolygonSymbolizer gt lt Rule gt lt Rule xmIns http www opengis net sld gt lt Filter xmIns http www opengis net ogc gt lt PropertylsBetween xmIns http www opengis net ogc gt lt PropertyName xmlns http www opengis net ogc gt SERVICE lt PropertyName gt lt LowerBoundary xmIns http www opengis net ogc gt lt Literal xmIns http www opengis net ogc gt 13951 000 lt L
72. und However only the admin sld file inside the qgis map server folder can be published So make sure to always copy the desired Layers into this folder O qgis wms Ordner 20 05 2009 10 45 E qgis_map_serv cgi 931 KE Ctl Datei 02 04 2009 15 42 E qqis wms server log S563 KB Textdakument 20 05 2009 10 53 SLD File if admin QKB SLD File 04 05 2009 17 02 Figure 10 Basic contents of qgis map server folder The second noticeable folder is called qgis_ wms It contains two folders called Resources and lib Inside the lib folder there are libraries for different providers An example is the sosprovider dll which enables the linking to a sensor These libraries may be extended 11 QGIS Mapserver 5 Data Processing in QGIS 5 Data Processing in QGIS Some basic steps for the use of QGIS are described here for further information please consult htto www agis org documentation html 5 1 Starting QGIS Desktop Version The structure of the downloaded and unzipped package QGISPublishtoweb looks as follows i cmake crake templates C debian doc Ditsn D images include lib mac IO ms windows i plugins python resources D scripts Osvg DO tests themes tools qqis exe qgis help exe Figure 11 Structure of package QGISPublishtoWeb Inside this package double click on the symbol QGIS exe to start QGIS desktop version 5 2 Manage Plugins To activate
73. ws 24 QGIS Mapserver lt UserStyle xmIns http www opengis net sld gt lt Name xmiIns http www opengis net sld gt Single Symbol lt Name gt lt FeatureTypeStyle xmIns http www opengis net sld gt lt Rule xmins http www opengis net sld gt lt PointSymbolizer xmIns http www opengis net sld gt lt Graphic xmIins http www opengis net sld gt lt Mark xmlns http www opengis net sld gt lt WellKnownName xmins http www opengis net sld gt rectangle lt WellKnownName gt lt Stroke xmIns http www opengis net sld gt lt CssParameter xmIns http www opengis net sld name stroke gt 000000 lt CssParameter gt lt CssParameter xmIns http www opengis net sld name stroke width gt 0 lt CssParameter gt lt Stroke gt lt Fill xmIns http www opengis net sld gt lt CssParameter xmIns http www opengis net sld name fill gt afa3a4 lt CssParameter gt lt Fill gt lt Mark gt lt Size xmins http www opengis net sld gt 2 2 lt Size gt lt Graphic gt lt PointSymbolizer gt lt Rule gt lt FeatureTypeStyle gt lt UserStyle gt 5 Data Processing in QGIS Start of style Name of style Style for feature layer Start of rule Symbolizing option Definition of stroke Definition of stroke color Definition of stroke width Definition of fill Definition of fill color End of fill End of mark Definition of size End of graphic End of symbolizing
74. xmIns http www opengis net sld gt lt WellKnownName xmins http www opengis net sld gt rectangle lt WellKnownName gt lt Stroke xmIns http www opengis net sld gt lt CssParameter xmins http www opengis net sld name stroke gt 000000 lt CssParameter gt lt CssParameter xmIns http www opengis net sld name stroke width gt 0 lt CssParameter gt lt Stroke gt lt Fill xmIns http www opengis net sld gt lt CssParameter xmIns http www opengis net sld name fill gt ffa914 lt CssParameter gt lt Fill gt lt Mark gt lt Size xmIns http www opengis net sld gt 15 lt Size gt lt Graphic gt lt PointSymbolizer gt lt Rule gt lt FeatureTypeStyle gt lt UserStyle gt lt UserLayer gt lt StyledLayerDescriptor gt To view the symbolization of this file a WMS layer can be imported in QGIS To do that the admin sld file first has to be placed in the main qgis_map_server directory as explained in chapter 5 6 Editing an admin sld file 45 QGIS Mapserver 7 Examples Note This procedure is at the moment only automatically possible with some well known name object such as circle or square Other symbols have to be manually changed by editing the admin sld file which will be explained on the next page 7 3 2 Adaption to a different Point Symbol After the described procedure this layer can be opened in QGIS with the instructions of chapter 6 1 QGIS which leads

Download Pdf Manuals

image

Related Search

Related Contents

Forno - metalúrgica roa  OWNERS I PARTS MANUAL  Furuno ETR-30N Network Card User Manual  Technical Manual - Frank`s Hospital Workshop  User Manual Adaptive Multi-Resolution Wavelet  Registro HEPA-C - Manual de Usuario - A3 - CMYK  

Copyright © All rights reserved.
Failed to retrieve file