[mapserver-commits] r8024 - in trunk/docs: howto references/cgi references/vector_data

svn at osgeo.org svn at osgeo.org
Thu Nov 20 18:52:51 EST 2008


Author: hobu
Date: 2008-11-20 18:52:51 -0500 (Thu, 20 Nov 2008)
New Revision: 8024

Added:
   trunk/docs/howto/Debian Lenny install guide.txt
   trunk/docs/howto/flash_output.txt
   trunk/docs/howto/mapserverubuntu.txt
   trunk/docs/references/cgi/mapserv.txt
   trunk/docs/references/vector_data/kml.txt
Log:
add missing ones

Added: trunk/docs/howto/Debian Lenny install guide.txt
===================================================================
--- trunk/docs/howto/Debian Lenny install guide.txt	                        (rev 0)
+++ trunk/docs/howto/Debian Lenny install guide.txt	2008-11-20 23:52:51 UTC (rev 8024)
@@ -0,0 +1,50 @@
+<p>In this post I will document my playing arround with mapserver. I'll do my best to update this as best I can, but consider this as on 'under construction status'...
+</p>
+<p>Debian Lenny comes with version 5 of mapserver, so in order to install it you just need to type in the terminal as root:
+</p>
+<p>apt-get install cgi-mapserver mapserver-bin mapserver-doc  php-mapscript python-mapscript.
+</p>
+<p>If you don't have apache2 running and configured than you should also install apache2.</p>
+
+<p>In debian cgi-scripts are install by default to /usr/lib/cgi-bin but are linked to /cgi-bin in the default install of apache2 in debian.</p>
+
+<p>The next step is to install the simple map server application from 
+<a href="http://maps.dnr.state.mn.us/mapserver_demos/workshop-5.0.zip">here</a>. After you download the zip file, extract it and copy it to /var/www/. NOTE: The extract of the file creates a folder named workshop, I changed it mapserver. Hence after renaming and copying the folder, I now have an apache root folder and which lookes likethis:</p>
+
+<p>/var/www/mapserver/</p>
+
+<p>this folder has all the demo files and can be accessed from the web-browser by typing in the adress bar:</p>
+
+<p>localhost/mapserver.</p>
+
+<p>This will lauch the first mapserver application. However, since this demo was originaly compiled for different systems, we need to edit the files a little bit.</p>
+
+<p>First we need to edit index.html to fit the setting of the debian system.</p>
+
+<p>replace lines 9-10  with the following:</p>
+
+<p>var snippet = "IMAGEPATH '/var/www/mapserver/tmp/'"; //where data is written</p>
+<p>snippet += " IMAGEURL '/mapserver/tmp/'";</p>
+
+<p>make sure you create tmp/ under mapserver/</p>
+
+<p>change line 34 to the following:</p>
+
+<p>&lt;form name="demo" method="GET" action="../cgi-bin/mapserv" </p><p>onSubmit="configure()"&gt;</p>
+
+<p>and lines 42-45 to:</p>
+
+<p>&lt;input type="hidden" name="map" value="/var/www/mapserver/itasca.map"&gt;
+&lt;input type="hidden" name="program" value="../cgi-bin/mapserv"&gt;
+&lt;input type="hidden" name="root" value="/mapserver"&gt;</p>
+
+<p>now we need to edit itasca.map to the following:</p>
+
+<p>#WMS_ONLINERESOURCE "http://localhost/mapserver/index.html".</p>
+
+<p>Now when you direct your browser to 'localhost/mapserver/index.html' you should be able to see the produced maps.</p>
+
+<p>note: originally published in my own little blog in the end of the web. 
+http://www.tabula0rasa.org/?p=109
+there a few more posts there about python and mapserver. You're most welcome to visit and comment. </p>
+

