large-image-source-rasterio 1.29.7.dev38__tar.gz → 1.29.8.dev6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (15) hide show
  1. {large-image-source-rasterio-1.29.7.dev38 → large-image-source-rasterio-1.29.8.dev6}/PKG-INFO +6 -4
  2. {large-image-source-rasterio-1.29.7.dev38 → large-image-source-rasterio-1.29.8.dev6}/large_image_source_rasterio/__init__.py +31 -28
  3. {large-image-source-rasterio-1.29.7.dev38 → large-image-source-rasterio-1.29.8.dev6}/large_image_source_rasterio.egg-info/PKG-INFO +6 -4
  4. large-image-source-rasterio-1.29.8.dev6/large_image_source_rasterio.egg-info/requires.txt +14 -0
  5. {large-image-source-rasterio-1.29.7.dev38 → large-image-source-rasterio-1.29.8.dev6}/setup.py +4 -1
  6. large-image-source-rasterio-1.29.7.dev38/large_image_source_rasterio.egg-info/requires.txt +0 -9
  7. {large-image-source-rasterio-1.29.7.dev38 → large-image-source-rasterio-1.29.8.dev6}/LICENSE +0 -0
  8. {large-image-source-rasterio-1.29.7.dev38 → large-image-source-rasterio-1.29.8.dev6}/README.rst +0 -0
  9. {large-image-source-rasterio-1.29.7.dev38 → large-image-source-rasterio-1.29.8.dev6}/large_image_source_rasterio/girder_source.py +0 -0
  10. {large-image-source-rasterio-1.29.7.dev38 → large-image-source-rasterio-1.29.8.dev6}/large_image_source_rasterio.egg-info/SOURCES.txt +0 -0
  11. {large-image-source-rasterio-1.29.7.dev38 → large-image-source-rasterio-1.29.8.dev6}/large_image_source_rasterio.egg-info/dependency_links.txt +0 -0
  12. {large-image-source-rasterio-1.29.7.dev38 → large-image-source-rasterio-1.29.8.dev6}/large_image_source_rasterio.egg-info/entry_points.txt +0 -0
  13. {large-image-source-rasterio-1.29.7.dev38 → large-image-source-rasterio-1.29.8.dev6}/large_image_source_rasterio.egg-info/top_level.txt +0 -0
  14. {large-image-source-rasterio-1.29.7.dev38 → large-image-source-rasterio-1.29.8.dev6}/pyproject.toml +0 -0
  15. {large-image-source-rasterio-1.29.7.dev38 → large-image-source-rasterio-1.29.8.dev6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: large-image-source-rasterio
3
- Version: 1.29.7.dev38
3
+ Version: 1.29.8.dev6
4
4
  Summary: A rasterio tilesource for large_image.
5
5
  Home-page: https://github.com/girder/large_image
6
6
  Author: Kitware, Inc.
@@ -16,12 +16,14 @@ Classifier: Programming Language :: Python :: 3.10
16
16
  Classifier: Programming Language :: Python :: 3.11
17
17
  Classifier: Programming Language :: Python :: 3.12
18
18
  Requires-Python: >=3.8
19
+ Description-Content-Type: text/x-rst
19
20
  License-File: LICENSE
20
- Requires-Dist: large-image>=1.29.7.dev38
21
- Requires-Dist: rasterio>=1.3
21
+ Requires-Dist: large-image>=1.29.8.dev6
22
+ Requires-Dist: rasterio<1.3.11,>=1.3; python_version < "3.9"
23
+ Requires-Dist: rasterio>=1.3; python_version >= "3.9"
22
24
  Requires-Dist: packaging
23
25
  Provides-Extra: girder
24
- Requires-Dist: girder-large-image>=1.29.7.dev38; extra == "girder"
26
+ Requires-Dist: girder-large-image>=1.29.8.dev6; extra == "girder"
25
27
  Provides-Extra: all
26
28
  Requires-Dist: rio-cogeo; extra == "all"
27
29
 
@@ -153,29 +153,33 @@ class RasterioFileTileSource(GDALBaseFileTileSource, metaclass=LruCacheMetaclass
153
153
  # use the mapnik source if needed. This variable is always ignored
154
154
  # is_netcdf = False
155
155
 
156
- # get the different scales and projections from the image
157
- scale = self.getPixelSizeInMeters()
158
-
159
- # raise an error if we are missing some information about the projection
160
- # i.e. we don't know where to place it on a map
161
- isProjected = self.projection or self.dataset.driver.lower() in {'png'}
162
- if isProjected and not scale:
163
- msg = ('File does not have a projected scale, so will not be '
164
- 'opened via rasterio with a projection.')
156
+ try:
157
+ # get the different scales and projections from the image
158
+ scale = self.getPixelSizeInMeters()
159
+
160
+ # raise an error if we are missing some information about the projection
161
+ # i.e. we don't know where to place it on a map
162
+ isProjected = self.projection or self.dataset.driver.lower() in {'png'}
163
+ if isProjected and not scale:
164
+ msg = ('File does not have a projected scale, so will not be '
165
+ 'opened via rasterio with a projection.')
166
+ raise TileSourceError(msg)
167
+
168
+ # set the levels of the tiles
169
+ logX = math.log(float(self.sizeX) / self.tileWidth)
170
+ logY = math.log(float(self.sizeY) / self.tileHeight)
171
+ computedLevel = math.ceil(max(logX, logY) / math.log(2))
172
+ self.sourceLevels = self.levels = int(max(0, computedLevel) + 1)
173
+
174
+ self._unitsPerPixel = unitsPerPixel
175
+ self.projection is None or self._initWithProjection(unitsPerPixel)
176
+ self._getPopulatedLevels()
177
+ self._getTileLock = threading.Lock()
178
+ self._setDefaultStyle()
179
+ except Exception as exc:
180
+ msg = f'File cannot be opened via rasterio {exc}.'
165
181
  raise TileSourceError(msg)
166
182
 
167
- # set the levels of the tiles
168
- logX = math.log(float(self.sizeX) / self.tileWidth)
169
- logY = math.log(float(self.sizeY) / self.tileHeight)
170
- computedLevel = math.ceil(max(logX, logY) / math.log(2))
171
- self.sourceLevels = self.levels = int(max(0, computedLevel) + 1)
172
-
173
- self._unitsPerPixel = unitsPerPixel
174
- self.projection is None or self._initWithProjection(unitsPerPixel)
175
- self._getPopulatedLevels()
176
- self._getTileLock = threading.Lock()
177
- self._setDefaultStyle()
178
-
179
183
  def _getPopulatedLevels(self):
180
184
  try:
181
185
  with self._getDatasetLock:
@@ -413,15 +417,14 @@ class RasterioFileTileSource(GDALBaseFileTileSource, metaclass=LruCacheMetaclass
413
417
  for k in bounds:
414
418
  bounds[k]['y'] = max(min(bounds[k]['y'], yBounds), -yBounds)
415
419
 
416
- # for each corner rotate longitude until it's within -180, 180
417
- while any(v['x'] > 180 for v in bounds.values()):
418
- for k in bounds:
419
- bounds[k]['x'] -= 180
420
- while any(v['x'] < -180 for v in bounds.values()):
420
+ # rotate longitude so the western-most corner is within [-180, 180)
421
+ dx = min(v['x'] for v in bounds.values())
422
+ if dx < -180 or dx >= 180:
423
+ dx = ((dx + 180) % 360 - 180) - dx
421
424
  for k in bounds:
422
- bounds[k]['x'] += 360
425
+ bounds[k]['x'] += dx
423
426
 
424
- # if one of the corner is > 180 set all the corner to world width
427
+ # if one of the corner is >= 180 set all the corners to world width
425
428
  if any(v['x'] >= 180 for v in bounds.values()):
426
429
  bounds['ul']['x'] = bounds['ll']['x'] = -180
427
430
  bounds['ur']['x'] = bounds['lr']['x'] = 180
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: large-image-source-rasterio
3
- Version: 1.29.7.dev38
3
+ Version: 1.29.8.dev6
4
4
  Summary: A rasterio tilesource for large_image.
5
5
  Home-page: https://github.com/girder/large_image
6
6
  Author: Kitware, Inc.
@@ -16,12 +16,14 @@ Classifier: Programming Language :: Python :: 3.10
16
16
  Classifier: Programming Language :: Python :: 3.11
17
17
  Classifier: Programming Language :: Python :: 3.12
18
18
  Requires-Python: >=3.8
19
+ Description-Content-Type: text/x-rst
19
20
  License-File: LICENSE
20
- Requires-Dist: large-image>=1.29.7.dev38
21
- Requires-Dist: rasterio>=1.3
21
+ Requires-Dist: large-image>=1.29.8.dev6
22
+ Requires-Dist: rasterio<1.3.11,>=1.3; python_version < "3.9"
23
+ Requires-Dist: rasterio>=1.3; python_version >= "3.9"
22
24
  Requires-Dist: packaging
23
25
  Provides-Extra: girder
24
- Requires-Dist: girder-large-image>=1.29.7.dev38; extra == "girder"
26
+ Requires-Dist: girder-large-image>=1.29.8.dev6; extra == "girder"
25
27
  Provides-Extra: all
26
28
  Requires-Dist: rio-cogeo; extra == "all"
27
29
 
@@ -0,0 +1,14 @@
1
+ large-image>=1.29.8.dev6
2
+ packaging
3
+
4
+ [:python_version < "3.9"]
5
+ rasterio<1.3.11,>=1.3
6
+
7
+ [:python_version >= "3.9"]
8
+ rasterio>=1.3
9
+
10
+ [all]
11
+ rio-cogeo
12
+
13
+ [girder]
14
+ girder-large-image>=1.29.8.dev6
@@ -40,6 +40,7 @@ setup(
40
40
  },
41
41
  description=description,
42
42
  long_description=long_description,
43
+ long_description_content_type='text/x-rst',
43
44
  license='Apache Software License 2.0',
44
45
  author='Kitware, Inc.',
45
46
  author_email='kitware@kitware.com',
@@ -55,7 +56,9 @@ setup(
55
56
  ],
56
57
  install_requires=[
57
58
  f'large-image{limit_version}',
58
- 'rasterio>=1.3', # to get the statistics attribute (<=> gdalinfo)
59
+ 'rasterio>=1.3,<1.3.11 ; python_version < "3.9"',
60
+ # We need rasterio > 1.3 to get the statistics attribute (<=> gdalinfo)
61
+ 'rasterio>=1.3 ; python_version >= "3.9"',
59
62
  'packaging',
60
63
  ],
61
64
  extras_require={
@@ -1,9 +0,0 @@
1
- large-image>=1.29.7.dev38
2
- rasterio>=1.3
3
- packaging
4
-
5
- [all]
6
- rio-cogeo
7
-
8
- [girder]
9
- girder-large-image>=1.29.7.dev38