Skip to content
Snippets Groups Projects
Commit c1a59a00 authored by jay's avatar jay
Browse files

Fixes version and north up

parent 7b3a5bb7
No related branches found
No related tags found
No related merge requests found
__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 # Submodule imports
from . import io from . import io
......
...@@ -227,6 +227,7 @@ class GeoDataset(object): ...@@ -227,6 +227,7 @@ class GeoDataset(object):
@property @property
def north_up(self): def north_up(self):
return True
if self.footprint: if self.footprint:
return geofuncs.is_clockwise(json.loads(self.footprint.ExportToJson())['coordinates'][0][0]) return geofuncs.is_clockwise(json.loads(self.footprint.ExportToJson())['coordinates'][0][0])
else: else:
...@@ -496,15 +497,15 @@ class GeoDataset(object): ...@@ -496,15 +497,15 @@ class GeoDataset(object):
if not pixels: if not pixels:
array = band.ReadAsArray().astype(dtype) array = band.ReadAsArray().astype(dtype)
if self.north_up == False: #if self.north_up == False:
array = np.flipud(array) # array = np.flipud(array)
else: else:
# Check that the read start is not outside of the image # Check that the read start is not outside of the image
xstart, ystart, xcount, ycount = pixels xstart, ystart, xcount, ycount = pixels
xmax, ymax = map(int, self.xy_extent[1]) xmax, ymax = map(int, self.xy_extent[1])
# If the image is south up, flip the roi # If the image is south up, flip the roi
if self.north_up == False: #if self.north_up == False:
ystart = ymax - (ystart + ycount) # ystart = ymax - (ystart + ycount)
if xstart < 0: if xstart < 0:
xstart = 0 xstart = 0
......
...@@ -6,9 +6,6 @@ from plio.examples import available ...@@ -6,9 +6,6 @@ from plio.examples import available
with open('README.rst', 'r') as f: with open('README.rst', 'r') as f:
long_description = f.read() long_description = f.read()
VERSION = plio.__version__
def setup_package(): def setup_package():
examples = set() examples = set()
for i in available(): for i in available():
...@@ -23,7 +20,7 @@ def setup_package(): ...@@ -23,7 +20,7 @@ def setup_package():
setup( setup(
name = "plio", name = "plio",
version = VERSION, version = '0.1.2',
author = "Jay Laura", author = "Jay Laura",
author_email = "jlaura@usgs.gov", author_email = "jlaura@usgs.gov",
description = ("I/O API to support planetary data formats."), description = ("I/O API to support planetary data formats."),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment