Select to view content in your preferred language

Populating fields for web app

1713
1
05-15-2014 05:17 AM
RogerCharity_GISP
New Contributor
Hello,
A couple of questions:
1.  Is there a way to sort bookmarks so they are displayed in alphabetical order?  Or is there a way to populate bookmarks with a name field?

2.  I have an application for collection of assets in parks.  When a field worker adds a new asset (point) I want the park name that the asset is in to be displayed and collected into the attribute table.  However, there are over 400 park names.  Therefore, the drop down menu for that field is very long and the room for error is great. Is there a way to have this field populated already?  Any other ideas?
0 Kudos
1 Reply
AkhilParujanwala
Regular Contributor
Hi,

This thread is for ArcGIS Mobile and I am confused by your first question.
Maybe your first question should be in another section or could you clarify how you are creating bookmarks and where they are located on your interface. Once again I think you are looking at a web app (mentioned in your title).

For your second question it does seem possible to do what you are asking but I need to understand your workflow. Please provide a real example so that we can talk about the same objects.

I am going to take a shot at what you are trying to explain and see if this workflow matches what you requirements.

1. Employee goes to a park named St. Peters Park.
2. Employee open the ArcGIS Mobile project with 2 layers, one called Parks (polygon) and the second layer called Benches (point) (there could be other layers like lamps, garbage cans, etc).
3. Employee uses the GPS and collects the location of a bench in the park. The Attribute table appears, they fill out the all of the attributes necessary, like number of seats, colour, and associated park name (dropdown of 400 park names).
4. Employee finishes collecting the bench, but is not sure if they recorded the correct park name because there are so many names, plus the clients would be unsure if the associated park name was correct, meaning that the data could have errors.

Hence you would like to automate the park name portion so that the users don't have select a park name from the list of 400.

Yes this would be possible as long as you have these 3 things.
1. A parks polygon layer. Each park should have a field called parkname or name and it should be populated with the appropriate park name.
2. A different point layers for example Bench, Lamp, GarbageCan but with a common field called ParkName or Park. This field would be auto-populated using the same code, you really don't want different field names for each of these layers for the parkname.
3. A GPS or use Sketch Point (by map) to indicate where the point feature is located. In this case when you collect a Bench point using GPS the current GPS location must be inside the actual park, same goes for if you manually indicate where the bench is (not using GPS).

The general concept of this workflow is simply called a Spatial Intersect. I am personally using this feature for a similar usecase like you.

Here's roughly what you need to do.
1. Get the feature you are creating/editing:
//pass the feature object into your method
Intersect (Feature feature)
{

2. Obtain the layer you will be intersecting with
FeatureLayer parksFeatureLayer = MobileApplication.Current.Proeject.FindFeatureLayer("Parks");

3. Perform a query (spatial).
QueryFilter spatialQueryFilter = new QueryFilter(feature.Geometry, GeometricRelationshipType.Intersect);
FeatureDataTable featureDataTable = parksFeatureLayer.GetDataTable(spatialQueryFilter);

4. Get data from the parks layer
If(featureDataTable.Rows.Count !=0)
{
DataRow aRow = featureDataTAble.Rows[0];
string parkName = aRow.Field<string>("name");
}

5. Set the parkname into the feature you are collecting. I have not tested this particular line of code but I think it should work.
feature.FeatureDataRow["name"] = parkName;
}


I hope this helps.
Please inform us of your findings.


Regards,


Akhil P.
0 Kudos