Did I find the right examples for you? yes no

All Samples(8)  |  Call(8)  |  Derive(0)  |  Import(0)
return bounding box of a polygon in (x,y,width,height) form

        def polygon_bounds(points):
	'''return bounding box of a polygon in (x,y,width,height) form'''
        (minx, miny) = (points[0][0], points[0][1])
        (maxx, maxy) = (minx, miny)
        for p in points:
            minx = min(minx, p[0])
            maxx = max(maxx, p[0])
            miny = min(miny, p[1])
            maxy = max(maxy, p[1])
	return (minx, miny, maxx-minx, maxy-miny)
        


src/m/a/MAVProxy-1.3.3/MAVProxy/modules/mavproxy_map/mp_tile.py   MAVProxy(Download)
	if opts.boundary:
		boundary = mp_util.polygon_load(opts.boundary)
		bounds = mp_util.polygon_bounds(boundary)
		lat = bounds[0]+bounds[2]
		lon = bounds[1]

src/m/a/MAVProxy-HEAD/MAVProxy/modules/mavproxy_map/mp_tile.py   MAVProxy(Download)
	if opts.boundary:
		boundary = mp_util.polygon_load(opts.boundary)
		bounds = mp_util.polygon_bounds(boundary)
		lat = bounds[0]+bounds[2]
		lon = bounds[1]

src/m/a/MAVProxy-1.3.3/MAVProxy/tools/mavflightview.py   MAVProxy(Download)
        print("No points to plot")
        return
    bounds = mp_util.polygon_bounds(path[0])
    (lat, lon) = (bounds[0]+bounds[2], bounds[1])
    (lat, lon) = mp_util.gps_newpos(lat, lon, -45, 50)

src/m/a/MAVProxy-HEAD/MAVProxy/tools/mavflightview.py   MAVProxy(Download)
        print("No points to plot")
        return
    bounds = mp_util.polygon_bounds(path[0])
    (lat, lon) = (bounds[0]+bounds[2], bounds[1])
    (lat, lon) = mp_util.gps_newpos(lat, lon, -45, 50)

src/m/a/MAVProxy-1.3.3/MAVProxy/modules/mavproxy_map/mp_slipmap.py   MAVProxy(Download)
        self.colour = colour
        self.linewidth = linewidth
        self._bounds = mp_util.polygon_bounds(self.points)
 
    def bounds(self):

src/m/a/MAVProxy-HEAD/MAVProxy/modules/mavproxy_map/mp_slipmap.py   MAVProxy(Download)
        self.colour = colour
        self.linewidth = linewidth
        self._bounds = mp_util.polygon_bounds(self.points)
        self._pix_points = []
        self._selected_vertex = None

src/m/a/MAVProxy-1.3.3/MAVProxy/modules/mavproxy_fence.py   MAVProxy(Download)
        self.fenceloader.target_system = self.target_system
        self.fenceloader.target_component = self.target_component
        bounds = mp_util.polygon_bounds(points)
        (lat, lon, width, height) = bounds
        center = (lat+width/2, lon+height/2)

src/m/a/MAVProxy-HEAD/MAVProxy/modules/mavproxy_fence.py   MAVProxy(Download)
        self.fenceloader.target_system = self.target_system
        self.fenceloader.target_component = self.target_component
        bounds = mp_util.polygon_bounds(points)
        (lat, lon, width, height) = bounds
        center = (lat+width/2, lon+height/2)