Get Attribute from Shapefile
While using Essentials v4.8.0.107 with the viewer being v2.9, I'm attempting to extract a list of field names so my client can select them to label the uploaded shape file.
I can create the featureset from the uploaded shape file, but I can't seem to obtain any field names or values from an existing field.
Has anyone tried to accomplish this?
Walter
0
-
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:
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!
Stephanie0 -
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.
Walter0 -
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 -
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 -
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...Waler1
Du måste logga in om du vill lämna en kommentar.
Kommentarer
5 kommentarer