Skip to content

Commit

Permalink
Fix TIFF URL
Browse files Browse the repository at this point in the history
Use the correct URL for the location of the TIFF download.
  • Loading branch information
Mike Graves committed Apr 27, 2018
1 parent 990bb26 commit 2565f74
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions slingshot/app.py
Expand Up @@ -80,10 +80,12 @@ def __init__(self, bag, geoserver, workspace, destination, tiff_url):
self.bag = bag
self.geoserver = geoserver
self.workspace = workspace
self.tiff_url = tiff_url
access = 'public' if bag.is_public() else 'secure'
self.server = self.geoserver.url(access)
self.destination = os.path.join(destination, access)
self.tiff_url = '{}/{}/{}'.format(tiff_url.rstrip('/'),
access,
os.path.split(self.bag.tif)[1])

def add(self):
path = self._upload_layer(self.destination)
Expand All @@ -95,8 +97,7 @@ def add(self):
self.geoserver.put(url, data=path,
headers={'Content-type': 'text/plain'})
self.bag.record \
.dct_references_s['http://schema.org/downloadUrl'] = \
self.tiff_url + os.path.split(self.bag.tif)[1]
.dct_references_s['http://schema.org/downloadUrl'] = self.tiff_url
self.bag.save()

def _upload_layer(self, destination):
Expand Down

0 comments on commit 2565f74

Please sign in to comment.