0% found this document useful (0 votes)
13 views5 pages

Lab 4 - Dennis

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views5 pages

Lab 4 - Dennis

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

THE COPPERBELT UNIVERSITY

SCHOOL OF MINES AND MINERAL SCIENCES


GEOMATICS DEPARTMENT
PYTHON FUNCTIONS IN ARCGIS/ARCGIS PRO
LAB 4

NAME : DENNIS MWILA CHULU

SIN : 22107409

COURSE CODE : GE 360

COURSE NAME : COMPUTING FOR GEOMATICS

PROGRAMME : BACHELORS OF ENGINEERING IN GEOMATICS ENGINEERING

LECTURER : EB

DUE DATE : 5TH AUGUST, 2024.

1|Page
INTRODUCTION

Integrating Python scripting into the ArcGIS geospatial software platform provides a robust
method for enhancing and automating a variety of geospatial analysis workflows. Renowned for
its flexibility and user-friendliness, Python is extensively used within the ArcGIS environment to
simplify repetitive tasks, develop custom tools, and boost overall efficiency in geospatial data
processing. By utilizing Python functions, users can create modular and reusable code,
facilitating the management and execution of intricate geoprocessing tasks.

WORKFLOW

TASK 1

1. Opened ArcMap, Loaded the Shapefile(myPoints) and Opened the attribute table, then
added the asked fields(myNumber, myNumRes) as shown below;

2|Page
myNumber myNumRes

2. Populated the myNumber field with random values from 15 – 25 by opening the editor
tool in Arcmap which allows you to edit in the cells.

3|Page
3. Then formulated a function(code) to return myNumRes as an alphabet equivalent of the
number stated in the myNumber field as shown below;

4. I added another field(ODD_EVEN), and formulated a function to return whether the


number stated in the myNumber field is even or odd:

def EVEN_odd(value):
result = ""
if value % 2 == 0:
result = "even"
else:
result = "odd"
return result

4|Page
TASK 2

1. I created my own field(GENDER) and formulated a function which is able to return the
whether the gender is male or female depending on the iType field.

def gender(myType):
result = ""
if myType == 1:
result = "Male"
else:
result = "Female"
return result

CONCLUSION

Python scripting significantly enhances ArcGIS capabilities. By automating repetitive tasks and
creating reusable code, it improves efficiency and problem-solving in geospatial analysis. This
project demonstrates Python's value in handling complex geospatial data, making it an essential
skill for geospatial professionals.

5|Page

You might also like