How to Install GDAL for Any Operating System
| | |

How to Install GDAL for Any Operating System

GDAL, the Geospatial Data Abstraction Library, was designed to interact with raster and vector (geospatial) data. Over time it has evolved to include sophisticated data manipulation and analysis tools. The GDAL source code is C++, which makes it fast to run but difficult to install. Many software and applications use GDAL for handling and analyzing…

Creating New Shapefiles in QGIS
|

Creating New Shapefiles in QGIS

A shapefile is a file format that represents geographic data in vector format. Shapefiles define points, lines, and polygons. The shapefile format was developed by ESRI and is frequently referred to as an ESRI shapefile. Shapefiles are not the only way to represent vector data. Geopackages, GeoJSON, KML, CSV, and database structures also represent vector…

Creating REMs and Detrended DEMs in QGIS
|

Creating REMs and Detrended DEMs in QGIS

Have you ever seen those really awesome visualizations of rivers that are made with elevation data? You know, the ones where you can see the channels meander through the floodplain? Those visualizations are made using relative elevation models (REMS), which are also known as detrended DEMs. Visualizing data for rivers in GIS and map visualizations…

Download and Display Lidar Data for the United States
|

Download and Display Lidar Data for the United States

Lidar data is awesome! It has so many great uses and produces some amazing visualizations. But it’s not without its problems. Mainly, lidar data can be difficult to work with because file sizes are so large. This means that point clouds are usually tiled and if the area you’re interested in overlaps multiple tiles then…

Geocode Addresses for Free (the EASY way)

Geocode Addresses for Free (the EASY way)

Geocoding (i.e. geolocating) is the process of converting street addresses to coordinate pairs that can be easily mapped. Addresses are very useful but are difficult to map without converting them to coordinates first. There are many softwares that will geocode addresses to coordinates for you. Some are free and some are paid. Each software has…

The Easiest Way to Install Python on Windows 11 (also works for Mac and Linux)

The Easiest Way to Install Python on Windows 11 (also works for Mac and Linux)

Having trouble finding an easy way to install Python that always works? You’re in the right place. After years of trying different Python installation methods, I’ve come up with a method that will get you installing packages and running code in no time! The hardest part of learning Python isn’t writing Python code. There are…

Reproject Raster and Vector Layers with QGIS
|

Reproject Raster and Vector Layers with QGIS

With QGIS reprojections can be calculated with the export data tool, the reproject layer tool, and GDAL Warp. Reprojecting layers (i.e., converting them to a different coordinate reference system, or CRS) is often an important step of geospatial analysis to ensure layers are properly registered and perform distance and area calculations. I’ll demonstrate how to use the export, reproject, and warp methods to reproject raster and vector layers.

How to Clip a Raster to a Polygon or an Extent with Python (Extract by Mask)
| |

How to Clip a Raster to a Polygon or an Extent with Python (Extract by Mask)

Clipping, extracting to masks, and subsetting rasters are common GIS operations. Using the gdal package for Python it is very easy to automate these processes. This tutorial will demonstrate how to use the Warp() function from the gdal Python API to clip rasters to a specified extent and to clip rasters to a polygon layer. These operations are also often referred to as mask extraction or extract to mask.

8 Ways to Create (Initialize) Pandas Data Frames
| | |

8 Ways to Create (Initialize) Pandas Data Frames

One of the key tasks for data scientists and computer programmers is to read, write, organize, and manipulate data. Perhaps the most intuitive format in which these data are stored is the tabular format. This format organizes data into tables, which are also commonly referred to as data frames or spreadsheets. Because of data, programs…

How to Install GeoPandas and Check GeoPandas Version
| |

How to Install GeoPandas and Check GeoPandas Version

GeoPandas is a high-level Python package for reading, writing, analyzing, and manipulating vector (points, lines, and polygons) geographic data. As the name ‘GeoPandas’ implies, it brings pandas data frame functionality to geographic data so that you interact with the data much as you would an attribute table in ArcMap or QGIS or a spreadsheet in…

Remote Sensing Analysis with QGIS
| |

Remote Sensing Analysis with QGIS

