diff --git a/README.rst b/README.rst index f77994a66035900e080741f9808ae773d57a4945..b20dfd71fd8f3077ee035b7b8fe138e6f5770549 100644 --- a/README.rst +++ b/README.rst @@ -10,13 +10,14 @@ Planetary Input / Output :target: https://pypi.python.org/pypi/plio .. image:: https://travis-ci.org/USGS-Astrogeology/plio.svg?branch=master - :target: https://travis-ci.org/USGS-Astrogeology/plio + :target: https://travis-ci.org/USGS-Astrogeology/plio -.. image:: https://coveralls.io/repos/github/USGS-Astrogeology/plio/badge.svg?branch=master :target: https://coveralls.io/github/USGS-Astrogeology/plio?branch=master +.. image:: https://coveralls.io/repos/github/USGS-Astrogeology/plio/badge.svg?branch=master + :target: https://coveralls.io/github/USGS-Astrogeology/plio?branch=master .. image:: https://readthedocs.org/projects/plio/badge/?version=latest - :target: http://plio.readthedocs.io/en/latest/?badge=latest - :alt: Documentation Status + :target: http://plio.readthedocs.io/en/latest/?badge=latest + :alt: Documentation Status A planetary file I/O API diff --git a/conda/build.sh b/conda/build.sh deleted file mode 100755 index 4dad93a1c02abe34b4326e6712b9d046abd2f4a8..0000000000000000000000000000000000000000 --- a/conda/build.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -$PYTHON setup.py install diff --git a/conda/meta.yaml b/conda/meta.yaml index 08523fa178075ebb9be9e4e9e21319cab176a844..18fbf121a501256f19dd85b24621c628de4ef3d7 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -2,16 +2,22 @@ package: name: plio version: 0.1.0 -source: - git_url: https://github.com/USGS-Astrogeology/plio.git +source: + path: ../ + +build: + number: 0 + skip: true #[win] + script: python setup.py install --single-version-externally-managed --record=record.txt requirements: - build: - - python + build: + - python + - setuptools - numpy - pvl - protobuf 3.0.0b2 - - gdal >=2 + - gdal - icu - h5py - pandas @@ -19,14 +25,21 @@ requirements: - pyyaml run: - python + - setuptools - numpy - pvl - protobuf 3.0.0b2 - - gdal >=2 + - gdal - icu - h5py - pandas - sqlalchemy - pyyaml +test: + imports: + - plio +about: + home: http://github.com/USGS-Astrogeology/plio + license: Public Domain diff --git a/plio/io/io_gdal.py b/plio/io/io_gdal.py index 555f73ebe17d61838b74e4a5286c4f038b9caeba..372b118f3da56a8324d2f23f13077a4df7955360 100644 --- a/plio/io/io_gdal.py +++ b/plio/io/io_gdal.py @@ -52,7 +52,7 @@ class GeoDataset(object): The bounding box of the image in lat/lon space geotransform : object - Geotransform reference OGR object as an array of size 6 containing the affine + Geotransform reference OGR object as an array of size 6 containing the affine transformation coefficients for transforming from raw sample/line to projected x/y. xproj = geotransform[0] + sample * geotransform[1] + line * geotransform[2] yproj = geotransform[3] + sample * geotransform[4] + line * geotransform[5] @@ -61,7 +61,7 @@ class GeoDataset(object): Geospatial coordinate system OSR object. latlon_extent : list - of two tuples containing the latitide/longitude boundaries. + of two tuples containing the latitide/longitude boundaries. This list is in the form [(lowerlat, lowerlon), (upperlat, upperlon)]. pixel_width : float @@ -87,9 +87,9 @@ class GeoDataset(object): Note: This is the third value geotransform array. xy_extent : list - of two tuples containing the sample/line boundaries. - The first value is the upper left corner of the upper left pixel and - the second value is the lower right corner of the lower right pixel. + of two tuples containing the sample/line boundaries. + The first value is the upper left corner of the upper left pixel and + the second value is the lower right corner of the lower right pixel. This list is in the form [(minx, miny), (maxx, maxy)]. xy_corners : list @@ -101,26 +101,26 @@ class GeoDataset(object): Note: This is the fifth value geotransform array. coordinate_transformation : object - The coordinate transformation from the spatial reference system to + The coordinate transformation from the spatial reference system to the geospatial coordinate system. - + inverse_coordinate_transformation : object - The coordinate transformation from the geospatial + The coordinate transformation from the geospatial coordinate system to the spatial reference system. - + scale : tuple - The name and value of the linear projection units of the spatial reference system. + The name and value of the linear projection units of the spatial reference system. This tuple is of type string/float of the form (unit name, value). To transform a linear distance to meters, multiply by this value. If no units are available ("Meters", 1) will be returned. - + spheroid : tuple - The spheroid found in the metadata using the spatial reference system. + The spheroid found in the metadata using the spatial reference system. This is of the form (semi-major, semi-minor, inverse flattening). raster_size : tuple The dimensions of the raster, i.e. (number of samples, number of lines). - + central_meridian : float The central meridian of the map projection from the metadata. @@ -382,7 +382,7 @@ class GeoDataset(object): ------- lat, lon : tuple (Latitude, Longitude) corresponding to the given (x,y). - + """ try: geotransform = self.geotransform @@ -410,7 +410,7 @@ class GeoDataset(object): ------- x, y : tuple (Sample, line) position corresponding to the given (latitude, longitude). - + """ geotransform = self.geotransform upperlat, upperlon, _ = self.inverse_coordinate_transformation.TransformPoint(lon, lat) @@ -567,7 +567,8 @@ def match_rasters(match_to, match_from, destination, match_from__srs = match_from.dataset.GetProjection() match_from__gt = match_from.geotransform - dst = gdal.GetDriverByName('GTiff').Create(destination, width, height, 1, gdalconst.GDT_Float32) + dst = gdal.GetDriverByName('GTiff').Create(destination, width, height, match_from.RasterCount, + gdalconst.GDT_Float32) dst.SetGeoTransform(match_to_gt) dst.SetProjection(match_to_srs) diff --git a/setup.py b/setup.py index 61e417d15fadcea8592a3691c343ae4f66a3eb05..ca82517062677bfeed26e5018d5a51770cf169a7 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ def setup_package(): else: glob_name = 'examples/' + i + '/*' examples.add(glob_name) - + setup( name = "plio", version = VERSION, @@ -37,13 +37,16 @@ def setup_package(): ['sqlalchemy_json/*.py', 'sqlalchemy_json/LICENSE']}, zip_safe=False, install_requires=[ - 'gdal>=2', + 'gdal', + 'numpy', 'pvl', 'protobuf==3.0.0b2', 'h5py', + 'icu', 'pandas', 'sqlalchemy', - 'pyyaml'], + 'pyyaml', + 'certifi'], classifiers=[ "Development Status :: 3 - Alpha", "Topic :: Utilities",