Commit c1a59a00 authored by jay's avatar jay
Browse files

Fixes version and north up

parent 7b3a5bb7
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
__version__ = "0.1.2"
from pkg_resources import get_distribution, DistributionNotFound
import os.path

try:
    _dist = get_distribution('plio')
    # Normalize case for Windows systems
    dist_loc = os.path.normcase(_dist.location)
    here = os.path.normcase(__file__)
    if not here.startswith(os.path.join(dist_loc, 'plio')):
        # not installed, but there is another version that *is*
        raise DistributionNotFound
except DistributionNotFound:
    __version__ = 'Please install this project with setup.py'
else:
    __version__ = _dist.version

# Submodule imports
from . import io
+5 −4
Original line number Diff line number Diff line
@@ -227,6 +227,7 @@ class GeoDataset(object):

    @property
    def north_up(self):
        return True
        if self.footprint:
            return geofuncs.is_clockwise(json.loads(self.footprint.ExportToJson())['coordinates'][0][0])
        else:
@@ -496,15 +497,15 @@ class GeoDataset(object):

        if not pixels:
            array = band.ReadAsArray().astype(dtype)
            if self.north_up == False:
                array = np.flipud(array)
            #if self.north_up == False:
            #    array = np.flipud(array)
        else:
            # Check that the read start is not outside of the image
            xstart, ystart, xcount, ycount = pixels
            xmax, ymax = map(int, self.xy_extent[1])
            # If the image is south up, flip the roi
            if self.north_up == False:
                ystart = ymax - (ystart + ycount)
            #if self.north_up == False:
            #    ystart = ymax - (ystart + ycount)
            if xstart < 0:
                xstart = 0

+1 −4
Original line number Diff line number Diff line
@@ -6,9 +6,6 @@ from plio.examples import available
with open('README.rst', 'r') as f:
    long_description = f.read()


VERSION = plio.__version__

def setup_package():
    examples = set()
    for i in available():
@@ -23,7 +20,7 @@ def setup_package():

    setup(
        name = "plio",
        version = VERSION,
        version = '0.1.2',
        author = "Jay Laura",
        author_email = "jlaura@usgs.gov",
        description = ("I/O API to support planetary data formats."),