<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>Rodolfo,<br>
I don't dare to oppose Andy, I believe there is a solid justification
behind his statements, but note that:<br>
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)<br>
2. Since Mapguide connects to data in an uniform manner - thru FDO,&nbsp;
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<br>
I am sorry, if I have not been helpful to you<br>
<br>
Ivan ,<br>
I have used as a template the redlining module from PHPSAMPLES package.<br>
Here is part of the code :<br>
<br>
.........<br>
&nbsp;&nbsp;&nbsp; $map = new MgMap();<br>
&nbsp;&nbsp;&nbsp; $map-&gt;Open($resourceService, $mapName);<br>
&nbsp;&nbsp;&nbsp; $mylayers = $map-&gt;GetLayers() ;<br>
&nbsp;&nbsp;&nbsp; $mylayer = $mylayers-&gt;GetItem ($layerName);<br>
&nbsp;&nbsp;&nbsp; $ftrclassname = $mylayer-&gt;GetFeatureClassName();<br>
&nbsp;&nbsp;&nbsp; $batchPropertyCollection = new MgBatchPropertyCollection();<br>
&nbsp;&nbsp;&nbsp; $propertyCollection = MakePoly($use,$plabel,$owner, $polydef);<br>
&nbsp;&nbsp;&nbsp; $batchPropertyCollection-&gt;Add($propertyCollection);<br>
&nbsp;&nbsp;&nbsp; $cmd = new MgInsertFeatures( $ftrclassname,
$batchPropertyCollection);<br>
&nbsp;&nbsp;&nbsp; $featureCommandCollection = new MgFeatureCommandCollection();<br>
&nbsp;&nbsp;&nbsp; $featureCommandCollection-&gt;Add($cmd);<br>
&nbsp;&nbsp;&nbsp; $featureService-&gt;UpdateFeatures
($myResourceID,$featureCommandCollection,false);<br>
.......<br>
<br>
&nbsp; function MakePoly($puse,$pplabel,$powner,$polystring)<br>
&nbsp; {<br>
&nbsp;&nbsp;&nbsp; $propertyCollection = new MgPropertyCollection();<br>
&nbsp;&nbsp;&nbsp; $ownerProperty = new MgStringProperty("Owner", $powner);<br>
&nbsp;&nbsp;&nbsp; $propertyCollection-&gt;Add($ownerProperty);<br>
&nbsp;&nbsp;&nbsp; $useProperty = new MgStringProperty("Purpose", $puse);<br>
&nbsp;&nbsp;&nbsp; $propertyCollection-&gt;Add($useProperty);<br>
&nbsp;&nbsp;&nbsp; $labelProperty = new MgStringProperty("Label", $pplabel);<br>
&nbsp;&nbsp;&nbsp; $propertyCollection-&gt;Add($labelProperty);<br>
&nbsp;&nbsp;&nbsp; $wktReaderWriter = new MgWktReaderWriter();<br>
&nbsp;&nbsp;&nbsp; $agfReaderWriter = new MgAgfReaderWriter();<br>
&nbsp;&nbsp;&nbsp; $agftext = $polystring ;<br>
&nbsp;&nbsp;&nbsp; $geometry = $wktReaderWriter-&gt;Read( $agftext);<br>
&nbsp;&nbsp;&nbsp; $geometryByteReader = $agfReaderWriter-&gt;Write($geometry);<br>
&nbsp;&nbsp;&nbsp; $geometryProperty = new MgGeometryProperty("Geometry",
$geometryByteReader);<br>
&nbsp;&nbsp;&nbsp; $propertyCollection-&gt;Add($geometryProperty);<br>
&nbsp;&nbsp;&nbsp; return $propertyCollection;<br>
&nbsp; }<br>
<br>
The coordinate data in $polystring is formatted according to the
grammar described in <br>
<a class="moz-txt-link-freetext" 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><br>
<br>
Best regards : Stefan<br>
<br>
<br>
Rodolfo Moreno wrote:</tt>
<blockquote cite="mid:1233949871458-2286146.post@n2.nabble.com"
 type="cite">
  <pre wrap=""><tt>Hi Stefan, you can add and delete features using mapguide API, however you
can't create non add fields to the SHPs.
<a class="moz-txt-link-freetext" 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>


Ivan Milicevic wrote:
</tt></pre>
  <blockquote type="cite">
    <pre wrap=""><tt>Hello,

Can you post some sample code for that? 

-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:mapguide-users-bounces@lists.osgeo.org">mapguide-users-bounces@lists.osgeo.org</a>
[<a class="moz-txt-link-freetext" href="mailto:mapguide-users-bounces@lists.osgeo.org">mailto:mapguide-users-bounces@lists.osgeo.org</a>] On Behalf Of Stefan
Dalakov
Sent: Friday, February 06, 2009 6:20 PM
To: MapGuide Users Mail List
Subject: Re: [mapguide-users] how to use FDO api into MAPGUIDE
applications

For sure you can modify SHP files with Mapguide API - I have application

which adds and deletes features.
I have not tried to create a SHP file, but I don't think it is
impossible 

Stefan Dalakov

Rodolfo Moreno wrote:
</tt></pre>
    <blockquote type="cite">
      <pre wrap=""><tt>I have read that only SDFs can be created and altered with mapguide
</tt></pre>
    </blockquote>
    <pre wrap=""><tt>API,
</tt></pre>
    <blockquote type="cite">
      <pre wrap=""><tt>which is why I need to use FDO api in my mapguide applications in
</tt></pre>
    </blockquote>
    <pre wrap=""><tt>order to
</tt></pre>
    <blockquote type="cite">
      <pre wrap=""><tt>create and alter SHPs.

If anyone has code sample or documentation about it, I will be very
grateful.

Cheers,

-----
Rodolfo Moreno
CivilEng

  
</tt></pre>
    </blockquote>
    <pre wrap=""><tt>_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>


</tt></pre>
  </blockquote>
  <pre wrap=""><!----><tt>

-----
Rodolfo Moreno
CivilEng

</tt></pre>
</blockquote>
<tt><br>
</tt>
</body>
</html>