Skip to main content

A noGDAL tool for reading and writing geotiff files

Project description

geotiff

A noGDAL tool for reading geotiff files

WARNING this package is under development and some features are unstable. Use with caution.

Please support this project be giving it a star on GitHub!

What is noGDAL?

noGDAL is a philosophy for developing geospatial programs in python without using GDAL.

Instillation

Installing this package is as easy as:

pip install geotiff

Usage

Read the GeoTiff to an array

from geotiff import GeoTiff

geoTiff = GeoTiff(tiff_file)
array = geoTiff.read()

This will detect the crs code. If it's 'user defined' and you know what it should be, you may supply a crs code:

geoTiff = GeoTiff(tiff_file, crs_code=4236)

Get bounding box info about the tiff

# in the original CRS
geotiff.tif_bBox
# as WGS 84
geotiff.tif_bBox_wgs_84

Get coordinates of a point/pixel

i=5
j=6
geoTiff.get_wgs_84_coords(i, j)

Get the original crs code

geotiff.crs_code

Read a sections of a large tiff using a WGS 84 area

from geotiff import GeoTiff

# in WGS 84
area_box = [(138.632071411, -32.447310785), (138.644218874, -32.456979174)]
geotiff = GeoTiff(tiff_file)
array = geotiff.read_box(area_box)

Getting bounding box information

You can either get the points/pixels that are within a given area_box:

# col and row indexes of the cut area
int_box = geoTiff.get_int_box(area_box)
# lon and lat coords of the cut points/pixels
geoTiff.get_bBox_wgs_84(area_box)

You can also get extra n layers of points/pixels that directly surround the area_box

# col and row indexes of the cut area
int_box = geoTiff.get_int_box(area_box, outer_points = 1)
# lon and lat coords of the cut points/pixels
geoTiff.get_bBox_wgs_84(area_box, outer_points = 1)

This may be useful of you want to interpolate to points near the area_box boundary.

Get coordinates of a point/pixel

i=int_box[0][0] + 5
j=int_box[0][1] + 6
geoTiff.get_wgs_84_coords(i, j)

Contributing

If you would like to contribute to this project, please fork it and make a PR with you patches.

You can join the conversation by saying hi in the project discussion board.

To help users and and other contributes, be sure to:

  • make doc blocs if appropriate
  • use typing wherever possible.

Note: The continuous integration has lint checking with mypy, so be sure to check it yourself before making a PR.

Project Road Map

Core Features

  • read tiff files (including BigTiff)
  • write tiff files (including BigTiff)
  • (UNSTABLE/LIMITED) convert between coordinate systems
  • read a user defined CRS
  • cut a section (bounding box) of the tiff file
  • convert the data to numpy arrays

Additional features

  • (50%) Full test coverage
  • Typing with lint checking using mypy
  • Documentation: doc blocs
  • Documentation: readthedocs

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

geotiff-0.1.8.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

geotiff-0.1.8-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file geotiff-0.1.8.tar.gz.

File metadata

  • Download URL: geotiff-0.1.8.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for geotiff-0.1.8.tar.gz
Algorithm Hash digest
SHA256 3d74669c08a54c231f2f8b927d21dd116ab2646a741842d2a66472492fc563ba
MD5 97879cdcf3d5f3c4e77f88baf12884b6
BLAKE2b-256 584122a0f83da92b88c016a48f73889965c73d054a070307033301fc9b6e42df

See more details on using hashes here.

File details

Details for the file geotiff-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: geotiff-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for geotiff-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 16366ab08f03abaa23a01e427ada88a983ef462806b9f1df4c2de2947ec9effc
MD5 96b1c915022d108bb9d75e71cdd09950
BLAKE2b-256 edc7397f83760b986988e2541084e7821a079f8714f135403059742ff0af0c52

See more details on using hashes here.

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