<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)">
<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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
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-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
</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=HR link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Stefan, thank's a lot for posted sample. It would be very
helpful for me.<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 0cm 0cm 0cm'>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif";color:windowtext'>From:</span></b><span lang=EN-US
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>Stefan Dalakov<br>
<b>Sent:</b> Friday, February 06, 2009 9:57 PM<br>
<b>To:</b> MapGuide Users Mail List<br>
<b>Subject:</b> Re: [mapguide-users] how to use FDO api into MAPGUIDE
applications<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><tt><span style='font-size:10.0pt'>Rodolfo,</span></tt><span
style='font-size:10.0pt;font-family:"Courier New"'><br>
<tt>I don't dare to oppose Andy, I believe there is a solid justification
behind his statements, but note that:</tt><br>
<tt>1. This post concerns the previous versions of MGOS and FDO (I do not say
that it makes difference, in fact I am not aware of changes from FDO 3.3.0 to
3.3.1)</tt><br>
<tt>2. Since Mapguide connects to data in an uniform manner - thru FDO,
and you are able to accomplish your task with SDF, then it depends only on
capabilities of the FDO provider if you will succeed with SHP or any other
format</tt><br>
<tt>I am sorry, if I have not been helpful to you</tt><br>
<br>
<tt>Ivan ,</tt><br>
<tt>I have used as a template the redlining module from PHPSAMPLES package.</tt><br>
<tt>Here is part of the code :</tt><br>
<br>
<tt>.........</tt><br>
<tt> $map = new MgMap();</tt><br>
<tt> $map->Open($resourceService, $mapName);</tt><br>
<tt> $mylayers = $map->GetLayers() ;</tt><br>
<tt> $mylayer = $mylayers->GetItem ($layerName);</tt><br>
<tt> $ftrclassname = $mylayer->GetFeatureClassName();</tt><br>
<tt> $batchPropertyCollection = new
MgBatchPropertyCollection();</tt><br>
<tt> $propertyCollection = MakePoly($use,$plabel,$owner,
$polydef);</tt><br>
<tt> $batchPropertyCollection->Add($propertyCollection);</tt><br>
<tt> $cmd = new MgInsertFeatures( $ftrclassname,
$batchPropertyCollection);</tt><br>
<tt> $featureCommandCollection = new
MgFeatureCommandCollection();</tt><br>
<tt> $featureCommandCollection->Add($cmd);</tt><br>
<tt> $featureService->UpdateFeatures ($myResourceID,$featureCommandCollection,false);</tt><br>
<tt>.......</tt><br>
<br>
<tt> function MakePoly($puse,$pplabel,$powner,$polystring)</tt><br>
<tt> {</tt><br>
<tt> $propertyCollection = new MgPropertyCollection();</tt><br>
<tt> $ownerProperty = new MgStringProperty("Owner",
$powner);</tt><br>
<tt> $propertyCollection->Add($ownerProperty);</tt><br>
<tt> $useProperty = new MgStringProperty("Purpose",
$puse);</tt><br>
<tt> $propertyCollection->Add($useProperty);</tt><br>
<tt> $labelProperty = new MgStringProperty("Label",
$pplabel);</tt><br>
<tt> $propertyCollection->Add($labelProperty);</tt><br>
<tt> $wktReaderWriter = new MgWktReaderWriter();</tt><br>
<tt> $agfReaderWriter = new MgAgfReaderWriter();</tt><br>
<tt> $agftext = $polystring ;</tt><br>
<tt> $geometry = $wktReaderWriter->Read( $agftext);</tt><br>
<tt> $geometryByteReader =
$agfReaderWriter->Write($geometry);</tt><br>
<tt> $geometryProperty = new MgGeometryProperty("Geometry",
$geometryByteReader);</tt><br>
<tt> $propertyCollection->Add($geometryProperty);</tt><br>
<tt> return $propertyCollection;</tt><br>
<tt> }</tt><br>
<br>
<tt>The coordinate data in $polystring is formatted according to the grammar
described in </tt><br>
<tt><a
href="http://mapguide.osgeo.org/files/mapguide/docs/2.0/da/dc0/group___agf_text.htm">http://mapguide.osgeo.org/files/mapguide/docs/2.0/da/dc0/group___agf_text.htm</a></tt><br>
<br>
<tt>Best regards : Stefan</tt><br>
<br>
<br>
<tt>Rodolfo Moreno wrote:</tt></span> <o:p></o:p></p>
<pre><tt>Hi Stefan, you can add and delete features using mapguide API, however you<o:p></o:p></tt></pre><pre><tt>can't create non add fields to the SHPs.<o:p></o:p></tt></pre><pre><tt><a
href="http://n2.nabble.com/Writing-data-to-a-shapefile-example--td1815692.html#a1815693">http://n2.nabble.com/Writing-data-to-a-shapefile-example--td1815692.html#a1815693</a><o:p></o:p></tt></pre><pre><tt><o:p> </o:p></tt></pre><pre><tt><o:p> </o:p></tt></pre><pre><tt>Ivan Milicevic wrote:<o:p></o:p></tt></pre>
<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><pre><tt>Hello,<o:p></o:p></tt></pre><pre><tt><o:p> </o:p></tt></pre><pre><tt>Can you post some sample code for that? <o:p></o:p></tt></pre><pre><tt><o:p> </o:p></tt></pre><pre><tt>-----Original Message-----<o:p></o:p></tt></pre><pre><tt>From: <a
href="mailto:mapguide-users-bounces@lists.osgeo.org">mapguide-users-bounces@lists.osgeo.org</a><o:p></o:p></tt></pre><pre><tt>[<a
href="mailto:mapguide-users-bounces@lists.osgeo.org">mailto:mapguide-users-bounces@lists.osgeo.org</a>] On Behalf Of Stefan<o:p></o:p></tt></pre><pre><tt>Dalakov<o:p></o:p></tt></pre><pre><tt>Sent: Friday, February 06, 2009 6:20 PM<o:p></o:p></tt></pre><pre><tt>To: MapGuide Users Mail List<o:p></o:p></tt></pre><pre><tt>Subject: Re: [mapguide-users] how to use FDO api into MAPGUIDE<o:p></o:p></tt></pre><pre><tt>applications<o:p></o:p></tt></pre><pre><tt><o:p> </o:p></tt></pre><pre><tt>For sure you can modify SHP files with Mapguide API - I have application<o:p></o:p></tt></pre><pre><tt><o:p> </o:p></tt></pre><pre><tt>which adds and deletes features.<o:p></o:p></tt></pre><pre><tt>I have not tried to create a SHP file, but I don't think it is<o:p></o:p></tt></pre><pre><tt>impossible <o:p></o:p></tt></pre><pre><tt><o:p> </o:p></tt></pre><pre><tt>Stefan Dalakov<o:p></o:p></tt></pre><pre><tt><o:p> </o:p></tt></pre><pre><tt>Rodolfo Moreno wrote:<o:p></o:p></tt></pre>
<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><pre><tt>I have read that only SDFs can be created and altered with mapguide<o:p></o:p></tt></pre></blockquote>
<pre><tt>API,<o:p></o:p></tt></pre>
<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><pre><tt>which is why I need to use FDO api in my mapguide applications in<o:p></o:p></tt></pre></blockquote>
<pre><tt>order to<o:p></o:p></tt></pre>
<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><pre><tt>create and alter SHPs.<o:p></o:p></tt></pre><pre><tt><o:p> </o:p></tt></pre><pre><tt>If anyone has code sample or documentation about it, I will be very<o:p></o:p></tt></pre><pre><tt>grateful.<o:p></o:p></tt></pre><pre><tt><o:p> </o:p></tt></pre><pre><tt>Cheers,<o:p></o:p></tt></pre><pre><tt><o:p> </o:p></tt></pre><pre><tt>-----<o:p></o:p></tt></pre><pre><tt>Rodolfo Moreno<o:p></o:p></tt></pre><pre><tt>CivilEng<o:p></o:p></tt></pre><pre><tt><o:p> </o:p></tt></pre><pre><tt> <o:p></o:p></tt></pre></blockquote>
<pre><tt>_______________________________________________<o:p></o:p></tt></pre><pre><tt>mapguide-users mailing list<o:p></o:p></tt></pre><pre><tt><a
href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><o:p></o:p></tt></pre><pre><tt><a
href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><o:p></o:p></tt></pre><pre><tt>_______________________________________________<o:p></o:p></tt></pre><pre><tt>mapguide-users mailing list<o:p></o:p></tt></pre><pre><tt><a
href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><o:p></o:p></tt></pre><pre><tt><a
href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><o:p></o:p></tt></pre><pre><tt><o:p> </o:p></tt></pre><pre><tt><o:p> </o:p></tt></pre></blockquote>
<pre><tt><o:p> </o:p></tt></pre><pre><tt><o:p> </o:p></tt></pre><pre><tt>-----<o:p></o:p></tt></pre><pre><tt>Rodolfo Moreno<o:p></o:p></tt></pre><pre><tt>CivilEng<o:p></o:p></tt></pre><pre><tt><o:p> </o:p></tt></pre>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>