Skip to main content

Get Attribute from Shapefile

Comments

5 comments

  • Stephanie Nicholson
    Hi Walter,

     

    I've just attempted to replicate this with a colleague. You mentioned you're getting a FeatureSet already - if you're using a Workflow, the FeatureSet converted from a shapefile probably won't have a "fields" property with the field metadata. But there will be a list of features with attributes - both the name and attribute value are stored. If you wanted to pull the field names from that, you could use a method like this: 

     

    Workflow example to pull name, attribute value

     

    You can pull attribute values from a FeatureSet using the format featureSet1.Features(0).Attributes("attributename"). That gets "attributename" from the first feature, or you could use ForEach to cycle through your FeatureSet.

     

    If you're hoping to accomplish this without using a Workflow, that will be different.

     

    Hope that helps!

     

    Stephanie
    0
  • Permanently deleted user
    Stephanie,

     

    Thank you Stephanie for pointing me in the right direction. I was able to apply your suggestion and create a list of related attributed for the upload shapefile.

     

    Thank you.

     

    Walter
    0
  • Permanently deleted user
    Hi, would you mind sharing your workflow / xaml text details here? The link seems to have been removed from Stephanie's response above. Thanks
    0
  • Permanently deleted user
    Thanks Stephanie for the image capture.  

     

     

    Walter / Stephanie, were you able to label the uploaded graphics based on attributes from the uploaded shapefile and if you could kindly share details of the steps you took to accomplish it? 
    0
  • Permanently deleted user
    Morning Mohammad/Stephanie,

     

     

    I was able to build a workflow that labeled uploaded shapefiles, but only for point features. Here's a couple of issues I ran into:

     

     

    1. You cannot select an existing shapefile that has already been uploaded, due the elastic search engine.

     

    2. The renderers I've used have offsets applied to the placed text. There are no settings (at least to my knowledge) on how to apply a renderer for a polyline or polygon, for labeling purposes.

     

    3. There's only one way to remove the placed renderer text and this text cannot be manipulated in any way. You'd need to run the UpdateGraphicsLayer with remove all features to true.

     

     

    Please email me at walter.dziuba@cnl.ca for a copy of the workflow. It's too large to post.

     

     

    Enjoy...Waler

     

     

     
    1

Please sign in to leave a comment.