<div>Hi!</div><div><br></div><div>Add references to this files:</div><div><br></div><div>OSGeo.FDO.dll</div><div>OSGeo.FDO.Geometry.dll</div>OSGeo.FDO.Common.dll<br>OSGeo.FDO.Spatial.dll<div><br></div><div>simon</div><div>
<br><div class="gmail_quote">On Fri, Nov 6, 2009 at 9:41 AM, sekko970 <span dir="ltr"><<a href="mailto:fabio.franceschini@techneteam.it">fabio.franceschini@techneteam.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Hi Simon,<br>
what I have to do to include in my <a href="http://ASP.NET" target="_blank">ASP.NET</a> project FDO .NET API?<br>
<div><div></div><div class="h5"><br>
<br>
<br>
Simon Pelicon wrote:<br>
><br>
> Hi!<br>
><br>
> Here is sample in C# from my code using just FDO .NET API.<br>
> This inserts FEATURE in any FDO datasource specified in my FDO connection<br>
> (m_Conn) like SHP,SDF, oracle ....<br>
><br>
><br>
> IInsert command =<br>
> (IInsert)m_base.m_Conn.CreateCommand(CommandType.CommandType_Insert);<br>
> FgfGeometryFactory factory = new FgfGeometryFactory();<br>
> IDirectPosition position = factory.CreatePositionXYZ(X,Y, 0.0);<br>
> IPoint point = factory.CreatePoint(position);<br>
> command .PropertyValues.Add(new PropertyValue(GEOMETRY_COLUMN, new<br>
> GeometryValue(factory.GetFgf(point))));<br>
> command .PropertyValues.Add(new PropertyValue(LAYER_COLUMN, new<br>
> StringValue(bref.Layer)));<br>
> command .PropertyValues.Add(new PropertyValue(BLOCK_COLUMN, new<br>
> StringValue(bref.Name)));<br>
> reader = command.Execute();<br>
> if (reader.ReadNext())<br>
> {<br>
><br>
> }<br>
><br>
> Simon<br>
><br>
><br>
> On Fri, Nov 6, 2009 at 8:27 AM, Dejan Gregor <<a href="mailto:dejan.gregor@gmail.com">dejan.gregor@gmail.com</a>><br>
> wrote:<br>
><br>
>> Dear Fabio,<br>
>><br>
>> you are saying that with the exsiting FDO it is possible to add geometry<br>
>> to<br>
>> a SHP?<br>
>><br>
>> Do you have a sample code for MGOS 2.x also for the interface or maybe a<br>
>> whole project/sln? I am not a programmer, but would like just to test<br>
>> this<br>
>> functionality in MapGuide.<br>
>><br>
>> Best regards,<br>
>> Dejan<br>
>><br>
>> On Fri, Nov 6, 2009 at 00:29, Zac Spitzer <<a href="mailto:zac.spitzer@gmail.com">zac.spitzer@gmail.com</a>> wrote:<br>
>><br>
>>> 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>
>>><br>
>>> z<br>
>>><br>
>>> On Fri, Nov 6, 2009 at 9:45 AM, Jackie Ng <<a href="mailto:jumpinjackie@gmail.com">jumpinjackie@gmail.com</a>><br>
>>> wrote:<br>
>>> ><br>
>>> > What does your ReleaseReader() look like?<br>
>>> ><br>
>>> > If it's from the samples, it's supposed to close any open<br>
>>> MgFeatureReaders<br>
>>> > that may exist in the result returned from<br>
>>> 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 =<br>
>>> 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<br>
>>> 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:<br>
>>> <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>
>>> --<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>
>>> 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>
>> 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>
> 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>View this message in context: <a href="http://n2.nabble.com/Add-geometry-to-SHP-tp3953583p3957522.html" target="_blank">http://n2.nabble.com/Add-geometry-to-SHP-tp3953583p3957522.html</a><br>
<div><div></div><div class="h5">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>
</div></div></blockquote></div><br></div>