Hi Russ. I am working on a damage collection system and would like to show the current locations of our emergency responders rather than a collection of points showing where they have been. This info would be displayed in our emergency operations center as well as to our decision makers using Operations Dashboard. I was hoping you were able to find out from the dashboard team if displaying current location rather than a collection of points was possible. Thanks.
Was there any solution to this either in a web map or dashboard? A regular filter won't work but I could see something like a definition expression that could work...however I'm wondering if anyone has found a solution or if you got an update on this (even though the thread is old).
currently location tracking is still just a bread crumb trail and there is not an out of the box solution that will only display the most recent point in that track log.
Russ
So I have found a solution to this problem, however you have to add a definition expression to the JSON and you have to have standardized query set to false on the server (or ArcGIS Online) to be able to accomplish it. I have successfully got it working on both a hosted tracking layer and one in ArcGIS for Server (with an enterprise geodatabase backend) which is it's own hack. However there is something Portal that is blocking the advanced query. So a query can solve this problem, but you are editing things like the JSON at your own risk. We do have a customer who is successfully doing this though.
Could you elaborate on this a bit more? Can you access the json from the layer properties in AGOL? And what does the query look like? Thanks, cob
You can access the JSON from the ArcGIS Online Assistant: ArcGIS Online Assistant
The query would look like something that you have done in a definition query but using some of the advanced query functions. You also have to know the full name of the data table, not just what might show up in a connection.
Example: CreationDate IN (SELECT MAX(CreationDate) FROM db_193.user_193.Collector_Tracking_Layer_Location_Tracking GROUP BY Creator)
Your query would have to go in a definition expression for that layer (if you are doing it in a map) or as part of the layer properties for an item in Portal/ArcGIS Online. A way to figure out where that location is, add a filter to the layer in the map and look at where that shows up in the JSON.
Please keep in mind that editing the JSON is entirely at your own risk and not supported by Esri.
Thank you Leah. I see where the query is, but not sure how to reference the data table in the query i.e. the db_193 stuff - is this information in here?
"id": "Aerial_Tracking_5587", "layerType": "ArcGISFeatureLayer", "url": "http://services2.arcgis.com/iXA1dC6ldRMKRwra/arcgis/rest/services/Aerial_Tracking/FeatureServer/0", "visibility": true, "opacity": 1, "title": "Aerial Tracking", "itemId": "507623ea30c341ecb26b3652df53bd1a", "layerDefinition": { "definitionExpression": "Accuracy < 25"
Thanks! cob
If it is an enterprise geodatabase, you will need to go and look at the full name including the database, user, etc. Sometimes you can search through the rest api to find the table name as well. This is likely the trickiest part.
Well, it's just a feature service created in AGOL based on the location tracking template from ESRI. Is the info I need contained in the rest from the template file or from the one I created based on it? If it's ESRI's file is should be easy to come up with a boilerplate because most are using that template to create the tracking layer and we want to do the same thing (plot current location of collector). I'm sorry, it's likely I'm not following you too well - my understanding of database infrastructure is limited. Thanks much, cob
I am interested in the ability to only show current location using the location tracking. Is this something that has been updated since this thread was started in May?
The following expressions does the trick for me
In ago-assistant:
"definitionExpression": "\"CreationDate\" IN (SELECT MAX (\"CreationDate\") FROM db_<the_number>.user_<the_number>.<feature_service_name>_<layer_name> GROUP BY \"Creator\")"
Thanks to Leah for the solution.
Where do you add this script? I keep getting an error that the JSON is invalid no matter where I add this.
The easiest way to figure this out is to add a filter in the web map to the layer that you plan to add the query to. Then go back to the JSON and look for that query in the JSON by finding "definitionExpression".
How do you find feature service No and user number. That is the key I am missing. Also I know the layer name but not the feature service name? Is there somewhere to get all this information? I have scoured the Json file but have not found anything the looks like what I have seen from others.
Thank you
Jacob
Figured it out had to go through the Admin definition file.
Would this approach work in Portal for ArcGIS?
Cant seem to get it working in 10.4.1
Getting a number of errors in console which makes me suspect that it relates to the 'allow standard SQL queries' option which only appears to be available within ArcGIS Online and not Portal admin security settings
Although it won't display a location if a person is no longer being tracked, there is now a way to filter "in the last" minute through a webmap. This may cater for some use cases. The definitionExpression that is being used is:
EditDate BETWEEN CURRENT_TIMESTAMP - 0.0006944444444444445 AND CURRENT_TIMESTAMP
It does not require the "Allow only standard SQL queries" setting to be turned off. The above definitionExpression is used for the filter below:
The minimum filter you can do through the ArcGIS Online Map Viewer is in the last 1 minute, but you could probably alter that via ArcGIS Online Admin Assistant if necessary.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.