large-image-source-rasterio 1.29.7.dev26__tar.gz → 1.29.7.dev38__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.dev26 → large-image-source-rasterio-1.29.7.dev38}/PKG-INFO +4 -6
  2. {large-image-source-rasterio-1.29.7.dev26 → large-image-source-rasterio-1.29.7.dev38}/large_image_source_rasterio/__init__.py +28 -31
  3. {large-image-source-rasterio-1.29.7.dev26 → large-image-source-rasterio-1.29.7.dev38}/large_image_source_rasterio.egg-info/PKG-INFO +4 -6
  4. large-image-source-rasterio-1.29.7.dev38/large_image_source_rasterio.egg-info/requires.txt +9 -0
  5. {large-image-source-rasterio-1.29.7.dev26 → large-image-source-rasterio-1.29.7.dev38}/setup.py +1 -4
  6. large-image-source-rasterio-1.29.7.dev26/large_image_source_rasterio.egg-info/requires.txt +0 -14
  7. {large-image-source-rasterio-1.29.7.dev26 → large-image-source-rasterio-1.29.7.dev38}/LICENSE +0 -0
  8. {large-image-source-rasterio-1.29.7.dev26 → large-image-source-rasterio-1.29.7.dev38}/README.rst +0 -0
  9. {large-image-source-rasterio-1.29.7.dev26 → large-image-source-rasterio-1.29.7.dev38}/large_image_source_rasterio/girder_source.py +0 -0
  10. {large-image-source-rasterio-1.29.7.dev26 → large-image-source-rasterio-1.29.7.dev38}/large_image_source_rasterio.egg-info/SOURCES.txt +0 -0
  11. {large-image-source-rasterio-1.29.7.dev26 → large-image-source-rasterio-1.29.7.dev38}/large_image_source_rasterio.egg-info/dependency_links.txt +0 -0
  12. {large-image-source-rasterio-1.29.7.dev26 → large-image-source-rasterio-1.29.7.dev38}/large_image_source_rasterio.egg-info/entry_points.txt +0 -0
  13. {large-image-source-rasterio-1.29.7.dev26 → large-image-source-rasterio-1.29.7.dev38}/large_image_source_rasterio.egg-info/top_level.txt +0 -0
  14. {large-image-source-rasterio-1.29.7.dev26 → large-image-source-rasterio-1.29.7.dev38}/pyproject.toml +0 -0
  15. {large-image-source-rasterio-1.29.7.dev26 → large-image-source-rasterio-1.29.7.dev38}/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.dev26
3
+ Version: 1.29.7.dev38
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,14 +16,12 @@ 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
20
19
  License-File: LICENSE
21
- Requires-Dist: large-image>=1.29.7.dev26
22
- Requires-Dist: rasterio<1.3.11,>=1.3; python_version < "3.9"
23
- Requires-Dist: rasterio>=1.3; python_version >= "3.9"
20
+ Requires-Dist: large-image>=1.29.7.dev38
21
+ Requires-Dist: rasterio>=1.3
24
22
  Requires-Dist: packaging
25
23
  Provides-Extra: girder
26
- Requires-Dist: girder-large-image>=1.29.7.dev26; extra == "girder"
24
+ Requires-Dist: girder-large-image>=1.29.7.dev38; extra == "girder"
27
25
  Provides-Extra: all
28
26
  Requires-Dist: rio-cogeo; extra == "all"
29
27
 
@@ -153,33 +153,29 @@ 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
- 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}.'
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.')
181
165
  raise TileSourceError(msg)
182
166
 
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
+
183
179
  def _getPopulatedLevels(self):
184
180
  try:
185
181
  with self._getDatasetLock:
@@ -417,14 +413,15 @@ class RasterioFileTileSource(GDALBaseFileTileSource, metaclass=LruCacheMetaclass
417
413
  for k in bounds:
418
414
  bounds[k]['y'] = max(min(bounds[k]['y'], yBounds), -yBounds)
419
415
 
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
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()):
424
421
  for k in bounds:
425
- bounds[k]['x'] += dx
422
+ bounds[k]['x'] += 360
426
423
 
427
- # if one of the corner is >= 180 set all the corners to world width
424
+ # if one of the corner is > 180 set all the corner to world width
428
425
  if any(v['x'] >= 180 for v in bounds.values()):
429
426
  bounds['ul']['x'] = bounds['ll']['x'] = -180
430
427
  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.dev26
3
+ Version: 1.29.7.dev38
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,14 +16,12 @@ 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
20
19
  License-File: LICENSE
21
- Requires-Dist: large-image>=1.29.7.dev26
22
- Requires-Dist: rasterio<1.3.11,>=1.3; python_version < "3.9"
23
- Requires-Dist: rasterio>=1.3; python_version >= "3.9"
20
+ Requires-Dist: large-image>=1.29.7.dev38
21
+ Requires-Dist: rasterio>=1.3
24
22
  Requires-Dist: packaging
25
23
  Provides-Extra: girder
26
- Requires-Dist: girder-large-image>=1.29.7.dev26; extra == "girder"
24
+ Requires-Dist: girder-large-image>=1.29.7.dev38; extra == "girder"
27
25
  Provides-Extra: all
28
26
  Requires-Dist: rio-cogeo; extra == "all"
29
27
 
@@ -0,0 +1,9 @@
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
@@ -40,7 +40,6 @@ setup(
40
40
  },
41
41
  description=description,
42
42
  long_description=long_description,
43
- long_description_content_type='text/x-rst',
44
43
  license='Apache Software License 2.0',
45
44
  author='Kitware, Inc.',
46
45
  author_email='kitware@kitware.com',
@@ -56,9 +55,7 @@ setup(
56
55
  ],
57
56
  install_requires=[
58
57
  f'large-image{limit_version}',
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"',
58
+ 'rasterio>=1.3', # to get the statistics attribute (<=> gdalinfo)
62
59
  'packaging',
63
60
  ],
64
61
  extras_require={
@@ -1,14 +0,0 @@
1
- large-image>=1.29.7.dev26
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.7.dev26