Zum Hauptinhalt gehen

Create Points at Line Vertices

Kommentare

3 Kommentare

  • Permanently deleted user
    Hi Brian, 

     

    You can work directly with the path's MapPoint objects that the X and Y values come from.  You'll likely want to build a feature (ESRI.ArcGIS.Client.Graphic) around your desired point or around each point, and then add that feature to a featureset or a collection of features.  Then you can use the featurset/collection in an AddFeatures activity's "Features" property.
    • To build a featureset, Assign yourPointFSVariable = New FeatureSet().  Make sure to set the spatial reference for the featureset, eg- yourPointFSVariable.SpatialReference = yourLineFS.SpatialReference
    • To build a feature, Assign yourGraphicVariable = New ESRI.ArcGIS.Client.Graphic().  Then you can assign yourGraphicVariable.Geometry = thePointFromThePath.  I can't remember off the top of my head, but you might also need to assign the yourGraphicVariable.Geometry.SpatialReference.
    • To add a feature to a featureset, you can use the AddToCollection activity.  The TypeArgument is ESRI.ArcGIS.Client.Graphic, the collection is yourPointFSVariable.Features and the item is yourGraphicVariable.
    Hope that helps!

     

    -Amanda
    0
  • Permanently deleted user
    thank you Amanda. What I ended up doing was Getting the Geometry of a line selection and then getting the centroid of that line. I then projected that result to a single geometry, buffered and turned the graphic into an envelope. I created a new map point and assigned the value to read new ESRI.ArcGIS.Client.Geometry.MapPoint(((envelope2.Xmax + envelope2.Xmin)/2), ((envelope2.Ymax + envelope2.Ymin)/2 ),spatialreference1). This map point is working as the centroid and I'm able to add a markup to the map from the workflow. My problem now is getting this map point feature to be able to supply to the Add Features activity. I tried to cast the map point back to a geometry, then assign the new geometry to a graphic, insert the graphic into a list and finally Add Features. The workflow runs but the point is not placed in the right location and has no display. A record shows in my feature service table but I think it has an empty Geometry. Is there an easier way to get the map point into the Add Features activity? It seems like I'm having issues converting the map point into a geometry.
    0
  • Permanently deleted user
    I was able to solve this by assigning the graphic geometry to the map point created from the X,Y.
    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.