<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Lucida Calligraphy";
        panose-1:3 1 1 1 1 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
p.yiv1908262380msonormal, li.yiv1908262380msonormal, div.yiv1908262380msonormal
        {mso-style-name:yiv1908262380msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.yiv1908262380msochpdefault, li.yiv1908262380msochpdefault, div.yiv1908262380msochpdefault
        {mso-style-name:yiv1908262380msochpdefault;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.yiv1908262380msonormal1, li.yiv1908262380msonormal1, div.yiv1908262380msonormal1
        {mso-style-name:yiv1908262380msonormal1;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.yiv1908262380msochpdefault1, li.yiv1908262380msochpdefault1, div.yiv1908262380msochpdefault1
        {mso-style-name:yiv1908262380msochpdefault1;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:10.0pt;
        font-family:"Times New Roman","serif";}
span.yiv1908262380msohyperlink
        {mso-style-name:yiv1908262380msohyperlink;}
span.yiv1908262380msohyperlinkfollowed
        {mso-style-name:yiv1908262380msohyperlinkfollowed;}
span.yiv1908262380emailstyle17
        {mso-style-name:yiv1908262380emailstyle17;}
span.yiv1908262380emailstyle18
        {mso-style-name:yiv1908262380emailstyle18;}
span.yiv1908262380htmlpreformattedchar
        {mso-style-name:yiv1908262380htmlpreformattedchar;}
span.yiv1908262380msohyperlink1
        {mso-style-name:yiv1908262380msohyperlink1;
        color:blue;
        text-decoration:underline;}
span.yiv1908262380msohyperlinkfollowed1
        {mso-style-name:yiv1908262380msohyperlinkfollowed1;
        color:purple;
        text-decoration:underline;}
span.yiv1908262380emailstyle171
        {mso-style-name:yiv1908262380emailstyle171;
        font-family:"Arial","sans-serif";
        color:windowtext;}
span.yiv1908262380emailstyle181
        {mso-style-name:yiv1908262380emailstyle181;
        font-family:"Arial","sans-serif";
        color:#1F497D;}
span.yiv1908262380htmlpreformattedchar1
        {mso-style-name:yiv1908262380htmlpreformattedchar1;
        font-family:"Courier New";}
span.EmailStyle33
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle34
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Right, in my rather quick answer I forgot to mention this change that went into CS-Map in the past few months as part of the implementation of RFC 3:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><a href="http://trac.osgeo.org/csmap/wiki/CsMapRfc3">http://trac.osgeo.org/csmap/wiki/CsMapRfc3</a><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>That also means, as Norm mentions below, that now EPSG codes can be accessed by 2 different APIs. <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>It’s still our goal to try to straighten that out in the future and avoid the maintenance issue that will occur when an EPSG upgrade is done. In the meantime, any EPSG upgrade will have to go both into the name mapper and the dictionaries to keep them in synch.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>The main driver behind this RFC was about improving the performance to access the EPSG of a particular CS-Map coordinate system<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>So, you’re right Chris, your suggestion will work<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hugues<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> metacrs-bounces@lists.osgeo.org [mailto:metacrs-bounces@lists.osgeo.org] <b>On Behalf Of </b>Norm Olsen<br><b>Sent:</b> Wednesday, January 26, 2011 8:57 AM<br><b>To:</b> Steve Stanton; metacrs@lists.osgeo.org<br><b>Subject:</b> RE: [MetaCRS] RE: EPSG Code to Coordinate System<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hello Chris . . .<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>The population of the epgsNbr in the coordinate system dictionary is a relatively new thing. While the field was there for several releases, it was only in this last release that it was properly populated. There are many gaps as not all of the systems defined in CS-MAP have (or have had) EPSG codes assigned to them. Hopefully, the mapping is now complete to the extent that a correspondence exists.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>There is a lot of history behind the rather complicated code in the MapGuide API and CS-MAP. Over the course of 12 years, the library was being maintained separately by Mentor and Autodesk (Mentor as a vendor, Autodesk as a user). So, you’ll see lots of strange complexities and duplications in the code due mostly to the legacy of the 22 year old product.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>The suggested means of converting an EPSG code to a CS-MAP name, or any other type of definition mapping, is to use the NameMapper facility. The interfaces supported by this facility are all declared in csNameMapperSupport.h. The facility itself is declared in csNameMapper.hpp and implemented in csNameMapper.cpp. The functionality is based on the content of the NameMapper.csv file. Note, that (obviously) the NameMapper.csv file needs to read into memory at some point. This will happen the first time a NameMapper function is called. Thus, you will see a slight pause for the first call; subsequent calls should perform well for the intended use case of simply looking up a code or two.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>The intent of this facility is to support the various flavors of WKT and hopefully do so in a manner where a new flavor can be added without having to change any code. Theoretically, that should be possible; pragmatically it has yet to be tried. In any case, the NameMapper should enable you to convert from any one flavor of name or code to any other flavor of name or code; and do so for coordinate systems (geographic and/or projective), datums, ellipsoids, projections, projection parameters, units, etc.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Norm<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>--<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Lucida Calligraphy";color:#1F497D'>Norm Olsen<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Software Engineer<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Autodesk, Inc.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>303-277-9967<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> metacrs-bounces@lists.osgeo.org [mailto:metacrs-bounces@lists.osgeo.org] <b>On Behalf Of </b>Steve Stanton<br><b>Sent:</b> Wednesday, January 26, 2011 1:11 AM<br><b>To:</b> metacrs@lists.osgeo.org<br><b>Subject:</b> Re: [MetaCRS] RE: EPSG Code to Coordinate System<o:p></o:p></span></p></div><p class=MsoNormal><o:p> </o:p></p><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0><tr><td valign=top style='padding:0in 0in 0in 0in'><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Hi Hugues,</span><o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>I was looking through the code you mention, and I started to wonder why it's so complicated. Would it not be possible to loop through the the coordinate systems using CS_csrd and look at the value of the epsgNbr field in the cs_Csdef_ struct?</span><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Or is the epsgNbr field no longer utilized? (I see it's defined in only about half of the systems).</span><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Steve</span><o:p></o:p></p><div><p class=MsoNormal><br><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>--- On <b>Wed, 26/1/11, Hugues Wisniewski <i><hugues.wisniewski@autodesk.com></i></b> wrote:</span><o:p></o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><br>From: Hugues Wisniewski <hugues.wisniewski@autodesk.com><br>Subject: [MetaCRS] RE: EPSG Code to Coordinate System<br>To: "Chris Gibson" <Chris.Gibson@divestco.com>, "metacrs@lists.osgeo.org" <metacrs@lists.osgeo.org><br>Date: Wednesday, 26 January, 2011, 0:22<o:p></o:p></span></p><div id=yiv1908262380><div><p class=yiv1908262380msonormal><span style='font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D'>Hello Chris,</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p><p class=yiv1908262380msonormal><span style='font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D'> </span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p><p class=yiv1908262380msonormal><span style='font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D'>For this kind of activity an example is always welcome ;-) and here’s how it’s done in the MapGuide API for future reference </span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p><pre><span style='font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D'>The method is CCoordinateSystemFormatConverter::CodeToCode in the file:</span><o:p></o:p></pre><pre> <o:p></o:p></pre><p class=yiv1908262380msonormal><span style='font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D'><a href="http://svn.osgeo.org/mapguide/trunk/MgDev/Common/CoordinateSystem/CoordSysFormatConverter.cpp" target="_blank">http://svn.osgeo.org/mapguide/trunk/MgDev/Common/CoordinateSystem/CoordSysFormatConverter.cpp</a></span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p><p class=yiv1908262380msonormal><span style='font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D'> </span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p><p class=yiv1908262380msonormal><span style='font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D'>The Cs-Map API being used is CSepsg2adskCS. </span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p><p class=yiv1908262380msonormal><span style='font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D'>And if EPSG is the target CSadsk2epsgCS is the one.</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p><p class=yiv1908262380msonormal><span style='font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D'>CS_epsg2msi sounds like a dead prototype that would have to be removed from Cs-Map</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p><p class=yiv1908262380msonormal><span style='font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D'>Feel free to create a ticket for that and it will be taken care of</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p><p class=yiv1908262380msonormal><span style='font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D'> </span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p><p class=yiv1908262380msonormal><span style='font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D'>Thanks</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p><p class=yiv1908262380msonormal><span style='font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D'> </span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p><p class=yiv1908262380msonormal><span style='font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D'>Hugues</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p><p class=yiv1908262380msonormal><span style='font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D'> </span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=yiv1908262380msonormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'> metacrs-bounces@lists.osgeo.org [mailto:metacrs-bounces@lists.osgeo.org] <b>On Behalf Of </b>Chris Gibson<br><b>Sent:</b> Tuesday, January 25, 2011 3:33 PM<br><b>To:</b> metacrs@lists.osgeo.org<br><b>Subject:</b> [MetaCRS] EPSG Code to Coordinate System<o:p></o:p></span></p></div></div><p class=yiv1908262380msonormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'> <o:p></o:p></span></p><p class=yiv1908262380msonormal><span lang=EN-CA style='font-size:10.0pt;font-family:"Arial","sans-serif"'>I have a need to convert an EPSG code to the Coordinate System descriptor. I thought the function CS_epsg2msi would do what I want, this is in the header file, but no function exists in the source code, so I get an unresolved external.</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p><p class=yiv1908262380msonormal><span lang=EN-CA style='font-size:10.0pt;font-family:"Arial","sans-serif"'> </span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p><p class=yiv1908262380msonormal><span lang=EN-CA style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Am I missing something?</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p><p class=yiv1908262380msonormal><span lang=EN-CA style='font-size:10.0pt;font-family:"Arial","sans-serif"'> </span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p><p class=yiv1908262380msonormal><span lang=EN-CA style='font-size:10.0pt;font-family:"Arial","sans-serif"'>What should I be using?</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p><p class=yiv1908262380msonormal><span lang=EN-CA style='font-size:10.0pt;font-family:"Arial","sans-serif"'> </span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p><p class=yiv1908262380msonormal><span lang=EN-CA style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Thanks</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p><p class=yiv1908262380msonormal><span lang=EN-CA style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Chris Gibson</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p><p class=yiv1908262380msonormal><span lang=EN-CA style='font-size:10.0pt;font-family:"Arial","sans-serif"'> </span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p></div></div></div></div></td></tr></table><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Calibri","sans-serif"'><o:p> </o:p></span></p></div></body></html>