set XY values to two decimal places in polygon feature class

6105
3
12-30-2015 01:47 AM
Labels (1)
tinyMee
New Contributor

Dear all,

I would like to check with you, in Polygon feature class, how to set the XY values precision only two decimal places without rounding up. I have tried to set XYResolution to 0.01 to store only two decimal digits. But the value is rounded up and changed the position.

Is there any setting to create a polygon feature class by truncating two decimal places of original XY values?

Eg, X= 0.389 ,  Y= 2.467 to X = 0.38 , Y = 2.46

Thanks.

Tags (2)
0 Kudos
3 Replies
DanPatterson_Retired
MVP Emeritus

XY Tolerance (Environment setting)—Help | ArcGIS for Desktop There is no mention of either rounding or truncation.  I suspect rounding would be used to enable rounding up or down to ensure features meet.

1.0061 1.0059  with truncation would yield 1.006 and 1.005  with rounding would yield 1.006 and 1.006

0 Kudos
NeilAyres
MVP Alum

Could you give us a clue as to why you would want to do this?

It sounds like a strange requirement, especially the truncation rather than rounding.

If you have some experience with python, you could read the existing polygon geometries and write out another set of coordinates which have been truncated to the precision you require.

0 Kudos
curtvprice
MVP Esteemed Contributor

With shapefiles, locations are stored in binary floating point. In the geodatabase, coordinates are stored in internal integer coordinates (based on xy domain and resolution) and reported as binary floating point. So even if you wanted to, it would be impossible to save coordinates to exactly 0.01 precision as this cannot be represented exactly in binary coding.

0 Kudos