AnsweredAssumed Answered

Update feature attributes only when not Empty (not NaN)

Question asked by MBennTLL on Jun 14, 2019

Hello community,

 

I already have a workaround for my problem, but I'm curious if there is a more elegant way to handle it.

 

I receive messages on a UDP port as comma comma-separated values (25 fields). These are never complete. Most of the time I receive geometric information only (ID, coordinates, speed). Occasionally I receive additional information for my IDs (ID, name, measurements, destination).

 

## Geometrics
#ID, Ycoord, Xcoord, speed, ..., time
000123,9.1543,55.7552,235.89,,,,,,,,,,,,,,,,,,,,05/31/2019, 08:38:10
000123,9.1544,55.7553,250.30,,,,,,,,,,,,,,,,,,,,05/31/2019, 08:38:15

## Additional Information
#ID, ... , name, ... measurements ..., destination, time
000123,,,,,,,,,,Vehicle1,74,,,,8,1,6,5,3,0,6.40,Destination2,05/31/2019, 08:38:00
000123,,,,,,,,,,,74,108,12,10,8,1,,,,,,,05/31/2019, 08:38:30

 

The geometrics are filtered from the rest in GeoEvent Server. The idea is to later enrich it with the additional information.

 

Normally, I would Update a feature layer with the additional information and use the hosted feature layer to enrich the geometric data. However, as you can see the data contains empty/nan values, which leads to crucial information (Name, Destination) occasionally being unavailable when updating+enriching.

 

  • How can I update a feature layer while ignoring single empty/nan attributes?

 

I'm sincerely thankful to any suggestions.

 

kind regards, Markus

 

 

PS:

For now, I'm writing everything to csv, and using a python script to group the data, export it to csv/json,and load it to GeoEvent Server. Which seems to me like a unnecessary loop.

df2 = df2.groupby('ID', as_index=False).last()

The function ignores NaN-values by default.

Outcomes