-1

I have a list of coordinates as follows:

zip_box = [(10.0, 20.0, 20.0, 30.0), (28.0, 40.0, 38.0, 50.0), (46.0, 60.0, 56.0, 70.0), (64.0, 80.0, 74.0, 90.0), (82.0, 100.0, 92.0, 110.0)]

They are organized as: (minx, miny, maxx, maxy).

How can I convert each set to a box(minx, miny, maxx, maxy)? When I try a for loop such as:

for i in zip_box:
    b = box (i)

it throws an error:

TypeError: box() takes at least 4 arguments (1 given)

I know why, because, tuple goes into two round brackets and assumed to be only one argument. I want to convert each set into a shapely box and then get them ready for plotting.

stackprotector
  • 10,498
  • 4
  • 35
  • 64
alex
  • 3
  • 2

1 Answers1

0

You can access the elements of a quadruple like this:

for minx, miny, maxx, maxy in zip_box:
    b = box(minx, miny, maxx, maxy)
stackprotector
  • 10,498
  • 4
  • 35
  • 64