add geometry endpoint
This commit is contained in:
parent
8abb9fe044
commit
9a9ea45242
3 changed files with 24 additions and 4 deletions
|
@ -88,12 +88,14 @@ class GeometryMixin(SerializableMixin):
|
|||
|
||||
def details_display(self, detailed_geometry=True, **kwargs):
|
||||
result = super().details_display(**kwargs)
|
||||
if detailed_geometry:
|
||||
result['geometry'] = format_geojson(smart_mapping(self.geometry), round=False)
|
||||
else:
|
||||
result['geometry'] = format_geojson(smart_mapping(box(*self.geometry.bounds)), round=False)
|
||||
result['geometry'] = self.get_geometry(detailed_geometry=detailed_geometry)
|
||||
return result
|
||||
|
||||
def get_geometry(self, detailed_geometry=True):
|
||||
if detailed_geometry:
|
||||
return format_geojson(smart_mapping(self.geometry), round=False)
|
||||
return format_geojson(smart_mapping(box(*self.geometry.bounds)), round=False)
|
||||
|
||||
def get_shadow_geojson(self):
|
||||
pass
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue