Synchronized GeoFences not updating correctly

4043
10
01-10-2014 10:41 AM
MarkCollins
Occasional Contributor
I'm trying to add a synchronized geofence for a feature service that currently only has two items. In the geofences section of the manager its only showing one of the fences. Any idea why its not reading in all my fences? (Both items have similar data and geometry, but different data in the geofence Name field. The geometry is not overlapping.) I found this error in the GEP log:

Unclassified error updating the geofences from server arcgis in service CameraPresets. java.lang.NullPointerException at com.esri.ges.processor.geotagger.GeoTagger.update(GeoTagger.java:352)[266:com.esri.ges.framework.processor.geotagger-processor:10.2.0] at java.util.Observable.notifyObservers(Observable.java:159)[:1.7.0_17] at com.esri.ges.manager.aoi.internal.AoiManagerImpl.notifyObservers(AoiManagerImpl.java:240)[299:com.esri.ges.manager.internal-aoimanager:10.2.0] at com.esri.ges.manager.aoi.internal.AoiManagerImpl.notifyObservers(AoiManagerImpl.java:471)[299:com.esri.ges.manager.internal-aoimanager:10.2.0] at com.esri.ges.manager.aoi.internal.AoiManagerImpl.updateAoi(AoiManagerImpl.java:194)[299:com.esri.ges.manager.internal-aoimanager:10.2.0] at com.esri.ges.manager.aoi.internal.AoiManagerImpl.addOrUpdateGeofences(AoiManagerImpl.java:462)[299:com.esri.ges.manager.internal-aoimanager:10.2.0] at com.esri.ges.manager.aoi.internal.AoiManagerImpl.registerGeofences(AoiManagerImpl.java:441)[299:com.esri.ges.manager.internal-aoimanager:10.2.0] at com.esri.ges.manager.aoi.internal.AoiManagerImpl.run(AoiManagerImpl.java:340)[299:com.esri.ges.manager.internal-aoimanager:10.2.0] at java.lang.Thread.run(Thread.java:722)[:1.7.0_17]


Another question: When creating synchronized geofences is it better to point it at the MapServer or FeatureServer endpoint?

My ultimate goal is to have a user editable feature service of geofences which are used by GEP via syncing.

Thanks,
Mark
0 Kudos
10 Replies
RJSunderman
Esri Regular Contributor
Hello Mark -

Would you mind packaging your map document and data as a MPK and sending that to me?  I'd like to take a look at the features used to publish the feature service.

As for your second question, synchronizing your GeoEvent Processor's GeoFences through the MapServer endpoint is really the same as using the FeatureServer endpoint. GEP is retrieving the coordinate data from the features in the service and then using the retrieved coordinates for its spatial comparisons. GEP is not referencing the actual features from the feature service, so there's no clear benefit to using the MapServer over the FeatureServer endpoint.

- RJ
0 Kudos
MarkCollins
Occasional Contributor
RJ,

Here is the MPK you requested. Thanks for the help.

-Mark
0 Kudos
VladislavPlechnoy
New Contributor III
Mark,
I was able to successfully setup a synchronization rule that imports two geofences from the service published using the map package file you shared with us. Here are the two geofences in json format I see available on my 10.2.0 instance of GeoEvent processor:

[{"category":"PTZ","name":"CAM2","active":true,"subscriptionID":1,"geometries":[{"value":{"rings":[[[-50.80078124954654,-26.194876675510773,0.0],[-33.92578124987433,-26.980828590149343,0.0],[-32.51953125012625,-41.31082388091937,0.0],[-51.503906249869736,-42.48830197980847,0.0],[-50.80078124954654,-26.194876675510773,0.0]]],"spatialReference":{"wkid":4326}}}]},{"category":"PTZ","name":"CAM3","active":true,"subscriptionID":1,"geometries":[{"value":{"rings":[[[-58.18359375024528,-23.26153416780188,0.0],[-67.1484375003238,-37.45741810237051,0.0],[-85.60546875027406,-39.65645604818096,0.0],[-87.01171875002215,-24.547123179650182,0.0],[-58.18359375024528,-23.26153416780188,0.0]]],"spatialReference":{"wkid":4326}}}]}]

So far everything works as expected.

Now, let me try to put together the rest of the puzzle. If you want me to use the same data as you use for generating Alerts may I ask you a favor to send me another map package to work with. Otherwise I will setup a sample dataset according to the schema you shared with me in the different thread as follows:
Alerts
�?� CREATED
�?� MESSAGE
�?� PRIORITY

I would also like to verify the schema of your GeoFence layer. According to the other thread it should look like this:

Geo Fence layer
�?� AreaID
�?� Region
�?� ManagerName

According to the map package you already shared with us this layer has a little different schema. Can you do me a favor and verify that data I am using matches yours.

My plan is to send you the configuration and ask you to import it into your server environment and verify after I fully complete deploying your scenario to my box here.

Please let me know.
Vlad.
0 Kudos
MarkCollins
Occasional Contributor
Vlad,

The fields you have for the alerts are the correct list. Please use the mpk I sent you for the geo fence fields. (I was just using the others to describe a simpler example). I have gotten the service working w/ the field enricher method you described previously, currently my only outstanding issue is w/ the geofence syncing.

I've attacheds screenshot of my settings I've used when trying to create the synchronized goefences. For some reason it only syncs one of the areas. Is there anything else I can check (logs, ect)? I've tried recreating it several times.
0 Kudos
VladislavPlechnoy
New Contributor III
Mark,

Please see attached archive and read README.txt file there.
Let me know if something doesn't work fro you.

I am standing by...

Vlad.
0 Kudos
MarkCollins
Occasional Contributor
Vlad,

