GeoTIFF: Prepare model/view integration.

This commit is contained in:
parouby committed 2025-11-10 17:10:01 +01:00
1 parent 1ed5d69bf4
commit f27b2cc586
2 files changed
+55 -6

No files matched your search

+44
View File
@@ -80,6 +80,14 @@ class GeoTIFF(SQLSubModel):
value = self.file_name
elif key == "coordinates":
value = self.coordinates
elif key == "coordinates_bottom":
value = self.coordinates["bottom"]
elif key == "coordinates_top":
value = self.coordinates["top"]
elif key == "coordinates_left":
value = self.coordinates["left"]
elif key == "coordinates_right":
value = self.coordinates["right"]
elif key == "memfile":
value = self.memfile
@@ -96,6 +104,14 @@ class GeoTIFF(SQLSubModel):
self.file_name = value
elif key == "coordinates":
self.coordinates = value
elif key == "coordinates_bottom":
self.coordinates["bottom"] = value
elif key == "coordinates_top":
self.coordinates["top"] = value
elif key == "coordinates_left":
self.coordinates["left"] = value
elif key == "coordinates_right":
self.coordinates["right"] = value
self.modified()
@@ -147,6 +163,34 @@ class GeoTIFF(SQLSubModel):
self._coordinates = coordinates
self.modified()
@property
def coord_bottom(self):
if self._coordinates is None:
return 0.0
return self._coordinates["bottom"]
@property
def coord_top(self):
if self._coordinates is None:
return 0.0
return self._coordinates["top"]
@property
def coord_left(self):
if self._coordinates is None:
return 0.0
return self._coordinates["left"]
@property
def coord_right(self):
if self._coordinates is None:
return 0.0
return self._coordinates["right"]
@property
def memfile(self):
if not _rasterio_loaded: