Python for GIS
Prepared By: Asst. Prof Ahmad Shekib IQBAL
Department: GIS & Remote Sensing
Faculty: Engineering Geomatics
Year: 2025
Introducing Python
• Python is a popular programming language. It was created by
Guido van Rossum, and released in 1991
• It is used for:
1. Web developing (server-side),
2. Software development
3. Mathematics
4. System scripting
What can Python do?
• Python can be used on a server to create web applications.
• Python can be used alongside software to create workflows.
• Python can connect to database systems. It can also read and modify files.
• Python can be used to handle big data and perform complex mathematics.
• Python can be used for rapid prototyping, or for production-ready
software development.
Why Python?
• Python is a free open-source programming language used in numerous fields
• Python is both powerful and easy to learn
• Python works on different platforms (Windows, Mac, Linux, etc.)
• Python has a simple syntax similar to the English language
• Python has syntax that allows developers to write programs with fewer lines than
some other programming languages
• Python runs on as interpreter system, meaning that code can be executed as soon
as it is written. This means that prototyping can be very quick.
• Python can be treated in a procedural way, an object-oriented way or a functional
way.
Career in Python
• Python is not only one of the most popular programming languages across
the globe, but it is one that offers the most promising career opportunities
as well. This demand for python developers is increasing every year. There
is a reason why this high-level programming language is so popular.
• It ensures better and more concise codes with faster readability, something
that no other programming language can offer. Even a shorter code written
in python can deliver better designs. Python is also one of the best tools
for creating dynamic scripts on large as well as small scales.
Career in Python
Python Syntax Compared to other
Programming Languages
• Python was designed for readability, and has some similarities to the
English language with influence from mathematics.
• Python uses new lines to complete a command, as opposed to other
programming languages which often use semicolons of parentheses.
• Python relies on indentation, using whitespace, to define scope; such as the
scope of loops, functions, and classes. Other programming languages often
use curly-brackets for this purpose.
What makes a Python Scripts?
• When you runs a python script, what is actually running?
A Python Script is a sequence of instructions. The structure and
arrangement of the instructions are referred to as Syntax. Python uses
a variety of language elements to create these instructions, including
Data Types, Statements, and Functions.
What makes a Python Scripts?
Basically, programming or Scripting can be explained as set of ordered
instructions for the computer to do something(s). If you think of a python
script as a Building Construction, the Data Types are the Construction
Materials (like Bricks, Cement, Rocks, etc.), and the Statements and Functions
are the Construction Design. You need construction materials and
construction design for a building constructing, just as you need Data Types
and Statements/Functions for a Script.
Building Construction Script
Materials Construction Materials Data Types
Instruction Construction Design Statements/ Function
Why learn Python for ArcGIS
Perhaps you perform the same GIS workflows
every day, month, or year. Maybe they take you a
long time, or you have to shuffle through your
notes to remember how to do certain things.
With python, you can write scripts that will save
you from these headaches by automating your
workflows.
Python for GIS Professionals
• For a GIS professional, you can also use Python for desktop, web, and mobile development.
• The following are some examples of python packages and frameworks:
1. arcpy for ArcGIS
2. pyqgis for QGIS
3. geoDjango is a web framework
4. shapely library
5. pyshp library
6. pySAL library