Added: trunk/docs/howto/flash_output.txt
===================================================================
--- trunk/docs/howto/flash_output.txt	                        (rev 0)
+++ trunk/docs/howto/flash_output.txt	2008-11-20 23:52:51 UTC (rev 8024)
@@ -0,0 +1,383 @@
+..
+
+:Authors: Yewondwossen Assefa, Jeff McKenna
+:Last Updated: 2008/07/15
+
+--------
+
+..  The next heading encountered becomes our H2
+..
+
+.. sectnum::
+
+.. contents:: Table of Contents
+    :depth: 3
+    :backlinks: top
+
+
+Introduction
+============
+
+Since MapServer 4.0, MapServer can output Flash files, in SWF format (or
+"Shockwave Flash Format").  The following document outlines how to enable
+Flash output in MapServer.
+
+
+Links to Flash-Related Information
+----------------------------------
+
+- `Open Source Flash Viewer`_
+- `Flash maps demo`_
+
+Installing MapServer with Flash Support
+=======================================
+
+To check that your mapserv executable includes Flash support, use the "-v"
+command-line switch and look for "OUTPUT=SWF".
+
+::
+
+  $ ./mapserv -v
+  MapServer version 5.2.0-rc1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
+  OUTPUT=PDF OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG
+  SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
+  SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER
+  SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS
+  SUPPORTS=GEOS SUPPORTS=RGBA_PNG INPUT=JPEG INPUT=POSTGIS
+  INPUT=ORACLESPATIAL INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
+
+
+Using Pre-compiled Binaries
+---------------------------
+
+Windows users can use `MS4W`_, which supports SWF output.
+
+Compiling MapServer with Flash Support
+--------------------------------------
+
+The library chosen to output SWF files is the `Ming library`_.  Ming is a C
+library for generating SWF ("Flash") format movies, and it contains a set of wrappers
+for using the library from C++ and popular scripting languages like PHP,
+Python, and Ruby.
+
+
+Building on Windows
+*******************
+
+- download the `Ming library`_ (the version currently supported is 0.2a)
+- as of Ming 0.3 there was no makefile for Windows available in the distribution yet,
+  but you can download a MS VC++ makefile (makefile.vc) from `here`_ (contains makefile
+  and also libming.lib)
+- copy makefile.vc under the src directory (ming-0.2/src)
+- execute:
+
+  ::
+
+    nmake /f makefile.vc
+
+- at this point you should have a libming.lib that will be linked with MapServer
+- edit the nmake.opt in your MapServer directory and uncomment the MING=-DUSE_MING_FLASH
+  flag, and point MING_DIR to your Ming directory.
+- build MapServer as usual
+
+Building on Unix
+****************
+
+Use the "--with-ming" configure flag to enable MING support on Unix. "--with-ming=dir"
+will try to find the include files and library in the indicated directory.
+
+::
+
+  Note: compiling Mapserver4.4.2 with flash support (mingbeta version 0.3) requires
+  the -DMING_VERSION_03 option otherwise the make fails. This option should be included
+  in the configure.in after -DUSE_MING_FLASH as below:
+
+     MING ENABLED= "-DUSE_MING_FLASH -DMING_VERSION_03"
+
+How to Output SWF Files from MapServer
+======================================
+
+SWF output is specified by using the OUTPUTFORMAT object in the `mapfile`_.
+There are 2 possible output types:
+
+1. A single movie containing the raster output for all the layers. To enable this,
+   declare the following in the map file:
+
+   ::
+
+      OUTPUTFORMAT
+        NAME swf
+        MIMETYPE "application/x-shockwave-flash"
+        DRIVER swf
+        IMAGEMODE PC256
+        FORMATOPTION "OUTPUT_MOVIE=SINGLE"
+      END
+
+2. A movie for every layer (vector movies for vector layers and raster
+   movies for raster layers).  To enable this,
+   declare the following in the map file:
+
+   ::
+
+      OUTPUTFORMAT
+        NAME swf
+        MIMETYPE "application/x-shockwave-flash"
+        DRIVER swf
+        IMAGEMODE PC256
+        FORMATOPTION "OUTPUT_MOVIE=MULTIPLE"
+      END
+
+
+Other OutputFormat Options
+--------------------------
+
+- **FORMATOPTION "FULL_RESOLUTION=FALSE"**
+
+  The FULL_RESOLUTION applies only for vector layers. If set to FALSE,
+  filtering will be applied to the vector elements. It results in a smaller
+  SWF file. The default value is TRUE.
+
+- **FORMATOPTION "LOAD_AUTOMATICALLY=OFF"**
+
+  Setting this option to OFF will not load the SWF files for each layer.
+  The default value is ON.
+
+Composition of the Resulting SWF Files
+--------------------------------------
+
+Several SWF Files will be produced from a single map file: there will be one SWF
+file for each layer defined in the map file and one 'main' SWF file containing
+critical information on the map file and the layers produced.
+
+- The 'main' SWF File will contain Action Script (AS) code that gives critical
+  information on the map file and the SWF layers produced. Basically there will
+  be an object called mapObj containing the height, width, extent, scale, number
+  of layers, etc. Here is an example (in AS) of the contents of this main movie:
+
+  ::
+
+    mapObj = new Object ();
+    mapObj.name = "DEMO_SWF";
+    mapObj.width = 400;
+    mapObj.height = 300;
+    mapObj.extent = "-2594561.353333,3467361.353333,3467361.353333,3840000.000000"; ;
+    mapObj.numlayers = 4;
+    mapObj.layers = new Array ();
+    function LayerObj (name, type, fullname, relativename) {
+    this.name = name;
+    this.type = type;
+    this.fullname = fullname;
+    this.relativename = relativename;
+    }
+    mapObj.layers[0] = new LayerObj ("park", "2", "c:/tmp/ms_tmp/102389536132841_layer_0.swf", "102389536132841_layer_0.swf");
+    mapObj.layers[1] = new LayerObj ("popplace", "4", "c:/tmp/ms_tmp/102389536132841_layer_1.swf", "102389536132841_layer_1.swf");
+    mapObj.layers[2] = new LayerObj ("rail", "1", "c:/tmp/ms_tmp/102389536132841_layer_2.swf", "102389536132841_layer_2.swf");
+    mapObj.layers[3] = new LayerObj ("road", "1", "c:/tmp/ms_tmp/102389536132841_layer_3.swf", "102389536132841_layer_3.swf");
+
+  This example is produced based on a mapfile with two layers defined in it.
+  We create a layer class object containing useful information on a layer. The parameters are:
+
+  - Name : the name found in the map file
+  - Type : the type of layer ( 0 = Point Layer; 1=Line; 2=Polygon; 3=Raster; 4=Annotation; 6=Circle)
+  - Fullname : Full name of the file with path included
+  - Relative name : Relative Name
+
+  For example you can use mapObj.layers[0].name to extract the name of the first layer.
+
+  Note: All map parameters from Mapserver are not exported at this time. We should
+  come up with a list of information of what we want to output. Note that this information
+  can be used in a Flash application to load the SWF file, to build a legend, to build a
+  scale bar, etc.
+
+- SWF Files for each layer
+
+  Each layer defined in the mapfile will have an associated SWF file created. The names of
+  these SWF files are based on the name of the main file with an addition of 'layer_X'
+  at the end of the name (where X is the layer index).
+
+  These SWF files will contain vector and raster data as well as some Action Script
+  depending on the layer and some configurations in the map file. We will see these
+  configurations in detail in the following section.
+
+Exporting Attributes
+--------------------
+
+Exporting attributes works on a layer basis (it is only available for Vector Layers).
+To be able to export attributes to the SWF files, you have to define a metadata item called
+SWFDUMPATTRIBUTES in the layer section of the mapfile. Here is an example :
+
+::
+
+  ...
+  LAYER
+  NAME park
+  METADATA
+    "DESCRIPTION""Parks"
+    "RESULT_FIELDS" "NAME_E YEAR_EST AREA_KMSQ"
+    "SWFDUMPATTRIBUTES" "NAME_E,AREA_KMSQ "
+  END
+  TYPE POLYGON
+  STATUS ON
+  DATA park
+  ...
+
+In the above example, the values for the attributes NAME_E and AREA_KMSQ will be exported
+for each element in the layer.
+
+The resulting SWF File will have the values of these attributes (written in Action Script).
+Here is an example related to the above layer:
+
+::
+
+  nAttributes= 2;
+  Attributes = new Array();
+  Attributes[0] = "NAME_E";
+  Attributes[1] = "AREA_KMSQ";
+  Element = new Array ();
+  Element[0] = new Array();
+  Element[0][0] = "Ellesmere Island National Park Reserve";
+  Element[0][1] = "1500";
+  Element[1][0] = " Aulavik National park";
+  Element[1][1] = "1500";
+
+Events and Highlights
+---------------------
+
+Here is what is currently implemented concerning events (events here refer to mouse events
+happening on an element. The available events are MOUSEUP, MOUSEDOWN, MOUSEOVER, MOUSEOUT):
+
+- Events are only available for layers that have defined attributes exported (using
+  SWFDUMPATTRIBUTES). This is like defining that a certain layer is queryable.
+- When a mouse event happens on one of the elements, there is an Action Script call
+  that is made: _root.ElementSelecetd(LayerId, ShapeId, Event) . The Flash application
+  who wants to receive these events should define the function ElementSelected and
+  use the information received to do actions like retrieving the attribute values from
+  the specific SWF for the specified shape and display it.
+
+In order to have highlighting, it has to be defined when the SWF is produced (basically
+highlighting means that the shape is redrawn using a different color).
+
+As of MapServer 5.0, highlighting is available on queryable layers by using the
+QueryMap object in the map file to extract the color and do a highlight when on MOUSEOVER.
+The current implementation will highlight all objects that are in a layer that uses
+SWFDUMPATTRIBUTES, using the COLOR set in the QueryMap object in the mapfile.
+
+Before MapServer 5.0, all objects that are in a layer that uses SWFDUMPATTRIBUTES are
+highlighted using a red color.
+
+Fonts
+-----
+
+Ming uses a special type of font called FDB files. It does not yet support Truetype fonts.
+Please refer to ming documentation on how to `produce FDB files`_.
+
+Outputting Raster SWF for Vector Layers
+---------------------------------------
+
+One mechanism would be to use the metadata for layer objects to define a raster output
+for vector layers. We could use something like "SWFOUTPUT" "RASTER".  If this sounds desirable,
+please file an enhancement `ticket`_ with this request, specifying the "Output-SWF" component.
+
+What is Currently Supported and Not Supported
+=============================================
+
+1. Vector layers
+
+   - Layer Point (case MS_LAYER_POINT) : *done*
+
+     - msDrawMarkerSymbol
+     - msDrawLabel
+
+   - Layer line (case MS_LAYER_LINE) : *done*
+
+     - msDrawLineSymbol
+     - msDrawLabel
+
+   - Layer circle ( case MS_LAYER_CIRCLE) : *not done* (should be done easily but missing data for testing)
+
+     - omsCircleDrawLineSymbol
+
+     - omsCircleDrawShadeSymbol
+
+   - Layer annotation (case MS_LAYER_ANNOTATION): *done*
+
+     - omsDrawMarkerSymbol
+     - omsDrawLabel
+
+   - Layer Polygon (MS_SHAPE_POLYGON): *done*
+
+     - omsDrawShadeSymbol
+     - omsDrawLineSymbol
+     - omsDrawLabel
+
+   - Vector Low Level functions
+
+     - omsDrawMarkerSymbol
+
+       - case(MS_SYMBOL_TRUETYPE) : *done*
+       - case(MS_SYMBOL_PIXMAP) : *done*
+       - case(MS_SYMBOL_ELLIPSE) : *done*
+       - case(MS_SYMBOL_VECTOR) : *done*
+
+     - omsDrawLineSymbol
+
+       - case : simple line : *done*
+
+   - drawing with the symbols : *not done*
+
+     - omsDrawShadeSymbol
+
+       - case : solid fill polygon : *done*
+       - case : filled with symbols : cannot be implemented for now (tried to create
+         a GD image to fill the shape but files created were huge)
+
+     - omsCircleDrawLineSymbol : *not done*
+     - omsCircleDrawShadeSymbol : *not done*
+     - omsDrawLabel : *done*
+     - omsDrawLabelCache : *done*
+     - obillboard (shadow for texts) : *not done*
+
+2. Raster Layer
+
+   - msDrawRasterLayer: *done*
+
+3. WMS Layer
+
+   - msDrawWMSLayer: *done*
+
+4. Surround components (Legend, scalebar) : *not supported*
+
+About This Document
+===================
+
+Copyright Information
+---------------------
+
+Copyright (c) 2008, Yewondwossen Assefa, Jeff McKenna.
+
+This documentation is covered by the same Open Source license as the MapServer
+software itself.  See MapServer's `License and Credits`__ page for the complete
+text.
+
+__ http://mapserver.gis.umn.edu/License
+
+Disclaimer
+----------
+
+No liability for the contents of this document can be accepted.
+Use the concepts, examples and other content at your own risk.
+As this is a new edition of this document, there may be errors
+and inaccuracies that may be damaging to your system.
+Although this is highly unlikely, the author(s) do not take any
+responsibility for that:  proceed with caution.
+
+.. #### rST Link Section ####
+
+.. _`Open Source Flash Viewer`: http://aris.cseas.kyoto-u.ac.jp/fmv/
+.. _`Flash maps demo`: http://mapserver.gis.umn.edu/docs/tutorial/demoflashmap/demoflashmaps
+.. _`MS4W`: http://www.maptools.org/ms4w/
+.. _`Ming library`: http://www.libming.org/
+.. _`here`: http://www2.dmsolutions.ca/mapserver/dl/ming-0.2a.zip
+.. _`mapfile`: http://mapserver.gis.umn.edu/docs/reference/mapfile/outputformat
+.. _`Produce FDB files`: http://www.opaque.net/wiki/index.php?MingFAQ
+.. _`ticket`: http://trac.osgeo.org/mapserver/
\ No newline at end of file

