Scripting and programming languages leverage most of the problem-solving in science; spatial science is not an exception to this. As a high-level programming language, python brings a lot of flexibility and features to deploy in GIS. Its usage as a scripting language enables automation of certain functionalities within another program (e.g. arcpy for ArcGIS). Therefore, it is not a surprise that it is the most widely used language in spatial science. It is easy to use due to its simple syntax, and power as an object-oriented language. You don’t need to have the specialist knowledge of programming since it hides much of the technical details that system programming languages need to handle. The most outstanding application possibilities of python in spatial science can be discussed under spatial data handling, spatial data analysis, and spatial data visualization.
Spatial Data Handling
Without any question, data is the core of any GIS project. Thanks to the new developments in the technology and computational science, data acquisition and data quality are increasing intensely which brings the necessity to manage data most efficiently. Especially in spatial science, when we are dealing with complex models and higher dimensions, the need for a computationally boost up becomes compulsory. Therefore, parallel computing solutions by using python libraries, such as PyOpenCL, ParallelPython(PP), and Multiprocessing are getting attention. As an extensive advanced spatial analysis and geospatial file handling example, Rey and his co-workers , introduced parallelization across the spatial analysis with Python Spatial Analysis Library (PySAL) which can be reached from http://code.google.com/p/pysal. .
Popular python data analysis library Pandas has been extended to Geopandas in order to allow users to do spatial operations. It makes it possible to add a base map for your existing plot by only writing less than 20 lines of code and executes the whole process with a total running time of less than a minute. Examples and documentation of this open-source project can be found in http://geopandas.org/gallery/index.html.
Spatial Data Analysis
Esri’s python library arcpy enables users to both handle and analyze spatial data by calling some built-in tools which ArcGIS users are familiar with. For someone who would like to start with arcpy, Python Scripting for ArcGIS (Amazon affiliate link) is a fundamental book to begin with. The book is designed to introduce python scripting for people who have no experience of writing codes .
In order to write and compile your stand-alone spatial analysis python scripts, the first thing is to install a user-friendly IDLE (integrated development environment) so that you can debug and test your codes. For the ArcGIS user, there is no additional cost to install python or any editor since the software already comes with this option. However, if you are seeking other options, such as open source alternatives, a useful software bundle Anaconda  helps as an IDLE for Linux, Windows and Mac OS X users to download scientific packages, manage libraries and dependencies in Conda environment. Examples of this type of standalone spatial applications are getting popularity environmental modeling in especially in uncertainty and sensitivity analysis for land suitability evaluation, urban growth and land-use change, and flood vulnerability .
Especially when working with raster data, numpy library, which is the fundamental package for any scientific computing with python, brings an ability to handle powerful multi-dimensional arrays. Extensive online support and tutorials can be found at https://www.numpy.og. PCRasterPython library, which is developed by Karssenberg and his co-authors , is another useful Python library for matrix algebra and for modelling in 3D.
Spatial Data Visualization
After handling and analyzing the spatial data, the representation of the final output is the last but far the least part of a project. The effort becomes to produce maps that are effective to reach target audiences. Cartopy and Descartes have extensive cartography tools for making pretty maps. With its complete 2D and limited 3D support, matplotlib is a useful library to produce any publication quality figures. It is also possible to use cartopy along with matplotlib if you are interested to add any graph on your existing map .
Overall, whether you are a native python speaker or a beginner, python is a powerful language to communicate with a computer to solve the spatial communication of GIS users.