Panning to lat lon

672
3
01-08-2011 12:09 PM
ScottOatley
New Contributor II
Is there a way to center the data/layout view on a set of lat-lon coordinates?

Or is the only way to calculate an extent on the coordinates and then change the extent?

Thanks,
Scott
Tags (2)
0 Kudos
3 Replies
MIchalBularz
New Contributor
there should be a go to Xy tool in the basic toolbar.
If you have trouble saving a specific location between data an layout views you can create bookmarks on the top toolbar to save specific coordinates and viewing scales.
0 Kudos
AndrewChapkowski
Esri Regular Contributor
Scott,

You can use the ArcPy mapping module to zoom to extent or pan to a feature.  Here is an example:
import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
df.zoomToSelectedFeatures()
arcpy.RefreshActiveView()
del mxd

This should zoom to selected features.

Here is a link to more information on zooming to features: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/DataFrame/00s300000003000000/


Enjoy
0 Kudos
ScottOatley
New Contributor II
Hello,

Scott,

You can use the ArcPy mapping module to zoom to extent or pan to a feature. 


So, ultimately, if I want to do the equivalent of say:

import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
df.zoomToXY(lat, long)
arcpy.RefreshActiveView()
del mxd


There is no equivalent of the bold statement in the code above. I have to convert my lat-long coordinates to an extent and use zoomToExtent().

Regards,
Scott
0 Kudos