How to create Geometry in the GeoEvent Service

1577
1
Jump to solution
08-30-2017 11:05 AM
DanHuber
New Contributor III

I have an input from a JSON service that does not always have values for the LAT, LON fields that is generating a lot of errors when trying to generate the Geometry field.    I've dropped the Create Geometry option for the input definition, and have created a filter that ignores records without LAT, LON values, but I'm unsure how to remap the Geometry field for my output definition.   I have a field mapping processor setup, but I'm not getting any data in my streaming service.

Thanks,

Dan

0 Kudos
1 Solution

Accepted Solutions
DanHuber
New Contributor III

Hate leaving questions unanswered - even if they are my own.    I finally resolved my issue of creating the Geometry object after I received the JSON from the input.    There is actually a section in the Esri Introduction Tutorial that covers this - in Appendix A.   

My solution involved doing the following in the GeoEvent Service:

  1. From the input, use a filter to reject all items that contained NULL longitude values
  2. Use the Field Calculator Processor to generate the Geometry object:
    • The Expression:  '{' + ' "x":' + lon + ',' + ' "y":' + lat + ',' + ' "spatialReference":{"wkid":4326} }'

Here is the GeoNet article that pointed me in the right direction.

Building Geometry from Fields 

View solution in original post

1 Reply
DanHuber
New Contributor III

Hate leaving questions unanswered - even if they are my own.    I finally resolved my issue of creating the Geometry object after I received the JSON from the input.    There is actually a section in the Esri Introduction Tutorial that covers this - in Appendix A.   

My solution involved doing the following in the GeoEvent Service:

  1. From the input, use a filter to reject all items that contained NULL longitude values
  2. Use the Field Calculator Processor to generate the Geometry object:
    • The Expression:  '{' + ' "x":' + lon + ',' + ' "y":' + lat + ',' + ' "spatialReference":{"wkid":4326} }'

Here is the GeoNet article that pointed me in the right direction.

Building Geometry from Fields 

View solution in original post