Thanks for the detailed help. I tried the steps you listed in your doc and the files you sent but had trouble with the GeoFences syncing correctly. Its only syncing one of the items, not both for some reason. Here is the error I'm getting in the log. I've also attached a screenshot of the Geofence display from the GEP admin.

Unclassified error updating the geofences from server arcgis in service UIControlChannel. java.lang.NullPointerException at com.esri.ges.processor.geotagger.GeoTagger.update(GeoTagger.java:377)[266:com.esri.ges.framework.processor.geotagger-processor:10.2.0] at java.util.Observable.notifyObservers(Observable.java:159)[:1.7.0_17] at com.esri.ges.manager.aoi.internal.AoiManagerImpl.notifyObservers(AoiManagerImpl.java:240)[299:com.esri.ges.manager.internal-aoimanager:10.2.0] at com.esri.ges.manager.aoi.internal.AoiManagerImpl.notifyObservers(AoiManagerImpl.java:471)[299:com.esri.ges.manager.internal-aoimanager:10.2.0] at com.esri.ges.manager.aoi.internal.AoiManagerImpl.deleteAoi(AoiManagerImpl.java:211)[299:com.esri.ges.manager.internal-aoimanager:10.2.0] at com.esri.ges.manager.aoi.internal.AoiManagerImpl.registerGeofences(AoiManagerImpl.java:416)[299:com.esri.ges.manager.internal-aoimanager:10.2.0] at com.esri.ges.manager.aoi.internal.AoiManagerImpl.run(AoiManagerImpl.java:340)[299:com.esri.ges.manager.internal-aoimanager:10.2.0] at java.lang.Thread.run(Thread.java:722)[:1.7.0_17]

I can setup a gotomeeting or something if you want to take a look directly at the server. I have a feeling there might be some config data stuck in the backend db or config files of GEP or something..

Thanks,
Mark
0 Kudos
VladislavPlechnoy
New Contributor III
Mark,

Let us troubleshoot it further.

Can you do me a favor and send this request to your ArcGIS Server using any web browser

http://[ArcGIS Server host]:[ArcGIS Server port (6080)]/arcgis/rest/services/Forum/CameraPresets/FeatureServer/0/query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=OBJECTID%2CCAMERAID%2CZONETYPE&returnGeometry=false&maxAllowableOffset=&geometryPrecision=&outSR=&gdbVersion=&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&f=pjson

This is exactly the request GeoEvent processor sends to ArcGIS Server when GeoFence synchronization occurs.

This should render something similar to this:
{
"objectIdFieldName": "OBJECTID",
"globalIdFieldName": "",
"fields": [
  {
   "name": "OBJECTID",
   "alias": "OBJECTID",
   "type": "esriFieldTypeOID"
  },
  {
   "name": "ZONETYPE",
   "alias": "ZONETYPE",
   "type": "esriFieldTypeString",
   "length": 50
  },
  {
   "name": "CAMERAID",
   "alias": "CAMERAID",
   "type": "esriFieldTypeString",
   "length": 50
  }
],
"features": [
  {
   "attributes": {
    "OBJECTID": 401,
    "ZONETYPE": "PTZ",
    "CAMERAID": "CAM2"
   }
  },
  {
   "attributes": {
    "OBJECTID": 801,
    "ZONETYPE": "PTZ",
    "CAMERAID": "CAM3"
   }
  }
]
}

Can you verify what you are getting please?
-Vlad.
0 Kudos
MarkCollins
Occasional Contributor
vlad,

Here is what I am getting back from that query...

{
"objectIdFieldName": "OBJECTID",
"globalIdFieldName": "",
"fields": [
  {
   "name": "OBJECTID",
   "alias": "OBJECTID",
   "type": "esriFieldTypeOID"
  },
  {
   "name": "ZONETYPE",
   "alias": "ZONETYPE",
   "type": "esriFieldTypeString",
   "length": 50
  },
  {
   "name": "CAMERAID",
   "alias": "CAMERAID",
   "type": "esriFieldTypeString",
   "length": 50
  }
],
"features": [
  {
   "attributes": {
    "OBJECTID": 801,
    "ZONETYPE": "PTZ",
    "CAMERAID": "CAM3"
   }
  },
  {
   "attributes": {
    "OBJECTID": 401,
    "ZONETYPE": "PTZ",
    "CAMERAID": "CAM2"
   }
  }
]
}
0 Kudos
VladislavPlechnoy
New Contributor III
Mark,

This means you have both GeoFences in place and ArcGIS Server works correctly when GeoEvent processor requests them. Now, something is wrong on the GeoEvent processor end that I cannot reproduce on my box. Let me suggest a �??clean setup�?? of GeoEvent processor at this moment.

Here is what I need you to do:

1) Run �??Services�?? Tool from Control Panel->Administrative Tools on the machine where GeoEvent Processor is running. Stop �??GeoEvent Processor�?? service.

2) Clean up the content of �??C:\Program Files\ArcGIS\Server\GeoEventProcessor\data�?? folder.

3) Navigate to �??C:\ProgramData\Esri�?? folder and create a copy of �??GeoEventProcessor�?? folder. This will back up the latest GeoEvent processor configuration you have. If this folder is not visible use �??Folder Options�?? tool and enable �??Show hidden files, folders, and drives�?? option in the �??View�?? tab.

4) Open master �??GeoEventProcessor�?? folder and remove all folders in there except �??cert�??. This will clean up GeoEvent processor configuration and allow �??clean start�?? the next time GeoEvent processor starts.

5) Start �??GeoEvent Processor�?? service.

6) Apply the procedure I outlined in the word document before and let me know if you see your issue is fixed or not.

Thanks,
Vlad.
0 Kudos