GeoPakTile 2.1.3__tar.gz → 2.1.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GeoPakTile
3
- Version: 2.1.3
3
+ Version: 2.1.4
4
4
  Summary: Create a Geopackage XYZ Tile layer.
5
5
  Keywords: GIS,Geopackage,Tiles,XYZ,gpkg
6
6
  Author: apwebber
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "GeoPakTile"
3
- version = "2.1.3"
3
+ version = "2.1.4"
4
4
  description = "Create a Geopackage XYZ Tile layer."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -99,6 +99,18 @@ class GeoPakTile:
99
99
  self._conn.close()
100
100
  self._conn = None
101
101
 
102
+ def get_tile(self, z: int, x: int, y: int) -> bytes | None:
103
+ """Get a tile's image data using the zxy coordinates, or None if absent."""
104
+
105
+ self._cursor.execute(
106
+ f'SELECT tile_data FROM "{self.table_name}" '
107
+ "WHERE zoom_level=? AND tile_column=? AND tile_row=? LIMIT 1",
108
+ (z, x, y),
109
+ )
110
+
111
+ row = self._cursor.fetchone()
112
+ return None if row is None else row[0]
113
+
102
114
  def has_tile(self, z: int, x: int, y: int):
103
115
  """Check if a tile is present, using the zxy coordinates"""
104
116
 
File without changes
File without changes