[mapguide-users] Add geometry to SHP

Dejan Gregor dejan.gregor at gmail.com
Fri Nov 6 02:27:26 EST 2009


Dear Fabio,

you are saying that with the exsiting FDO it is possible to add geometry to
a SHP?

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.

Best regards,
Dejan

On Fri, Nov 6, 2009 at 00:29, Zac Spitzer <zac.spitzer at gmail.com> wrote:

> what's in the string? it's probably an error string
>
> if your feature source readonly?
>
> http://trac.osgeo.org/mapguide/ticket/649
>
> a very nasty annoying bug
>
> z
>
> On Fri, Nov 6, 2009 at 9:45 AM, Jackie Ng <jumpinjackie at gmail.com> wrote:
> >
> > What does your ReleaseReader() look like?
> >
> > If it's from the samples, it's supposed to close any open
> MgFeatureReaders
> > that may exist in the result returned from
> MgFeatureService.UpdateFeatures()
> >
> > - Jackie
> >
> >
> > sekko970 wrote:
> >>
> >> I tryng to add a point to an existing SHP data connection in ASP.Net
> >> application, using MG API.
> >>
> >> Dim dataSource as String = "Library://.../MySHP.FeatureSource"
> >> Dim dataSourceId As New MgResourceIdentifier(dataSource)
> >>
> >> Dim MyProps As New MgPropertyCollection()
> >> Dim agfRW As New MgAgfReaderWriter()
> >> Dim geomFactory As New MgGeometryFactory
> >>
> >> Dim myPoint As MgPoint =
> >> geomFactory.CreatePoint(geomFactory.CreateCoordinateXY(X, Y))
> >>
> >> 'ID
> >> Dim IDProp As New MgInt32Property("FeatID", IDValue)
> >> MyProps.Add(IDProp)
> >>
> >> 'MyProp
> >> Dim MyProp As New MgDoubleProperty("MyProp", MyPropValue)
> >> MyProps.Add(MyProp)
> >>
> >> 'Geometry
> >> Dim geomReader As MgByteReader = agfRW.Write(myPoint)
> >> Dim geometryProp As New MgGeometryProperty("Geometry", geomReader)
> >> MyProps.Add(geometryProp)
> >>
> >> Dim propCollection As New MgBatchPropertyCollection()
> >> propCollection.Add(MyProps)
> >>
> >> Dim commands As New MgFeatureCommandCollection()
> >> commands.Add(New MgInsertFeatures(MyFeatureName, propCollection))
> >>
> >> Dim res As MgPropertyCollection =
> featureSrvc.UpdateFeatures(dataSourceId,
> >> commands, False)
> >> ReleaseReader(res, commands)
> >>
> >> In ReleaseReader, I have the following error:
> >> Unable to cast object of type 'OSGeo.MapGuide.MgStringProperty' to type
> >> 'OSGeo.MapGuide.MgFeatureProperty'.
> >>
> >> In fact, res has only one property of type MgStringProperty: but why?
> >>
> >> Have you any idea where is the error?
> >> Thanks, Fabio
> >>
> >>
> >
> > --
> > View this message in context:
> http://n2.nabble.com/Add-geometry-to-SHP-tp3953583p3955574.html
> > Sent from the MapGuide Users mailing list archive at Nabble.com.
> > _______________________________________________
> > mapguide-users mailing list
> > mapguide-users at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapguide-users
> >
>
>
>
> --
> Zac Spitzer
> Solution Architect / Director
> Ennoble Consultancy Australia
> http://www.ennoble.com.au
> http://zacster.blogspot.com
> +61 405 847 168
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20091106/52a72b63/attachment.html


More information about the mapguide-users mailing list