wiki:MapGuideRfc6

Version 15 (modified by tonyfang, 17 years ago) ( diff )

--

MapGuide RFC 6 - Overriding Coordinate Systems in Feature Sources

This page contains a 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 DateFebruary 6, 2007
Last ModifiedTony Fang Timestamp
AuthorTony Fang
RFC Statusdraft
Implementation Statuspending
Proposed Milestone1.2
Assigned PSC guide(s)(when determined)
Voting History(vote date)
+1
+0
-0
-1

Overview

In the feature source, there is an optional tag called SupplementalSpatialContextInfo. This can contain a SpatialContextType defining a coordinate system override. If an entry exists for a given Spatial Context, then the specified coordinate system override will be used. The coordinate system override will be given preference over the coordinate system defined in the data.

Previously, the SupplementalSpatialContextInfo was used only for data containing spatial contexts with undefined coordinate systems. The SupplementalSpatialContextInfo would allow a coordinate system to be specified for a given spatial context. The SupplementalSpatialContextInfo can now be used to override coordinate systems for all spatial contexts in a feature source -- regardless of whether it contains a coordinate system or not.

Motivation

If a feature source geometry contains an incorrect coordinate system or does not have a coordinate system defined, this provides a convenient way to change the coordinate system without having to change the data of the feature source.

MapGuide can only deal with spatial data. If the data does not contain a coordinate system, the data cannot be used. Changing the behaviour to allow the specification of a coordinate system override allows you to use data that you may not otherwise.

Proposed Solution

The schema FeatureSource-1.0.0.xsd does not change. SupplementalSpatialContextInfo already exists in the schema. The schema documentation will be updated to reflect the new behaviour in the server.

<xs:element name="SupplementalSpatialContextInfo" type="SpatialContextType" minOccurs="0" maxOccurs="unbounded">
  <xs:annotation>
    <xs:documentation>Additional information for a spatial context when the coordinate system is overridden.
    </xs:documentation>
  </xs:annotation>
</xs:element>

When the server returns the data for a given feature source. it will check for entries in the SupplementalSpatialContextInfo. If there is a spatial context containing a coordinate system override, then that is the coordinate system used for the data.

Here is a feature source containing a coordinate system override:

<FeatureSource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:noNamespaceSchemaLocation="FeatureSource-1.0.0.xsd">
  <Provider>OSGeo.SDF</Provider>
  <Parameter>
    <Name>File</Name>
    <Value>%MG_DATA_FILE_PATH%CENTLINES.sdf</Value>
  </Parameter>
  <Parameter>
    <Name>ReadOnly</Name>
    <Value>TRUE</Value>
  </Parameter>
  <SupplementalSpatialContextInfo>
    <Name>LL84</Name>
    <CoordinateSystem>PROJCS["CANA83-3TM114",GEOGCS["CANA83-3TM114",DATUM["NAD 83",SPHEROID["GRS 80",6378137,298.25722210089],TOWGS84[0,0,0,0,0,0,0]],PRIMEM["Greenwich",0],UNIT["Degrees", 0.0174532925199433]],PROJECTION["Transverse Mercator"],PARAMETER["central_meridian", -114],PARAMETER["latitude_of_origin", 0],PARAMETER["scale_factor", 0.9999],PARAMETER["false_easting", 0],PARAMETER["false_northing", 0],UNIT["Meter", 1]]</CoordinateSystem>
  </SupplementalSpatialContextInfo>
</FeatureSource>

The data in this feature source (CENTLINES.sdf) contains a spatial context called LL84. The coordinate system defined for that spatial context is:

GEOGCS["LL84",DATUM["WGS84",SPHEROID["WGS84",6378137.000,298.25722293]],PRIMEM["Greenwich",0],UNIT["Degree",0.01745329251994]]

But the coordinate system has been overridden with:

PROJCS["CANA83-3TM114",GEOGCS["CANA83-3TM114",DATUM["NAD 83",SPHEROID["GRS 80",6378137,298.25722210089],TOWGS84[0,0,0,0,0,0,0]],PRIMEM["Greenwich",0],UNIT["Degrees", 0.0174532925199433]],PROJECTION["Transverse Mercator"],PARAMETER["central_meridian", -114],PARAMETER["latitude_of_origin", 0],PARAMETER["scale_factor", 0.9999],PARAMETER["false_easting", 0],PARAMETER["false_northing", 0],UNIT["Meter", 1]]

A new API method will be added to the Feature service. This new GetSpatialContexts API method is an overload of the previous GetSpatialContexts API method. It contains an additional argument: bIgnoreOverrides.

virtual MgSpatialContextReader* MgFeatureService::GetSpatialContexts(MgResourceIdentifier *resource, 
                                                                     bool bActiveOnly, 
                                                                     bool bIgnoreOverrides);

Gets all of the spatial contexts available in the feature source or just the active one. 
This behaves exactly the same as the previous GetSpatialContexts method when ignoreOverrides is set to false. 
If ignoreOverrides is set to true, coordinate system overrides specified in the SupplementalSpatialContextInfo are ignored.

Remarks:
    The FdoSpatialContextList XML schema contains a specification of the content of the spatial context information returned in the MgSpatialContextReader object.
 
Parameters:
    	resource 	 (MgResourceIdentifier) A resource identifier identifying a feature source in the repository.
    	bActiveOnly 	 (boolean/bool) If true, the return value contains only the active spatial context. If false, the return value contains all of the available spatial contexts.
        bIgnoreOverrides (boolean/bool) If true, the original spatial contexts are returned. If false, coordinate system overrides 

Returns:
    Returns an MgSpatialContextReader object.

Exceptions:
    	MgFeatureServiceException 	
    	MgInvalidArgumentException 	
    	MgInvalidOperationException 	
    	MgFdoException 

The feature source editor in Web Studio will be updated to enable the selection of a coordinate system for a feature source.

Implications

If the SupplementalSpatialContextInfo contains a spatial context with a coordinate system, then that is the coordinate system which will be used on the data. It will override any coordinate system contained in the data. This is the behaviour that is changing.

If the feature source does not contain a spatial context with a coordinate system, then the coordinate system contained in the data will be used. This behaviour is not changing.

Test Plan

Add unit tests to verify behaviour of the coordinate system overrides.

Funding/Resources

Autodesk to supply.

The Web Studio work will be done by DM Solutions Group.

Note: See TracWiki for help on using the wiki.