[fdo-users] Insert new feature object on SHP File
Jason Birch
jason at jasonbirch.com
Sun Nov 1 16:22:20 EST 2009
I'm not an FDO coder, but there are a couple things I'd look at.
First, FDODimensionality isn't an integer value representing the number of
dimensions, it's a bit-field enumeration. In this case, 2 evaluates to
FdoDimensionality_M (although, since the value of FdoDimensionality_XY is 0,
this is included by default in the evaluation of FdoDimensionality_M -
neat).
http://fdo.osgeo.org/files/fdo/docs/FDO_API/d3/d95/group__enums_g3778ef9845e2ba00e8669c32ec42e113.htm#g3778ef9845e2ba00e8669c32ec42e113
Second, the docs for CreateLineString indicate that it's looking for the
number of ordinates, not co-ordinates. I'm not sure if this is just a
terminology issue, but perhaps it is looking for 6 in your case.
http://fdo.osgeo.org/files/fdo/docs/FDO_API/d1/d7d/class_fdo_fgf_geometry_factory_0e122ad008ada729f974e407aa1285dd.htm#0e122ad008ada729f974e407aa1285dd
Jason
2009/11/1 Matteo <matteo.conte1979 at libero.it>
>
> Hi all,
> I'm new on FDO. I try to insert a new feature object on a shp file with
> VB.NET but i get this error "The type of geometry ( 'PolyLineM')
> geographical entity creates a conflict with the type of shape file (
> 'Polyline')."
> This is the code:
> Dim objCmdI As Commands.Feature.IInsert =
> objConn.CreateCommand(Commands.CommandType.CommandType_Insert)
> objCmdI.SetFeatureClassName(objClass.Name)
> Dim objPropsValues As Commands.PropertyValueCollection =
> objCmdI.PropertyValues()
> Dim objPropV As Commands.PropertyValue = New
> Commands.PropertyValue()
> objPropV.SetName("ID")
> objPropV.Value = New OSGeo.FDO.Expression.Int32Value(2)
>
>
> objPropsValues.Add(objPropV)
> objPropV = New Commands.PropertyValue()
> objPropV.SetName("Geometry")
> Dim objGeomV As Geometry.FgfGeometryFactory = New
> Geometry.FgfGeometryFactory()
>
> Dim objCoords(5) As Double
> objCoords(0) = 0
> objCoords(1) = 0
> objCoords(2) = 10
> objCoords(3) = 10
> objCoords(4) = 50
> objCoords(5) = 20
>
> Dim objLine As Geometry.ILineString = objGeomV.CreateLineString(2,
> 3, objCoords)
>
> objPropV.Value = New
> OSGeo.FDO.Expression.GeometryValue(objGeomV.GetFgf(objLine))
> objPropsValues.Add(objPropV)
> objCmdI.Execute()
> objConn.Flush()
>
> Can you help me?
> Regards,
> Matteo
>
> --
> View this message in context:
> http://n2.nabble.com/Insert-new-feature-object-on-SHP-File-tp3928348p3928348.html
> Sent from the FDO Users mailing list archive at Nabble.com.
> _______________________________________________
> fdo-users mailing list
> fdo-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fdo-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/fdo-users/attachments/20091101/468bea95/attachment.html
More information about the fdo-users
mailing list