GP.Describe Extent property - wrong extent?

2609
2
05-26-2010 09:31 AM
MichaelRich
New Contributor III
Does anyone know why after fetching a describe object on a feature class and returning the Extent property, it returns the extent of the feature class in the current data frame coordinate system, not the extent of the data in its native coordinate system.

With data frame set to Web Mercator Aux Sphere
desc = gp.Describe(input)
extent = desc.Extent
gp.AddMessage(extent)


returns
-13375837.6548833 5207681.31544134 -13372787.8830635 5209463.98928341

With data frame set to NAD 83 Albers it returns
587035.227167865 916043.393770546 589292.681698993 917353.957017839

Any thoughts?

Also, a workaround would be to check the data frame projection against the input in the ToolValidator code, any ideas if there's a way to grab data frame projection from the geoprocessor?  I don't see any....

Thanks, Mike
2 Replies
AlPiszcz
New Contributor
Does anyone know why after fetching a describe object on a feature class and returning the Extent property, it returns the extent of the feature class in the current data frame coordinate system, not the extent of the data in its native coordinate system.

With data frame set to Web Mercator Aux Sphere
desc = gp.Describe(input)
extent = desc.Extent
gp.AddMessage(extent)


returns
-13375837.6548833 5207681.31544134 -13372787.8830635 5209463.98928341

With data frame set to NAD 83 Albers it returns
587035.227167865 916043.393770546 589292.681698993 917353.957017839

Any thoughts?

Also, a workaround would be to check the data frame projection against the input in the ToolValidator code, any ideas if there's a way to grab data frame projection from the geoprocessor?  I don't see any....

Thanks, Mike


== I am interested in getting the extent output in degrees decimal format for any input format, is that possible?
0 Kudos
BGSWasser
New Contributor II

I have just stumbled across the same thing (using ArcGIS 9.3.1). How can I get the extent of a feature class in its native coordinate system?

EDIT: just found a workaround:

gp.Describe(gp.Describe(layer).CatalogPath).Extent

This returns the extent of the layer in its native coordinate system by referencing the layer's source file on disk.

But perhaps there is a better way to do this?

0 Kudos