Added: trunk/docs/howto/mapserverubuntu.txt
===================================================================
--- trunk/docs/howto/mapserverubuntu.txt	                        (rev 0)
+++ trunk/docs/howto/mapserverubuntu.txt	2008-11-20 23:52:51 UTC (rev 8024)
@@ -0,0 +1,51 @@
+It seems that the Mapserver binary shipped with Ubuntu 8.04 doesn't support the AGG renderer, and the libagg Ubuntu package doesn't supply the required .so version of the library.  But it's quite easy to get AGG support, here's how I did it::
+
+  apt-get build-dep libagg-dev
+  apt-get source libagg-dev
+
+These steps create make sure the AGG build dependencies are installed, and then retrieve the AGG source into a directory within the current directory.::
+
+  cd <agg-dir>
+  . autogen.sh
+  ./configure --prefix=/usr
+  make
+  sudo make install
+
+That installs AGG with an .so format for the library.
+
+Download latest mapserver, get build dependencies for it, and build.::
+
+  apt-get build-dep mapserver
+  wget http://download.osgeo.org/mapserver/mapserver-5.2.0.tar.gz
+  tar -xzf mapserver-5.2.0.tar.gz
+  cd mapserver-5.2.0
+  ./configure           \
+  --prefix=/usr         \
+  --with-pdf            \
+  --with-freetype       \
+  --with-agg            \
+  --with-eppl           \
+  --with-proj           \
+  --with-threads        \
+  --with-sde            \
+  --with-geos           \
+  --with-ogr            \
+  --with-gdal           \
+  --with-tiff           \
+  --with-postgis        \
+  --with-mygis          \
+  --with-wfs            \
+  --with-wcs            \
+  --with-wmsclient      \
+  --with-wfsclient      \
+  --with-sos            \
+  --with-fribidi-config \
+  --with-gd
+
+  make
+  sudo make install
+  cd mapscript/python
+  python setup build --prefix=/usr
+  sudo python setup install
+
+That did it for me.

