ZOO-Project
Functions
service_internal_ms.h File Reference
#include <sys/stat.h>
#include "service_internal.h"
#include "service.h"
#include "cpl_conv.h"
#include "cpl_multiproc.h"
#include "ogr_api.h"
#include "gdal.h"
#include "ogr_srs_api.h"
#include "ulinet.h"
#include <mapserver.h>

Go to the source code of this file.

Functions

mapgetCorrespondance ()
 Get a list of configuration keys having a corresponding mandatory ows_*. More...
 
void setMapSize (maps *output, double minx, double miny, double maxy, double maxx)
 Add width and height keys to an output maps containing the maximum width and height for displaying the full data extent. More...
 
void setReferenceUrl (maps *m, maps *tmpI)
 Add a Reference key to an output containing the WMFS/WFS/WCS request for accessing service result. More...
 
void setSrsInformations (maps *output, mapObj *m, layerObj *myLayer, char *pszProjection)
 Set projection for a layer in a MAPFILE using Authority Code and Name if available or fallback to proj4 definition if available or fallback to default EPSG:4326. More...
 
void setMsExtent (maps *output, mapObj *m, layerObj *myLayer, double minX, double minY, double maxX, double maxY)
 Set the MAPFILE extent, the the ows_extent for the layer, add wms_extent and wfs_extent to the output maps and call setMapSize. More...
 
int tryOgr (maps *conf, maps *output, mapObj *m)
 Try to open a vector output and define the corresponding layer in the MAPFILE. More...
 
int tryGdal (maps *conf, maps *output, mapObj *m)
 Try to open a raster output and define the corresponding layer in the MAPFILE. More...
 
void outputMapfile (maps *conf, maps *outputs)
 Create a MapFile for WMS, WFS or WCS Service output. More...
 

Function Documentation

map* getCorrespondance ( )

Get a list of configuration keys having a corresponding mandatory ows_*.

Map composed by a main.cfg maps name as key and the corresponding MapServer Mafile Metadata name to use see doc from here :

Returns
a new map containing a table linking a name of a configuration key to a corresponding mandatory ows_* keyword (ie. "fees" => "ows_fees").
void outputMapfile ( maps conf,
maps outputs 
)

Create a MapFile for WMS, WFS or WCS Service output.

Parameters
confthe conf maps containing the main.cfg settings
outputsa specific output maps

First store the value on disk

Set metadata extracted from main.cfg file maps

Set a ows_rootlayer_title,

Enable all the WXS requests using ows_enable_request see http://mapserver.org/trunk/development/rfc/ms-rfc-67.html

void setMapSize ( maps output,
double  minx,
double  miny,
double  maxx,
double  maxy 
)

Add width and height keys to an output maps containing the maximum width and height for displaying the full data extent.

Restriction to an image having a size of 640x480 (width * height)

Parameters
output
minxthe lower left x coordinate
minythe lower left y coordinate
maxxthe upper right x coordinate
maxythe upper right y coordinate
void setMsExtent ( maps output,
mapObj *  m,
layerObj *  myLayer,
double  minX,
double  minY,
double  maxX,
double  maxY 
)

Set the MAPFILE extent, the the ows_extent for the layer, add wms_extent and wfs_extent to the output maps and call setMapSize.

Parameters
outputthe specific output
mthe mapObj
myLayerthe layerObj
minXthe lower left x coordinate
minYthe lower left y coordinate
maxXthe upper right x coordinate
maxYthe upper right y coordinate
See also
setMapSize
void setReferenceUrl ( maps m,
maps tmpI 
)

Add a Reference key to an output containing the WMFS/WFS/WCS request for accessing service result.

Parameters
mthe conf maps containing the main.cfg settings
tmpIthe specific output maps to add the Reference key
void setSrsInformations ( maps output,
mapObj *  m,
layerObj *  myLayer,
char *  pszProjection 
)

Set projection for a layer in a MAPFILE using Authority Code and Name if available or fallback to proj4 definition if available or fallback to default EPSG:4326.

Parameters
outputthe output maps
mthe opened mapObj
myLayerthe layerObj
pszProjectiona char* containing the SRS definition in WKT format
int tryGdal ( maps conf,
maps output,
mapObj *  m 
)

Try to open a raster output and define the corresponding layer in the MAPFILE.

Parameters
confthe conf maps containing the main.cfg settings
outputthe specific output maps
mthe mapObj

Try to open the DataSource using GDAL

Add a new layer set name, data

Set Map Size to the raster size

Set projection using Authority Code and Name if available or fallback to proj4 definition if available or fallback to default EPSG:4326

Set extent

Extract information about available bands to set the bandcount and the processing directive

Name available Bands

Loops over metadata information to setup specific information

Classify one band raster pixel value using regular interval

Create a new class

Set class name

Set expression

Set color

int tryOgr ( maps conf,
maps output,
mapObj *  m 
)

Try to open a vector output and define the corresponding layer in the MAPFILE.

Parameters
confthe conf maps containing the main.cfg settings
outputthe specific output maps
mthe mapObj

Try to open the DataSource using OGR

Try to load the file as ZIP

Add a new layer set name, data

Detect the Geometry Type or use Polygon

Detect spatial reference or use WGS84

Detect the FID column or use the first attribute field as FID

Apply msStyle else fallback to the default style

Set style

Set specific style depending on type