Geospatial Data Processing with NumPy
Data processing tools are often limited to the pre-built tools discussed in other chapters, or open-source tools such as Shapely, Rasterio, or GDAL. These tools can be limited in terms of processing speed and flexibility. When creating geospatial data workflows, you will often have to create custom tools to process data quickly, and those other libraries can be limiting.
NumPy offers a third way. Used for scientific computing, it is an incredibly fast and powerful module written in C, with a Python code “wrapper” so it can be used in your existing Python environment. It is built to read, analyze, and write multidimensional arrays of data.
Esri has included easy tools to convert rasters into NumPy arrays and back, which makes it easy to add custom NumPy functions into your existing pipelines. Selecting or clipping areas of a raster, performing array math, creating new arrays and populating them with data, processing specific...