Updating vehicle locations in Web Map

11-22-2021 10:52 AM
Occasional Contributor II

Not necessarily looking for specific code help but mostly soliciting general ideas on how others have or would proceed. 

We don't have Geoevent Server. Externally, where this will run we have an ArcGIS Server setup which hosts some of our public web services. On that machine I have ArcMap 10.8 as well as the most current ArcGIS Pro. So far I've been hacking away using the existing Python 2.7 with Pythonwin. We also have an ArcGIS Online site where the Web Maps for public consumption are hosted.

I was asked by one of our divisions if I could create a publicly available web map that would display snow plow locations. All of our large vehicles in Public Works have GPS tracking through a 3rd Party. That third party has given me login credentials which I can use to gain access to their SOAP endpoint. 

Using python I have been able to login, retrieve a session id token and then turn around and retrieve vehicle lists as well as vehicle snapshots (containing location, speed, heading, ignition status, etc.) in XML.

Again using python I've been able to parse out the information I need to get it into excel and then arcpy to get it into a file geodatabase as a table. So far these steps were really just to determine whether or not I would be able to retrieve usable data. I believe I have done that. I can create points and view them in either ArcMap or Pro.

As I said initially this is more a of a request for ideas. In the end I need to publish a service that I can consume in a web map that will display the current location of certain vehicles, for example snow plows. These locations will need to refresh with new locations relatively frequently when the plows are running. 

I will also maintain the location history of the vehicles for some period of time, undetermined at this point, in case we want to go back and display vehicle movement over time. Just for an idea of the scale of the project, there are a total of 29 vehicles and for plowing purposes they would use a small subset of those.
While the plows are running I would need to have python requesting location snapshots on some periodic but frequent basis. Make some useable GIS data from it. Display the latest locations on the map while maintaining the previous locations. I'm sure there are lots of things I am not considering so I thought I would throw it out there for suggestions.

0 Kudos
2 Replies
MVP Regular Contributor

Hello Keith,

Cool project! (lol no pun intended because it's for snow plows).

Sounds like you have done all the heavy lifting already with your python scripts.  The last piece would be to determine if you are going to publish this dataset as a feature service hosted on your ArcGIS Server or Online.  Then the frequency and method of updates would be your next concern.

For example, I have an ArcGIS Pro project saved with a polygon feature class.  I have set up a definition query to show only a certain subset of data from the polygon feature class.  I published it as a hosted feature service in ArcGIS online and I update it daily using a python script which takes the latest subset of data form my ArcGIS Pro project and updates the hosted feature service in AGOL.

Amanda Bishop, GISP
Occasional Contributor II

Hello Amanda,

   I accept your pun as well as the rest of your post. 

I thought about publishing a service locally and adding it to AGS Online, thinking it would be easier to update underlying data and then have it refresh at some interval. I thought I might append the new data to the existing, that takes care of maintaining a history. Then figure out a filter or definition query that just shows the latest location based on time. Alternately create two separate featureclasses, one for history and one where I replace the old locations with the new. I'll have to play around with it to discover the error of my ways.