Select to view content in your preferred language

Handling GeoEvents with null values

1314
2
10-26-2020 06:51 AM
BjarkeThormann
Emerging Contributor

I have a field calculator processor for converting x,y-fields to geometries. The expression is: '{' + ' "x":' + POINT_X + ',' + ' "y":' + POINT_Y + ',' + ' "spatialReference":{"wkid":3021} }'

However for some GeoEvents the x,y values are null and and error is thrown in the log, see below.

How can I convert the null values to 0.0?

Preferably all events would have a position, but they don't, and I get so many errors in the log that other important information is hard to find, so it would be better to change the null values to 0.0.

Expression ['{' + ' "x":' + POINT_X + ',' + ' "y":' + POINT_Y + ',' + ' "spatialReference":{"wkid":3021} }'] evaluation failed: operator+(arg0:[NonGroup], arg1:[NonGroup]) evaluation failed because of GeoEvent field 'POINT_X' of type [Double] and value 'null' cannot be used as an argument arg1:[NonGroup]

Tags (1)
0 Kudos
2 Replies
Stefan_Jung
Esri Contributor

Hi Bjarke Thormann‌,

in this case I think using two filters is the easiest option. Maybe it it not the most elegant way, cause you need a positive and a negative filter but it is going to solve your problem. 

Positive Filter is just checking if you have a valid geometry and is processing the field calculator like you described. Negative Filter would check if no geometry is available, in this case you could use a copy of you field calculator that is using hardcoded coordinates (0.0./0.0) instead of X/Y. 

Like I mentioned, its not so elegant but will work.

Best,

Stefan

0 Kudos
BjarkeThormann
Emerging Contributor

Thank you! I guess that's how to do it.

/B

Confidentiality: C2 - Internal

Från: Stefan P. Jung <geonet@esri.com>

Skickat: den 27 oktober 2020 08:45

Till: Thormann Bjarke (YRD) <bjarke.thormann@vattenfall.com>

Ämne: Re: - Re: Handling GeoEvents with null values

GeoNet, The Esri Community | GIS and Geospatial Professional Community <https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.esri.com%2F%3Fet%3Dwatches.email.thread&data=04%7C01%7Cbjarke.thormann%40vattenfall.com%7C8d41371c84394a777e3508d87a4c5fea%7Cf8be18a6f6484a47be7386d6c5c6604d%7C0%7C0%7C637393815739466795%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=DkvOSOOfSoSM9DYBuOniany6gFT%2B9pL19FWKmPu0LKY%3D&reserved=0>

Re: Handling GeoEvents with null values

reply from Stefan P. Jung<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.esri.com%2Fpeople%2Fstefan.jungesri-de-esridist%3Fet%3Dwatches.email.thread&data=04%7C01%7Cbjarke.thormann%40vattenfall.com%7C8d41371c84394a777e3508d87a4c5fea%7Cf8be18a6f6484a47be7386d6c5c6604d%7C0%7C0%7C637393815739466795%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=AgjtJ8RVAbr1F2qPd8Jhfz4F2sO%2BuAXvYDQ2rfzCrJw%3D&reserved=0> in GeoEvent - View the full discussion<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.esri.com%2Fmessage%2F961243-re-handling-geoevents-with-null-values%3FcommentID%3D961243%26et%3Dwatches.email.thread%23comment-961243&data=04%7C01%7Cbjarke.thormann%40vattenfall.com%7C8d41371c84394a777e3508d87a4c5fea%7Cf8be18a6f6484a47be7386d6c5c6604d%7C0%7C0%7C637393815739466795%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8rl%2BLrQn53kyKKYGkoa6moS2NpcVSxHnYFpAf%2Byfalw%3D&reserved=0>

0 Kudos