Mapping Moving Points

3953
2
Jump to solution
09-11-2014 08:05 AM
LoganCaraway
New Contributor II

I have been tasked with implementing a number of our mobile assets into our web GIS. For example we have trucks with devices that send coordinate data which we can consume via SOAP services. One thought is to parse the XML into a database and then plot a X,Y Layer from the tables and host via ArcGIS Server. Are there alternative solutions? Is there a best practice for this type of scenario?

Reply
0 Kudos
1 Solution

Accepted Solutions
PaulCrickard1
Occasional Contributor II

If you can get GeoEvent, go for it. I do this:

I have a webmap that uses HTML 5 geolocation. On finding location, I send the data to my feature class using ARCGIS REST API. There is a viewer webpage that watches all the feature classes (one for each person). It refreshes automatically every 3 seconds.

If you can get XY, just publish a service on server and use REST to push in the data.

I do this onLocationFound() and I only need the current location - I don't care about saving for later - so I delete all the features first.

  deleteFeature();

  var url = "http://YourDomainName/ArcGIS/rest/services/Pauleverymove/FeatureServer/0/addFeatures";

  var p1 = '[{"geometry":{"x":';

  var p2=position.coords.longitude;

  var p3=',"y":';

  var p4=position.coords.latitude;

  var p5='}}]&f=json';

  pathToAdd=p1.concat(p2,p3,p4,p5);

  var params = "features="+pathToAdd;

  var http = new XMLHttpRequest();

  http.open("POST", url, true);

 

  http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

  http.onreadystatechange = function() {//Call a function when the state changes.

  if(http.readyState == 4 && http.status == 200) {

  //alert(http.responseText);

  }

  }

  http.send(params);

I also have one using Node.js and Websockets that broadcasts to everyone on the webpage. This is cool.

View solution in original post

Reply
0 Kudos
2 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Logan,

I think you should contact your account manager about getting the GeoEvent Extension for ArcGIS Server.

Reply
0 Kudos
PaulCrickard1
Occasional Contributor II

If you can get GeoEvent, go for it. I do this:

I have a webmap that uses HTML 5 geolocation. On finding location, I send the data to my feature class using ARCGIS REST API. There is a viewer webpage that watches all the feature classes (one for each person). It refreshes automatically every 3 seconds.

If you can get XY, just publish a service on server and use REST to push in the data.

I do this onLocationFound() and I only need the current location - I don't care about saving for later - so I delete all the features first.

  deleteFeature();

  var url = "http://YourDomainName/ArcGIS/rest/services/Pauleverymove/FeatureServer/0/addFeatures";

  var p1 = '[{"geometry":{"x":';

  var p2=position.coords.longitude;

  var p3=',"y":';

  var p4=position.coords.latitude;

  var p5='}}]&f=json';

  pathToAdd=p1.concat(p2,p3,p4,p5);

  var params = "features="+pathToAdd;

  var http = new XMLHttpRequest();

  http.open("POST", url, true);

 

  http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

  http.onreadystatechange = function() {//Call a function when the state changes.

  if(http.readyState == 4 && http.status == 200) {

  //alert(http.responseText);

  }

  }

  http.send(params);

I also have one using Node.js and Websockets that broadcasts to everyone on the webpage. This is cool.

View solution in original post

Reply
0 Kudos