In geographic information science (GIS), remote sensing is the act of acquiring information about the features of the Earth’s surface from a distance. Remotely sensed data are acquired from many different platforms including, satellites, aircraft, and fixed instruments with many different sensors including, spectral imagery (cameras), lidar, and radar. The most common form of remotely…

Supervised Image Classification with QGIS
| |

Supervised Image Classification with QGIS

Image classification techniques are at the heart of modern remote sensing. Image classification is a method of extracting usable information from images. Without classification, images are just a collection of numbers that represent colors and it’s very difficult to obtain any quantifiable information about a landscape from data like that. With remote sensing techniques, we…

How to Make a Web Map with QGIS using the qgis2web plugin
| |

How to Make a Web Map with QGIS using the qgis2web plugin

GIS software makes it possible to create maps that contain a lot of powerful and important information. However, sharing those maps and information with non-GIS users can be difficult, especially when maps contain multiple layers. Others may not have GIS software or know how to use it, and an image of a map may not…

Unsupervised Image Classification with QGIS
| |

Unsupervised Image Classification with QGIS

Image classification is the process of using numerical methods to automate the identification of objects in images and is a common method to interpret satellite imagery. With vast amounts of satellite imagery being collected every day it is next to impossible to manually classify satellite images for their many purposes. Instead we rely on numerical…

How to Download Landsat and Sentinel Images for Free
| |

How to Download Landsat and Sentinel Images for Free

Satellite images are important data sources for many remote sensing and GIS analyses. Today many different satellites circle the globe and collect various image types. Images from many of these satellite platforms are available free of charge. This tutorial will demonstrate how to download images from the Landsat (Landsat 9) and Sentinel (Sentinel 2) satellites…

GDAL Python Tutorial: Reading and Writing Raster Datasets
| |

GDAL Python Tutorial: Reading and Writing Raster Datasets

The Geospatial Data Abstraction Library (GDAL) is the standard for managing spatial data formats. GDAL has been incorporated into many different enterprise and open source GIS projects. Because GDAL is open source, it can be used by all. Learning to use GDAL with Python can help you automate workflows and implement custom raster processing solutions….

How to Create Contour Lines and Labels with QGIS
|

How to Create Contour Lines and Labels with QGIS

Contour lines are most often used to represent topography on two-dimensional maps and figures. However, they can represent spatially changing values for any variable. Creating, styling, and labeling contour lines can be a little tedious, and it takes a little bit of time to learn exactly which tools to use to do this in QGIS….

Run Python and Start an Interactive Session from the Windows Command Prompt (Terminal)

Run Python and Start an Interactive Session from the Windows Command Prompt (Terminal)

Python is a very versatile and popular cross-platform programming language that is used for many computational tasks. One thing that makes Python so versatile is that scripts can easily be run from both integrated development environments (IDEs) and the command prompt or terminal (check out this tutorial for instructions). Additionally, you can type and run…

Use Python to Download Multiple Files (or URLs) in Parallel
|

Use Python to Download Multiple Files (or URLs) in Parallel

Automating file downloads can save a lot of time. There are several ways for automating file downloads in Python. The easiest way to download files is using a simple Python loop to iterate through a list of URLs to download. This serial approach can work well with a few small files, but if you are…

Jupyter Notebooks in Visual Studio Code

Jupyter Notebooks in Visual Studio Code

Over the past couple of years, Visual Studio Code (VSC) has become my favorite Python IDE and all-around code editor. It works well for almost any programming language, has an intuitive layout, can be customized and extended with extensions, and (most importantly) it’s completely free. One awesome Visual Studio Code feature is that it integrates…

The Correct Way to Generate Random Numbers in Python with NumPy
|

The Correct Way to Generate Random Numbers in Python with NumPy

Random number generation is a common programming task that is required for many different programs and applications. In Python, the most common way to generate random numbers is arguably the NumPy module. NumPy is fast, reliable, easy to install, and relied on by many programs. As of 2022 (numpy version 1.22) the proper way to…

Setup Anaconda (Python) to Work With Visual Studio Code on Windows

Setup Anaconda (Python) to Work With Visual Studio Code on Windows

Visual Studio Code and Anaconda are powerful tools for Python developers. However, if you are trying to use Anaconda and Visual Studio Code together there is a good chance you have run into some problems. As common as these tools are for programming with Python, it can be difficult to figure out how to get…

