wiki:MapGuideRfc103

Version 4 (modified by christinebao, 14 years ago) ( diff )

--

MapGuide RFC 103 - Client needs to get WMS/WFS config info

This page contains an change request (RFC) for the MapGuide Open Source project. More MapGuide RFCs can be found on the RFCs page.

Status

RFC Template Version(1.0)
Submission Date(July 13, 2010)
Last Modified(Christine Bao Tue July 13 05:23:00 2010)
AuthorChristine Bao
RFC StatusCancelled
Implementation StatusNot Implemented
Proposed Milestone2.3
Assigned PSC guide(s)Tom Fukushima
Voting History

Overview

This RFC exposes GetDocument() API through HTTP Handler to allow client such as Studio to access WMS/WFS configuration file.

Motivation

When user uses client application such as Studio to publish WMS/WFS, (s)he wants to use some customized EPSG code which is defined in configuration file. For example, user can define an EPSG code mapping to a WKT if this EPSG code is not supported by MapGuide's coordinate system.

<!-- This definition allows a site to override the behavior of -->
 <!-- the SRS= parameter of requests.                           -->
 <!-- Add translate elements here to map any particularly       -->
 <!-- troublesome SRS to some appropriate WKT.                  -->
 <Define item="SRS.WKT.map">
  <!-- This example fixes a problem with EPSG:21781 not
       finding the WKT for EPSG:21781 in the CS library.
  -->
  <translate from="EPSG:21781">PROJCS["CH1903.LV03/01",GEOGCS["LLCH1903",DATUM["CH-1903",SPHEROID["BESSEL",6377397.155,299.15281535],TOWGS84[660.0770,13.5510,369.3440,0.804816,0.577692,0.952236,5.66000000]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Swiss_Oblique_Cylindrical"],PARAMETER["false_easting",600000.000],PARAMETER["false_northing",200000.000],PARAMETER["latitude_of_origin",46.95240555555556],PARAMETER["central_meridian",7.43958333333333],UNIT["Meter",1.00000000000000]]</translate>

 </Define>

</Definitions>

This EPSG code should be available in Studio for user to choose, however there is no way to get the config infomation so far. This RFC will provide a way to read WMS/WFS config file in client.

Proposed Solution

There is an API in ServerAdminService which can get the information.

   MgByteReader* GetDocument(CREFSTRING identifier);


It's not published through HTTP. A solution is to expose it through HTTP by adding HttpGetDocument in HttpHandler.

#ifndef _S_GET_DOCUMENT_H
#define _S_GET_DOCUMENT_H

class MgHttpGetDocument : public MgHttpRequestResponseHandler
{
    HTTP_DECLARE_CREATE_OBJECT()

public:
    /// <summary>
    /// Initializes the common parameters of the request.
    /// </summary>
    /// <param name="name">Input
    /// MgHttpRequest
    /// This contains all the parameters of the request.
    /// </param>
    /// <returns>
    /// nothing
    /// </returns>
    MgHttpGetDocument(MgHttpRequest *hRequest);

    /// <summary>
    /// Executes the specific request.
    /// </summary>
    /// <param name="hResponse">Input
    /// This contains the response (including MgHttpResult and StatusCode) from the server.
    /// </param>
    void Execute(MgHttpResponse& hResponse);

private:

    STRING m_identifier;

};

#endif


Then client can send HTTP request to get the document, for example: http://<IP>/mapguide2011/mapagent/mapagent.fcgi?Operation=GetDocument&Version=1.0.0&Identifier=Wms:OgcWmsService.config

There are discussions about exposing SetDocument() also. However it will not be added in this RFC because:

  1. It doesn't make sense for Studio to update server side configurations. If user wants to do so, (s)he needs to use Server Admin which requires Administrator privilege.
  2. Even SetDocument() is exposed to Studio, it can't take effect untill server is restarted.
  3. If SetDocument() is published through Http handler, it may be used by low level privilege account.

Cancel this RFC:
New coordinate system library has improved to support complete set of EPSG code, and user doesn't need to define EPSG code mapping in configuration file any more. This RFC is not necessary.

Implications

This new added API won't affect existing application.

Test Plan

Test publish WMS/WFS in Studio, checking the customized EPSG code is available.

Funding/Resources

Supplied by Autodesk.

Note: See TracWiki for help on using the wiki.