Dear Fabio,<div><br></div><div>you are saying that with the exsiting FDO it is possible to add geometry to a SHP?</div><div><br></div><div>Do you have a sample code for MGOS 2.x also for the interface or maybe a whole project/sln? I am not a programmer, but would like just to test this functionality in MapGuide.</div>
<div><br></div><div>Best regards,</div><div>Dejan<br><br><div class="gmail_quote">On Fri, Nov 6, 2009 at 00:29, Zac Spitzer <span dir="ltr"><<a href="mailto:zac.spitzer@gmail.com">zac.spitzer@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">what's in the string? it's probably an error string<br>
<br>
if your feature source readonly?<br>
<br>
<a href="http://trac.osgeo.org/mapguide/ticket/649" target="_blank">http://trac.osgeo.org/mapguide/ticket/649</a><br>
<br>
a very nasty annoying bug<br>
<font color="#888888"><br>
z<br>
</font><div><div></div><div class="h5"><br>
On Fri, Nov 6, 2009 at 9:45 AM, Jackie Ng <<a href="mailto:jumpinjackie@gmail.com">jumpinjackie@gmail.com</a>> wrote:<br>
><br>
> What does your ReleaseReader() look like?<br>
><br>
> If it's from the samples, it's supposed to close any open MgFeatureReaders<br>
> that may exist in the result returned from MgFeatureService.UpdateFeatures()<br>
><br>
> - Jackie<br>
><br>
><br>
> sekko970 wrote:<br>
>><br>
>> I tryng to add a point to an existing SHP data connection in ASP.Net<br>
>> application, using MG API.<br>
>><br>
>> Dim dataSource as String = "Library://.../MySHP.FeatureSource"<br>
>> Dim dataSourceId As New MgResourceIdentifier(dataSource)<br>
>><br>
>> Dim MyProps As New MgPropertyCollection()<br>
>> Dim agfRW As New MgAgfReaderWriter()<br>
>> Dim geomFactory As New MgGeometryFactory<br>
>><br>
>> Dim myPoint As MgPoint =<br>
>> geomFactory.CreatePoint(geomFactory.CreateCoordinateXY(X, Y))<br>
>><br>
>> 'ID<br>
>> Dim IDProp As New MgInt32Property("FeatID", IDValue)<br>
>> MyProps.Add(IDProp)<br>
>><br>
>> 'MyProp<br>
>> Dim MyProp As New MgDoubleProperty("MyProp", MyPropValue)<br>
>> MyProps.Add(MyProp)<br>
>><br>
>> 'Geometry<br>
>> Dim geomReader As MgByteReader = agfRW.Write(myPoint)<br>
>> Dim geometryProp As New MgGeometryProperty("Geometry", geomReader)<br>
>> MyProps.Add(geometryProp)<br>
>><br>
>> Dim propCollection As New MgBatchPropertyCollection()<br>
>> propCollection.Add(MyProps)<br>
>><br>
>> Dim commands As New MgFeatureCommandCollection()<br>
>> commands.Add(New MgInsertFeatures(MyFeatureName, propCollection))<br>
>><br>
>> Dim res As MgPropertyCollection = featureSrvc.UpdateFeatures(dataSourceId,<br>
>> commands, False)<br>
>> ReleaseReader(res, commands)<br>
>><br>
>> In ReleaseReader, I have the following error:<br>
>> Unable to cast object of type 'OSGeo.MapGuide.MgStringProperty' to type<br>
>> 'OSGeo.MapGuide.MgFeatureProperty'.<br>
>><br>
>> In fact, res has only one property of type MgStringProperty: but why?<br>
>><br>
>> Have you any idea where is the error?<br>
>> Thanks, Fabio<br>
>><br>
>><br>
><br>
> --<br>
> View this message in context: <a href="http://n2.nabble.com/Add-geometry-to-SHP-tp3953583p3955574.html" target="_blank">http://n2.nabble.com/Add-geometry-to-SHP-tp3953583p3955574.html</a><br>
> Sent from the MapGuide Users mailing list archive at Nabble.com.<br>
> _______________________________________________<br>
> mapguide-users mailing list<br>
> <a href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><br>
><br>
<br>
<br>
<br>
</div></div><div class="im">--<br>
Zac Spitzer<br>
Solution Architect / Director<br>
Ennoble Consultancy Australia<br>
<a href="http://www.ennoble.com.au" target="_blank">http://www.ennoble.com.au</a><br>
<a href="http://zacster.blogspot.com" target="_blank">http://zacster.blogspot.com</a><br>
+61 405 847 168<br>
_______________________________________________<br>
</div><div><div></div><div class="h5">mapguide-users mailing list<br>
<a href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><br>
</div></div></blockquote></div><br></div>