Added: trunk/docs/references/cgi/mapserv.txt
===================================================================
--- trunk/docs/references/cgi/mapserv.txt	                        (rev 0)
+++ trunk/docs/references/cgi/mapserv.txt	2008-11-20 23:52:51 UTC (rev 8024)
@@ -0,0 +1,18 @@
+The CGI interface can be tested at the commandline by using the "QUERY_STRING" switch, such as:
+
+::
+
+  mapserv "QUERY_STRING=map=/ms4w/apps/gmap/htdocs/gmap75.map&mode=map"
+
+To suppress the HTTP headers, you can use the "-nh" switch, such as:
+
+::
+
+  mapserv -nh "QUERY_STRING=map=/ms4w/apps/gmap/htdocs/gmap75.map&mode=map"
+
+To save the output into an image file, use the pipe command such as:
+
+::
+
+  mapserv -nh "QUERY_STRING=map=/ms4w/apps/gmap/htdocs/gmap75.map&mode=map" > test.png
+

Added: trunk/docs/references/vector_data/kml.txt
===================================================================
--- trunk/docs/references/vector_data/kml.txt	                        (rev 0)
+++ trunk/docs/references/vector_data/kml.txt	2008-11-20 23:52:51 UTC (rev 8024)
@@ -0,0 +1,112 @@
+Keyhole Markup Language (KML)
+-------------------------------
+
+Keyhole Markup Language (KML) is an XML-based language for managing the display of 3D geospatial data.
+
+
+Data Access / Connection Method
+---------------------------------
+
+KML access is available through OGR. See the OGR `driver page`_
+for specific driver information.  Read support was initially added to 
+GDAL/OGR version 1.5.0.
+
+.. _`driver page`: http://www.gdal.org/ogr/drv_kml.html
+
+The CONNECTION parameter must include the kml extension, and the DATA parameter
+should be the name of the layer.
+
+::
+
+  CONNECTIONTYPE ogr
+  CONNECTION "myplaces.kml"
+  DATA "layername" 
+
+OGRINFO Examples
+----------------
+
+First you should make sure that your GDAL/OGR build contains the "KML" driver, by using the '--formats' command:
+
+::
+
+  >ogrinfo --formats
+     Loaded OGR Format Drivers:
+     ...
+     -> "GML" (read/write)
+     -> "GPX" (read/write)
+     -> "KML" (read/write)
+     ...
+
+If you don't have the driver, you might want to try the `FWTools`_ or `MS4W`_
+packages, which include the driver.
+
+.. _`FWTools`: http://fwtools.maptools.org/
+.. _`MS4W`: http://www.maptools.org/ms4w/
+
+Once you have the KML driver you are ready to try an ogrinfo command on your
+file to get a list of available layers:
+
+::
+
+  >ogrinfo myplaces.kml
+     INFO: Open of `myplaces.kml'
+     using driver `KML' successful.
+     1: Layer #0 (Point)
+
+Now use ogrinfo to get information on the structure of the layer:
+
+::
+
+  >ogrinfo fountains-hotel.kml "Layer #0" -summary
+    Had to open data source read-only.
+    INFO: Open of `fountains-hotel.kml'
+      using driver `KML' successful.
+
+    Layer name: Layer #0
+    Geometry: Point
+    Feature Count: 1
+    Extent: (18.424930, -33.919627) - (18.424930, -33.919627)
+    Layer SRS WKT:
+    GEOGCS["WGS 84",
+        DATUM["WGS_1984",
+          SPHEROID["WGS 84",6378137,298.257223563,
+            AUTHORITY["EPSG","7030"]],
+        AUTHORITY["EPSG","6326"]],
+      PRIMEM["Greenwich",0,
+        AUTHORITY["EPSG","8901"]],
+      UNIT["degree",0.01745329251994328,
+        AUTHORITY["EPSG","9122"]],
+      AUTHORITY["EPSG","4326"]]
+    Name: String (0.0)
+    Description: String (0.0)
+
+
+Mapfile Example
+---------------
+
+::
+
+   LAYER
+     NAME kml_places
+     TYPE POINT
+     STATUS DEFAULT
+     CONNECTIONTYPE OGR
+     CONNECTION "kml/fountains-hotel.kml"
+     DATA "Layer #0"
+     LABELITEM "NAME"
+     CLASS
+       NAME "My Places"
+       STYLE
+         COLOR 250 0 0
+         OUTLINECOLOR 255 255 255
+         SYMBOL 'circle'
+         SIZE 6
+       END
+     LABEL
+       SIZE TINY
+       COLOR 0 0 0
+       OUTLINECOLOR 255 255 255
+       POSITION AUTO
+     END      
+    END
+  END
\ No newline at end of file



More information about the mapserver-commits mailing list