[Gfoss] kml (map)server

Alessandro Pasotti ale.pas at tiscali.it
Fri Jul 6 13:10:32 CEST 2007


Ciao,

qualcuno ha voglia di "sporcarsi" le mani in attesa di un vero supporto kml in 
mapserver?


Allego il README.
-----------------------------------------


KML mapserver wrapper
-------------------------------------

* What is this thing?
  this is a php_mapscript wrapper around UNM Mapserver

* Requirements
  PHP5 with simplexml and php_mapscript

* Configuration
  Configuration is done through CGI-style calls and through some optional 
metadata in the mapfile

  METADATA:
  RESULT_FIELDS                # from which field to take the name for the 
feature
                               # defaults to the first field

  BALOON_TEMPLATE              # if present, this is used for placemark 
features
                               # tooltip. Parameters surrounded by "%" char 
are substituted
                               # with real values from the corresponding field 
for the feature

  DESCRIPTION                  # All those metadata are searched (in this 
order) to get a layer
  OWS_TITLE                    # description
  WFS_TITLE
  WMS_TITLE


  CGI-PARAMETERS:
    * - request     = string - optional - request type (OGC WFS like)
    * - map         = string - required - path to mapfile
    * - typename    = string - optional - (can be a csv list) - layer name(s), 
if empty, all layers are returned
    * - filter      = string - optional - filter encoding (single layer 
requests only)
    * - bbox        = string - optional - standard bbox specification (Not yet 
implemented)
    * - encoding    = string - optional - default to ISO-8859-1

* Filters
  Only PropertyIsEqualTo and PropertyIsLike are supported ATM.

* Encoding
  kml is UTF-8, mapfile and attributes could have other encodings, you can set 
encoding via request parameter, otherwise ISO-8859-1 is used as default.

* Raster support
  Raster layer are supported as standard WMS network links, it is necessary to 
add EPSG:4326 to WMS_SRS metadata on all mapfile layers.
  Mapfile must be correctly configured as WMS server (i.e. all required 
metadata must be set).

* KMZ compressed output
  Not yet finished :)

* Styles and classes
  There is limited support for classes and style:
    * only one style for each class is parsed, if you have multiple styles in 
one class, the values of the last one are used
    * only color, outlinecolor, backgroundcolor, symbol, size and width are 
parsed


EXAMPLE CALLS
------------------------------------
Single layer:
http://localhost/kmlserver/service.php?map=/map/mapfile-ogc.map&typename=sfumo,vngeo_ospitalita

Two layers (one raster and one vector):
http://localhost/kmlserver/service.php?map=/map/mapfile-ogc.map&typename=vngeo_ospitalita

All layers as network links:
http://localhost/kmlserver/service.php?map=/map/mapfile-ogc.map

Single layer with filter:
http://localhost/kmlserver/service.php?map=/map/mapfile-ogc.map&typename=comuni&filter=<Filter><PropertyIsLike><PropertyName>toponimo</PropertyName><Literal>Riederalp</Literal></PropertyIsLike></Filter>


ICON SERVER
-------------------------------------
Returns a PNG icon for a give poin layer/class combination
Example calls:
http://localhost/kmlserver/symbolservice.php?map=/map/mapfile-ogc.map&typename=vngeo_ospitalita&class=Alberghi

If you want transparent icons, set PNG output format to RGBA and IMAGECOLOR to 
the transparent color



-- 
Alessandro Pasotti
itOpen - "Open Solutions for the Net Age"
w3:  www.itopen.it
Linux User# 167502



More information about the Gfoss mailing list