<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=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@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;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
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;}
p
        {mso-style-priority:99;
        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";
        color:black;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:1361855732;
        mso-list-type:hybrid;
        mso-list-template-ids:-315713146 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
-->
</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 bgcolor=white lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='color:#1F497D'>Thanks Kenneth(!!),<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>I&#8217;ve implemented your code
snippet, and it now looks like this:<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:windowtext'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>string</span><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'> username =
</span><span style='font-size:10.0pt;font-family:"Courier New";color:#A31515'>&quot;Author1&quot;</span><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'>;<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:windowtext'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>string</span><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'> password =
</span><span style='font-size:10.0pt;font-family:"Courier New";color:#A31515'>&quot;Author1&quot;</span><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'>;<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:windowtext'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>string</span><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'> locale = </span><span
style='font-size:10.0pt;font-family:"Courier New";color:#A31515'>&quot;EN&quot;</span><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'>;<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:windowtext'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>string</span><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'> url = </span><span
style='font-size:10.0pt;font-family:"Courier New";color:#A31515'>&quot;http://mapguideserver/MapGuide&quot;</span><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'>;<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:windowtext'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
System.</span><span style='font-size:10.0pt;font-family:"Courier New";
color:#2B91AF'>Uri</span><span style='font-size:10.0pt;font-family:"Courier New";
color:windowtext'> uri = </span><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'>new</span><span style='font-size:10.0pt;font-family:"Courier New";
color:windowtext'> System.</span><span style='font-size:10.0pt;font-family:
"Courier New";color:#2B91AF'>Uri</span><span style='font-size:10.0pt;
font-family:"Courier New";color:windowtext'>(url);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:windowtext'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:.5in;text-autospace:
none'><span style='font-size:10.0pt;font-family:"Courier New";color:#2B91AF'>ServerConnectionI</span><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'> con = </span><span
style='font-size:10.0pt;font-family:"Courier New";color:blue'>new</span><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'> </span><span
style='font-size:10.0pt;font-family:"Courier New";color:#2B91AF'>HttpServerConnection</span><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'>(uri,
username, password, locale, </span><span style='font-size:10.0pt;font-family:
"Courier New";color:blue'>false</span><span style='font-size:10.0pt;font-family:
"Courier New";color:windowtext'>);<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:windowtext'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style='font-size:10.0pt;font-family:"Courier New";color:#2B91AF'>FeatureSource</span><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'> fs = </span><span
style='font-size:10.0pt;font-family:"Courier New";color:blue'>new</span><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'> </span><span
style='font-size:10.0pt;font-family:"Courier New";color:#2B91AF'>FeatureSource</span><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'>();<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:windowtext'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
fs.Provider = </span><span style='font-size:10.0pt;font-family:"Courier New";
color:#A31515'>&quot;OSGeo.SHP.3.3&quot;</span><span style='font-size:10.0pt;
font-family:"Courier New";color:windowtext'>;<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:windowtext'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
fs.Parameter = </span><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'>new</span><span style='font-size:10.0pt;font-family:"Courier New";
color:windowtext'> </span><span style='font-size:10.0pt;font-family:"Courier New";
color:#2B91AF'>NameValuePairTypeCollection</span><span style='font-size:10.0pt;
font-family:"Courier New";color:windowtext'>();<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:windowtext'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
fs.Parameter[</span><span style='font-size:10.0pt;font-family:"Courier New";
color:#A31515'>&quot;DefaultFileLocation&quot;</span><span style='font-size:
10.0pt;font-family:"Courier New";color:windowtext'>] = </span><span
style='font-size:10.0pt;font-family:"Courier New";color:#A31515'>&quot;%MG_DATA_FILE_PATH%ShapeFile.SHP&quot;</span><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'>;<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:windowtext'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>string</span><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'> resId = </span><span
style='font-size:10.0pt;font-family:"Courier New";color:#A31515'>&quot;Library://MYNEWTESTSHAPE.FeatureSource&quot;</span><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'>;<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:windowtext'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
con.SaveResourceAs(fs, resId);<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:windowtext'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>using</span><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'>
(System.IO.</span><span style='font-size:10.0pt;font-family:"Courier New";
color:#2B91AF'>FileStream</span><span style='font-size:10.0pt;font-family:"Courier New";
color:windowtext'> fss = System.IO.</span><span style='font-size:10.0pt;
font-family:"Courier New";color:#2B91AF'>File</span><span style='font-size:
10.0pt;font-family:"Courier New";color:windowtext'>.OpenRead(</span><span
style='font-size:10.0pt;font-family:"Courier New";color:#A31515'>&quot;C:\\Hydrant.shp&quot;</span><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'>))<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
color:windowtext'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
con.SetResourceData(resId, </span><span style='font-size:10.0pt;font-family:
"Courier New";color:#A31515'>&quot;ShapeFile.SHP&quot;</span><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'>, </span><span
style='font-size:10.0pt;font-family:"Courier New";color:#2B91AF'>ResourceDataType</span><span
style='font-size:10.0pt;font-family:"Courier New";color:windowtext'>.File,
fss);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
color:windowtext'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>&#8230; and that works. <o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>Now I&#8217;m looking at and thinking
about how to:<o:p></o:p></span></p>

<p class=MsoListParagraph style='margin-left:1.0in;text-indent:-.25in;
mso-list:l0 level2 lfo1'><![if !supportLists]><span style='font-family:"Courier New";
color:#1F497D'><span style='mso-list:Ignore'>o<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;
</span></span></span><![endif]><b><span style='color:#1F497D'>Convert to SDF feature
source.<o:p></o:p></span></b></p>

<p class=MsoListParagraph style='margin-left:1.0in;text-indent:-.25in;
mso-list:l0 level2 lfo1'><![if !supportLists]><span style='font-family:"Courier New";
color:#1F497D'><span style='mso-list:Ignore'>o<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;
</span></span></span><![endif]><b><span style='color:#1F497D'>Set the
coordinate system.<o:p></o:p></span></b></p>

<p class=MsoListParagraph style='margin-left:1.0in;text-indent:-.25in;
mso-list:l0 level2 lfo1'><![if !supportLists]><span style='font-family:"Courier New";
color:#1F497D'><span style='mso-list:Ignore'>o<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;
</span></span></span><![endif]><b><span style='color:#1F497D'>Import/save the
attribute data from *.dbf file.<o:p></o:p></span></b></p>

<p class=MsoNormal><span style='color:#1F497D'><br>
So I&#8217;m looking for more direction/information on uploading shp files to a
managed mapguide server. Anyone?<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>Thanks<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</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";
color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:
"Tahoma","sans-serif";color:windowtext'> mapguide-users-bounces@lists.osgeo.org
[mailto:mapguide-users-bounces@lists.osgeo.org] <b>On Behalf Of </b>Kenneth
Skovhede, GEOGRAF A/S<br>
<b>Sent:</b> Friday, October 17, 2008 1:00 AM<br>
<b>To:</b> MapGuide Users Mail List<br>
<b>Subject:</b> Re: [mapguide-users] DWGLoadProcedure<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>As DWG is a proprietary format, I belive it will be
difficult to do this with only open-source software.<br>
Supposedly, you can use FME to do it, and I think there is some organisation
that has a 'open-source' like library for reading DWG data.<br>
<br>
There are no methods for dealing with DWG in Maestro or the Maestro API, for
the above reasons.<br>
<br>
As for SHP, it is fairly easy to do this:<br>
<tt><span style='font-size:10.0pt'>IServerConnection con = new HttpServerConnection(url,
username, password, locale, false);</span></tt><span style='font-size:10.0pt;
font-family:"Courier New"'><br>
<tt>FeatureSource fs = new FeatureSource();</tt><br>
<tt>fs.Provider = &quot;OSGeo.SHP.3.3&quot;; //Adjust if you are not using FDO
3.3</tt><br>
<tt>fs.Parameter = new NameValueCollection();</tt><br>
<tt>fs.Parameter[&quot;DefaultFileLocation&quot;] = &quot;%MG_DATA_FILE_PATH%ShapeFile.SHP&quot;;
//Can use absolute path here</tt><br>
<tt>string resId = &quot;Library://MyShpFile.FeatureSource&quot;;</tt><br>
<tt>con.SaveResourceAs(fs, resId);</tt><br>
<tt>using(System.IO.FileStream fs =
System.IO.File.OpenRead(&quot;C:\\myshapefile.shp&quot;))</tt><br>
<tt>&nbsp;&nbsp;&nbsp; con.SetResourceData(resId, &quot;ShapeFile.SHP&quot;, ResourceDataType.File,
fs);</tt></span><br>
<br>
The above code will create a managed copy of your shape data.<br>
If you want an unmanaged copy, just change &quot;DefaultFileLocation&quot; to
the absolute path, and remove the &quot;SetResourceData&quot; call.<br>
<br>
<br>
<o:p></o:p></p>

<pre>Regards, Kenneth Skovhede, GEOGRAF A/S<o:p></o:p></pre>

<p class=MsoNormal><br>
<br>
Greenhough, Jamie skrev: <o:p></o:p></p>

<p class=MsoNormal>Hello again MapGuide coders ;)<o:p></o:p></p>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

<p class=MsoNormal>I want to programmatically load .dwg/.shp files to a managed
MapGuide environment. <o:p></o:p></p>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

<p class=MsoNormal>I think this can be accomplished with the MapGuide Studio
API&#8230; but are there any other ways to get this data into the MapGuide
server? I&#8217;m trying to stay open source. Are there any methods in the
Maestro API to accomplish this?<o:p></o:p></p>

<p>----Notice Regarding Confidentiality----<br>
This email, including any and all attachments, (this &quot;Email&quot;) is
intended only for the party to whom it is addressed and may contain information
that is confidential or privileged. Sierra Systems Group Inc. and its
affiliates accept no responsibility for any loss or damage suffered by any
person resulting from any unauthorized use of or reliance upon this Email. If
you are not the intended recipient, you are hereby notified that any
dissemination, copying or other use of this Email is prohibited. Please notify
us of the error in communication by return email and destroy all copies of this
Email. Thank you.<o:p></o:p></p>

<pre><o:p>&nbsp;</o:p></pre><pre style='text-align:center'>

<hr size=4 width="90%" align=center>

</pre><pre><o:p>&nbsp;</o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>mapguide-users mailing list<o:p></o:p></pre><pre><a
href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><o:p></o:p></pre><pre><a
href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><o:p></o:p></pre><pre>&nbsp; <o:p></o:p></pre></div>

<p></p><p>----Notice Regarding Confidentiality----<br>This email, including any and all attachments, (this "Email") is intended only for the party to whom it is addressed and may contain information that is confidential or privileged.  Sierra Systems Group Inc. and its affiliates accept no responsibility for any loss or damage suffered by any person resulting from any unauthorized use of or reliance upon this Email.  If you are not the intended recipient, you are hereby notified that any dissemination, copying or other use of this Email is prohibited.  Please notify us of the error in communication by return email and destroy all copies of this Email.  Thank you.</body>

</html>