We have an iOS application (using the Xamarin Forms API). This uses a custom LocationDataSource to receive data from an external high accuracy GPS device. We also use the SharpGIS Nmea parser from @dotMorten_esri to parse the incoming NMEA sentences
In general this all works without issue. Where we do have occasional problems which then results in a failure to sync a table is with writing the ESRIGNSS_FIXDATETIME and I have no idea how this could occur. But in a high number of the offline *.geodatabases that fail to sync when this data is exported to cvs and opened in Excel the ESRIGNSS_FIXDATETIME comes in as a number and does not get converted to a date. The reason for bringing in Excel is because the attribute table will not open in ArcGIS Pro and this is the only way to see the bad data.
What the application does in order to send these GPS collection data is to extend the Esri.ArcGISRuntime.Location.Location class and add the additional data
public class NmeaLocation : Esri.ArcGISRuntime.Location.Location
{
public NmeaLocation(MapPoint position, double horizontalAccuracy, double velocity, double course, bool isLastKnown) : base(position, horizontalAccuracy, velocity, course, isLastKnown)
{
}
public NmeaLocation(DateTimeOffset? timestamp, MapPoint position, double horizontalAccuracy, double verticalAccuracy, double velocity, double course, bool isLastKnown) : base(timestamp, position, horizontalAccuracy, verticalAccuracy, velocity, course, isLastKnown)
{
}
public Gga.FixQuality FixQuality { get; set; }
public double Hdop { get; set; }
public double Vdop { get; set; }
public double Pdop { get; set; }
public short NumSats { get; set; }
public string Receiver { get; set; }
}
This object is then sent into the UpdateLocation method of the custom LocationDataSource and I can use the additional properties to update the GPS attributes in the feature class. Updating the ESRIGNSS_FIXDATETIME is pretty straight forward
if (feature.Attributes.ContainsKey("ESRIGNSS_FIXDATETIME"))
{
if ( nmeaLocation.Timestamp != null )
{
feature.SetAttributeValue("ESRIGNSS_FIXDATETIME", nmeaLocation.Timestamp.Value.UtcDateTime);
}
}
This does not throw an exception, but it writes the invalid value.
Is there a way to validate this data before writing it to the table? What else could be done? While this does not occur frequently, it only needs happen once on a job to break the sync.
@MichaelBranscomb
Thanks
-Joe