<!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,
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>
$map = new MgMap();<br>
$map->Open($resourceService, $mapName);<br>
$mylayers = $map->GetLayers() ;<br>
$mylayer = $mylayers->GetItem ($layerName);<br>
$ftrclassname = $mylayer->GetFeatureClassName();<br>
$batchPropertyCollection = new MgBatchPropertyCollection();<br>
$propertyCollection = MakePoly($use,$plabel,$owner, $polydef);<br>
$batchPropertyCollection->Add($propertyCollection);<br>
$cmd = new MgInsertFeatures( $ftrclassname,
$batchPropertyCollection);<br>
$featureCommandCollection = new MgFeatureCommandCollection();<br>
$featureCommandCollection->Add($cmd);<br>
$featureService->UpdateFeatures
($myResourceID,$featureCommandCollection,false);<br>
.......<br>
<br>
function MakePoly($puse,$pplabel,$powner,$polystring)<br>
{<br>
$propertyCollection = new MgPropertyCollection();<br>
$ownerProperty = new MgStringProperty("Owner", $powner);<br>
$propertyCollection->Add($ownerProperty);<br>
$useProperty = new MgStringProperty("Purpose", $puse);<br>
$propertyCollection->Add($useProperty);<br>
$labelProperty = new MgStringProperty("Label", $pplabel);<br>
$propertyCollection->Add($labelProperty);<br>
$wktReaderWriter = new MgWktReaderWriter();<br>
$agfReaderWriter = new MgAgfReaderWriter();<br>
$agftext = $polystring ;<br>
$geometry = $wktReaderWriter->Read( $agftext);<br>
$geometryByteReader = $agfReaderWriter->Write($geometry);<br>
$geometryProperty = new MgGeometryProperty("Geometry",
$geometryByteReader);<br>
$propertyCollection->Add($geometryProperty);<br>
return $propertyCollection;<br>
}<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>