Feature class extent: arcpy.Describe is different than properties

444
2
Jump to solution
12-02-2021 02:56 PM
Labels (2)
JoeBorgione
MVP Esteemed Contributor

I created a new empty feature class and then appended features into it from another feature.  When I zoomed to that new feature class, it zoomed way out as if the extent was whacked; and it was.  So I used the recalculate feature class extent tool and it was still whacky.  Then I recalculated the the spatial index and it zooms correctly.

However, when I look at the feature class properties I see these Max/Mins:

JoeBorgione_0-1638485573188.png

But when I use arcpy.Describe I get slightly different values:

fc = r'N:\GIS\AddressDataManagement\FixSLCoMistakes\FixSLCoMistakes.gdb\SubdivsionsMagna'
desc = arcpy.Describe(fc)
xmin = desc.extent.XMin
xmax = desc.extent.XMax
ymin = desc.extent.YMin
ymax = desc.extent.YMax

print(f'Xmin = {xmin}  Xmax = {xmax}  Ymin = {ymin}  Ymax = {ymin}')
Xmin = 1471194.3071583062  Xmax = 1484253.9831386397  Ymin = 7418358.292630732  Ymax = 7418358.292630732

Two questions:

1. Why did I need to recalc the spatial index to get my extents to behave?

2. Why do I see different values between the properties pane and  arcpy.Describe?

 

That should just about do it....
0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

coordinates were in meters, hence the feet-meters difference

you have to recalculate the spatial index because the empty featureclass probably didn't have and extent or it had one in a different coordinate system.

First issue can be fixed by working only in meters 😉 or wait 16 days


... sort of retired...

View solution in original post

2 Replies
DanPatterson
MVP Esteemed Contributor

coordinates were in meters, hence the feet-meters difference

you have to recalculate the spatial index because the empty featureclass probably didn't have and extent or it had one in a different coordinate system.

First issue can be fixed by working only in meters 😉 or wait 16 days


... sort of retired...
JoeBorgione
MVP Esteemed Contributor

I'm going with the 16 days.  I have my own version of an Advent Calendar on my desk.

That should just about do it....