block by ThomasG77 fd07ef0a2d384e024bd06675ca0615cc

VRT Demo. Derived corners from building to get a CSV with xmin, xmax, ymin and ymax. The goal: create a polygon from these 4 coordinates using a VRT

VRT recipe for CSV

Goal

Show how to display from a VRT file, the bounding box using a CSV as an input. A reaction as a dynamic alternative to https://twitter.com/spatialthoughts/status/1442905558521053184

PS: No approach is better. It depends of requirements.

How to test

You can open in QGIS the file demo-sql-csv.vrt as a vector layer to see CSV layer with a polygon geometry created from xmin, xmax, ymin and ymax

You can also do with GDAL command line

ogrinfo -so -al demo-sql-csv.vrt

Comparison is possible with original buildings source building_before_bounding_box.geojson (CSV was created only for demo purpose)

Feel free to inspect the demo-sql-csv.vrt file content

demo-sql-csv.vrt

demo_bounding_box_vrt.csv

demo_bounding_box_vrt.csvt