This commit is contained in:
phil 2023-11-19 12:22:10 +05:30
parent 80100fffd0
commit 5494f6085f

View file

@ -910,7 +910,7 @@ class GeoLineModelZ(GeoLineModel):
class GeoPolygonModel(GeoModel):
#__abstract__ = True
__abstract__ = True
shapefile_model: int = POLYGON
geom: Any = Field(sa_column=Column(Geometry('POLYGON', srid=conf.geo.srid)))
mapbox_type: str = 'fill'
@ -971,8 +971,7 @@ class GeoPolygonModel(GeoModel):
async def get_geo_info(self):
info = OrderedDict()
area = self.area
boundam@
self.shapely_geom.bounds
bounds = self.shapely_geom.bounds
info['longitude'] = '{:.6f} - {:.6f}'.format(bounds[0], bounds[2])
info['latitude'] = '{:.6f} - {:.6f}'.format(bounds[1], bounds[3])
info['length (m)'] = '{:.2f}'.format(self.length)
@ -983,7 +982,7 @@ class GeoPolygonModel(GeoModel):
class GeoPolygonModelZ(GeoPolygonModel):
#__abstract__ = True
__abstract__ = True
shapefile_model: int = POLYGONZ
geom: Any = Field(sa_column=Column(Geometry('POLYGONZ', dimension=3, srid=conf.geo.srid)))