def s_get_click_interaction(self, mi) -> schema.click: return schema.click( whereClicked=self.get_geo_coord_with_time( *wkb_to_xy(mi.where_clicked_geom), mi.where_clicked_time_stamp), BBox=self.get_bbox(mi.new_bbox_geom, mi.new_bbox_time_stamp_lr, mi.new_bbox_time_stamp_ul), )
def _get_bbox(self, geom_elem, time_lr, time_ul) -> dict: xmin, ymin, xmax, ymax = wkb_to_xy(geom_elem) return { 'LowerRightCorner': self._get_geo_coord_with_time(xmax, ymin, time_lr), 'UpperLeftCorner': self._get_geo_coord_with_time(xmin, ymax, time_ul) }
def _get_click_interaction(self, entity: MapInteraction) -> dict: return { 'WhereClicked': self._get_geo_coord_with_time( *wkb_to_xy(entity.where_clicked_geom), entity.where_clicked_time_stamp), 'BBox': self._get_bbox(entity.new_bbox_geom, entity.new_bbox_time_stamp_lr, entity.new_bbox_time_stamp_ul), }
def get_bbox(self, geom_elem, time_lr, time_ul) -> schema.bbox: xmin, ymin, xmax, ymax = wkb_to_xy(geom_elem) return schema.bbox( lowerRightCorner=self.get_geo_coord_with_time(xmax, ymin, time_lr), upperLeftCorner=self.get_geo_coord_with_time(xmin, ymax, time_ul), )
def get_geo_coord_with_time_from_obj(self, db_elem): x, y = wkb_to_xy(db_elem.geom) return self.get_geo_coord_with_time(x, y, db_elem.time_stamp)
def _get_geo_coord_with_time_from_obj(self, obj): x, y = wkb_to_xy(obj.geom) return self._get_geo_coord_with_time(x, y, obj.time_stamp)