[GIS] Visualizing bounding box as polygon

extentspythonqgisqgis-plugins

I try to make plugin in QGIS that compare 2 bounding box data, ex:

(-32.61442167739459, -32.017601026186576, 13.015663782506067, 13.428145228091406)

and

(-38.6102467739459, -38.017601026186576, 33.01563382506067, 33.624945228091406)

and want to picture it in a square or polygon like shape.

Does QGIS have a module in Plugin that can do such a thing?

Best Answer

Yes, it's the QuickWKT plugin (WKT = "Well-Known Text"). The bounding box would be treated as a polygon, and WKT would look like:

'POLYGON(x1 y1, x1 y2, x2 y2, x2 y1, x1 y1)'

Note that any polygon shape is possible, but coordinates following this model will generate a rectangle, which is what you want for a bounding box. You can't get away specifying only two corners, as you have in the question, you have to specify all four corners, and the first and last coordinates have to be the same. That's how WKT indicates that the polygon is closed.

A screenshot with the WKT for your first example:

QuickWKT with Well-Known Text for a rectangle in WGS84.

Related Question