[mapguide-users] New coordinate system definition

Jackie Ng jumpinjackie at gmail.com
Thu Apr 5 10:07:37 PDT 2018


Un-tested pseudo code pattern:

1. Create a MgCoordinateSystemFactory()
2. Get its MgCoordinateSystemCatalog ( .GetCatalog() )
3. Get one or more of the required dictionaries:
   a. The coordinate system dictionary ( .GetCoordinateSystemDictionary() )
   b. The datum dictionary ( .GetCoordinateSystemDatumDictionary() )
   c. The geodetic path dictionary ( .GetGeodeticPathDictionary() )
   d. The geodetic transform def dictionary (
.GetGeodeticTransformDefDictionary() )
4. For any of the dictionaries, you can create a new instance of said item
with NewXXX(). For example, wiht MgCoordinateSystemDictionary, you'd call
NewCoordinateSystem() on it to create a new MgCoordinateSystem instance.
5. Set various properties in this item with the respective SetXXX() methods.
6. Call Add() on the respective dictionary passing in the new item. This
will create the definition in the underlying dictionary file.

The unknowns are whether the SetXXX() methods in MgCoordinateSystem cover
all the settings/parameters of your new coordinate system. I guess the
easiest way to find out is to get a MgCoordinateSystem that exists and is
similar to the one you want to add and just fully inspect all of its
settings and parameters so you know what needs to be set.

The other unknown is that I'm certain this pseudo-code pattern will try to
write to the system-installed dictionaries by default, which will be
write-protected so some exception will probably be thrown. There is a notion
of user dictionaries (as stated here:
https://trac.osgeo.org/mapguide/wiki/MapGuideRfc127), but actual
documentation on how to know whether you're accessing system or user
installed dictionaries is not available. You're gonna have to really trial
and error the various MgCoordinateSystem* APIs available.

Failing this, I suppose you could always file a bug on the CS-Map repo
(https://trac.osgeo.org/csmap) to request this coordinate system be added.

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html


More information about the mapguide-users mailing list