s2d2.mapping_input
Module Contents
Functions
|
This function takes as input the geotiff name and the path of the |
|
This function takes as input the geotiff name and the path of the |
- s2d2.mapping_input.read_geo_info(fname)[source]
This function takes as input the geotiff name and the path of the folder that the images are stored, reads the geographic information of the image
- Parameters:
fname (string) – path and file name of a geotiff image
- Returns:
spatialRef (string) – osr.SpatialReference in well known text
geotransform (tuple, size=(8,1)) – affine transformation coefficients, but also giving the image dimensions
targetprj (osgeo.osr.SpatialReference() object) – coordinate reference system (CRS)
rows (integer, {x ∈ ℕ | x ≥ 0}) – number of rows in the image, that is its height
cols (integer, {x ∈ ℕ | x ≥ 0}) – number of collumns in the image, that is its width
bands (integer, {x ∈ ℕ | x ≥ 1}) – number of bands in the image, that is its depth
See also
read_geo_imagebasic function to import geographic imagery data
- s2d2.mapping_input.read_geo_image(fname, boi=None, no_dat=None)[source]
This function takes as input the geotiff name and the path of the folder that the images are stored, reads the image and returns the data as an array
- Parameters:
fname (string) – geotiff file name and path.
boi (numpy.array, size=(k,1)) – bands of interest, if a multispectral image is read, a selection can be specified
no_dat ({integer,float}) – no data value
- Returns:
data ({numpy.array, numpy.masked.array}, size=(m,n), ndim=2) – data array of the band
spatialRef (string) – osr.SpatialReference in well known text
geotransform (tuple, size=(8,)) – affine transformation coefficients.
targetprj (osgeo.osr.SpatialReference() object) – coordinate reference system (CRS)
See also
read_geo_infobasic function to get meta data of geographic imagery
Examples
>>> import os >>> from s2d2.mapping_input import read_geo_image >>> fpath = os.path.join(os.getcwd(), "data.jp2" ) >>> I, spatialRef, geotransform, targetPrj = read_geo_image(fpath)