Geoinfomatics

Geoinformatics is a multidisciplinary field that combines aspects of geography, information…

Follow publication

Member-only story

Spatial Interpolation

Implement spatial interpolation using Python exclusively, without relying on ArcGIS software.

  • Perform multiple interpolation techniques on a set of data points
  • Extract interpolated values at designated locations without original samples

Interpolation is a technique for estimating values at unsampled locations by utilizing data from known, sampled points within a given area or phenomenon. This chapter will delve into three distinct interpolation approaches:

  1. Thiessen polygons, also known as Voronoi diagrams
  2. K-nearest neighbors (KNN)
  3. Kriging

Load libraries

# Import modules
import geopandas as gpd
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from pykrige.ok import OrdinaryKriging
import rasterio
import rasterio.mask
from rasterio.plot import show
from rasterio.transform import Affine
from scipy.spatial import Voronoi, voronoi_plot_2d
from shapely.geometry import box
from shapely.geometry import Polygon, Point
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.metrics import r2_score
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsRegressor
# Load data
# County boundaries

counties = gpd.read_file("sf_bay_counties/sf_bay_counties.shp")

# Rainfall measurement "locations"
# Modified by author by clipping raster to San Francisco Bay Area, generating random points, and extracting…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Geoinfomatics
Geoinfomatics

Published in Geoinfomatics

Geoinformatics is a multidisciplinary field that combines aspects of geography, information science, computer science, mathematics, and other related fields. It focuses on the acquisition, processing, analysis, management, and visualization of geospatial data.

GeoSense ✅
GeoSense ✅

Written by GeoSense ✅

🌏 Remote sensing | 🛰️ Geographic Information Systems (GIS) | ℹ️ https://www.tnmthai.com/medium

No responses yet

Write a response