symbology automation using arcpy
DESCRIPTION
Easy and simple programming for symbology automation in Arc GISTRANSCRIPT
MINIPROJECT ON
SYMBOLOGY AUTOMATION
USING ARCPY
Presented by:
Jyoti Dhakal (07)
Archana K.C (09)
Megha Shrestha (27)
Sushmita Timilsina (32)
Contents
Introduction
Objectives
Method used
Core code
Introduction GIS is a system of collecting, preparing, processing,
analysing, interpreting, evaluating and disseminating
geographical data to information.
“Python is an easy to learn, powerful language with high-
level data structures and a simple but effective approach to
object-oriented programming. Python’s elegant syntax and
dynamic typing make it an ideal language for scripting in
many areas and on most platforms.”
Why python in Arc GIS
Use scripting to develop, execute, and share geo-
processing workflows
Improves productivity
OBJECTIVE
To automate the Symbology process in Arc GIS no
matter what type the input is
Module used
arcpy.mapping()
arcpy.mapping provides ability to automate updating of
map documents components such as layers, layout elements
without the need of opening every single documents.
GUI
Python provides various options for developing graphical
user interfaces (GUIs). We are using Tkinter for our mini
project:
Tkinter: Tkinter is the Python interface to the Tk GUI
toolkit shipped with Python.
Methods used mxd=arcpy.mapping.MapDocument(r"Current")
mxd.save() #saving map document
arcpy.mapping.ListDataFrames(mxd)
arcpy.RefreshActiveView()
arcpy.mapping.ListLayers(mxd, '*', change_view)
Contd…
arcpy.mapping.InsertLayer(change_view, refLayer,
insertLayer, "BEFORE")
arcpy.Describe()
arcpy.ApplySymbologyFromLayer_management()
CORE CODE
if type == "Polygon":
arcpy.ApplySymbologyFromLayer_management(ins_lyr, r"E:\kam
haru\4th year 2nd sem\python\mini_projectdata\Zones.lyr")
elif type == "Polyline":
arcpy.ApplySymbologyFromLayer_management(ins_lyr, r"E:\kam
haru\4th year 2nd sem\python\mini_projectdata\Roads.lyr")
elif type == "Point":
arcpy.ApplySymbologyFromLayer_management(ins_lyr, r"E:\kam
haru\4th year 2nd sem\python\mini_projectdata\Settlements.lyr")
APPLICATION
This program will be highly applicable when we
are doing same process again and again several
time for similar type of data to obtain similar type
of output