10 Ways to Initialize a Numpy Array (How to create numpy arrays)
|

10 Ways to Initialize a Numpy Array (How to create numpy arrays)

In Python, matrix-like data structures are most commonly represented with numpy arrays. The numpy Python package has been well-developed for efficient computation of matrices. The first step to using numpy arrays is to initialize, or create, an array. In Python, there are many ways to create a numpy array. In this article, I’ll demonstrate how to create numpy arrays in ten different ways.

5 Easy Ways to Iterate Through a Python List or Tuple

5 Easy Ways to Iterate Through a Python List or Tuple

With Python, there is a multitude of methods to iterate through lists and tuples. Some of these methods can be complicated. If you’re just learning about iteration in Python, you’ll be best served by learning the easier, more common interaction methods that can be applied to almost any situation. Here, I present 5 easy methods to iterate through Python lists and tuples.

Read and Plot NetCDF Data in Python with xarray and rioxarray
| |

Read and Plot NetCDF Data in Python with xarray and rioxarray

Recently, I’ve started using rioxarray to read NetCDF data into xarray format. If you’re not familiar with the xarray python package it’s basically a wrapper (for lack of a better term) around numpy arrays that allows metadata to be included with the arrays (more on this later with an example).

|

How to Use numpy.where() in Python with Examples

npwhere ¶ The where function from numpy is a powerful way to vectorize if/else statements across entire arrays. There are two primary ways to use numpy.where. First, numpy.where can be used to idenefity array indices where a condition is true (or false). Second, it can be used to index and change values where a condition…

How to Add Google Satellite Imagery and Google Maps to QGIS

How to Add Google Satellite Imagery and Google Maps to QGIS

QGIS is a very powerful and customizable software. However, one of its shortcomings is that it only comes with one default basemap, Open Street Map. The great thing is that it is very easy to add other basemap sources to QGIS. Google Maps and Google Satellite are probably the most recognized map layers in the…

How to Install or Update QGIS

QGIS is an amazingly powerful, free GIS software. In my opinion, it’s the best free GIS software there is and even outperforms expensive, enterprise software in some instances (looking at you ESRI). QGIS is available for Windows, Mac, and Linux operating systems. There are two different options for installing QGIS and the installation process can…

How to Create a DEM (or Raster) from a Lidar Point Cloud

How to Create a DEM (or Raster) from a Lidar Point Cloud

Lidar data are 3D point clouds that can describe Earth’s surface in great detail. However, lidar point clouds present some challenges because of how much data they contain. One fundamental challenge with lidar data is how to effectively extract the points that represent the Earth’s surface (not vegetation, building, or other objects) and create a…

Use QGIS 3D View to Create 3D Maps and Visualizations

Use QGIS 3D View to Create 3D Maps and Visualizations

Many types of geographical data represent 3-dimensional features. Displaying these data in compelling visualizations can often be difficult when limited to a 2-dimensional screen or piece of paper. Luckily, QGIS has built-in support for visualizing 3D data so that you can show off your data with some exquisite visualizations. Creating 3D maps and visualizations in…

How to Download Lidar DEMs (Digital Elevation Models) and Point Clouds from the USGS

How to Download Lidar DEMs (Digital Elevation Models) and Point Clouds from the USGS

Lidar point clouds and DEMs are very useful in many applications and these data are becoming more readily available. In the next few years, it is expected that there will be lidar coverage for all of the contiguous United States. Lidar is already available for large portions of the lower 48. Available lidar DEMs and…

How To Run Python Scripts From the Command Line (Terminal)

Creating Python scripts that can be run from the command line makes it much easier to abstract and share your code so that it can be reused and shared with others. Running scripts from the command line can also streamline your development and analysis workflows to make them more concise and make you more productive….

How to Check if NumPy is Installed and Find Your NumPy Version
|

How to Check if NumPy is Installed and Find Your NumPy Version

The numpy Python module is widely used for many different analyses and as a dependency for many other Python packages. In many instances, it is necessary to determine if numpy is installed and which numpy version is installed. This article will show you multiple ways to determine your numpy version and installation status. Check if…