Skip to main content

Perform interpolation on surfaces to generate topographic-style maps.

Project description

topography :earth_americas:

Python 3.8 Build Status Language grade: Python Total alerts

Contains different approaches to modeling terrain and topographic-style maps in python

image

Requirements

  • numpy
  • matplotlib

see the requirements.txt

Features

Inverse Distance Weighting (IDW)

A given point P(x, y) is determined by the values of its neighbors, inversely to the distance of each neighbor.

P is more heavily influenced by nearer points via a weighting function w(x, y).

Steps

The value of P(x, y) is determined only by the closest raw data point.

This approach works best to get a "feel" for larger datasets. With few input points, the resulting map has little detail.

In the case of multiple equidistant points being closest, point values are stored, and averaged.

Nearest Neighbor (NN) [in progress :construction_worker: :hammer_and_wrench:]

Install

pip install topography

Example

from topography.Map import Map
from topography.utils.io import getPointValuesFromCsv

# take in csv/xlsx
rawData = getPointValuesFromCsv("tests/data/20x20.csv")

# make map from rawData
M = Map(rawData)

# Display the inputted raw data values
M.showRawPointValues()

# interpolate using inverse distance weighting
M.idw(showWhenDone=True)

# Display the interpolated data values
M.showFilledPointValues()

# Save the data to a .csv file
M.writeLastToCsv("idw_20x20", writeAsMatrix=True)

Development with twine

python setup.py sdist bdist_wheel
twine upload -r pypi dist/* -u <username> -p <password>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

topography-1.0.0.tar.gz (10.8 kB view hashes)

Uploaded Source

Built Distribution

topography-1.0.0-py3-none-any.whl (12.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page