Select to view content in your preferred language

Geometry precision issue when using SDF

2661
10
Jump to solution
04-20-2021 09:59 AM
MingHome
Regular Contributor

Dear Python and SDF experts,

I encountered an issue when using SDF/SeDF. 

I have two supposedly identical datasets in both local FGDB (featureclass) and AGOL (hosted featurelayer).  To keep both datasets in sync, I am using Pandas and Spatial DataFrame to compare two dataset and to identify any difference in attributes and/or geometry/Shape. If the changes are detected in source dataset, I will modify the target dataset accordingly. It is tested great for all the attributes. However, there is an issue to compare the geometry/SHAPE field between two "supposedly identical" SDF created from gdb and agol.

I found that the precision of coordinators would be altered after a feature is copied/published from FGDB to AGOL, or vice versa. Although the difference is tinny, 9th or 10th digits after decimal, it failed to pass the "identical test" with SDF merge operation. Below is a example:

SHAPE column of Line feature created in FGDB: 
    {'paths': [[[1371391.9402663112, 549074.1051290631], [1371627.089730382, 547898.3574805558], ... ...
Copied to AGOL:
    {'paths': [[[1371391.94026631, 549074.105129063], [1371627.08973038, 547898.357480556], ... ...

Does any one encountered similar issue? and know how to resolve this issue?

I thought of using the Pandas.dataframe.round("SHAPE",8) function to round the decimal of the SHAPE coodinators to 8 or even less. However, it seem that the SHAPE in sdf is not a "number" type and the round would not work if I direct use the round function against "SHAPE". Any thoughts and suggestions?

 

Thanks,

 

Ming

0 Kudos
10 Replies
jcarlson
MVP Esteemed Contributor

Oh, very interesting workaround! Glad you found a solution!

- Josh Carlson
Kendall County GIS
0 Kudos