Given a point layer in QGIS 3.03, I am attempting to create a second layer of square polygons with a specified length of x kilometers whose centers are the points in the first layer. What would be the best way of accomplishing this?
In QGIS 3 (I’m using 3.2.0 Bonn) you can simply use the default QGIS buffer algorithm, select your points, chose the buffer distance and select End cap style = square.
See https://docs.qgis.org/testing/en/docs/user_manual/processing_algs/qgis/vectorgeometry.html#buffer for more information.
v.buffer algorithm from GRASS GIS offers the same option and can also be used in older versions of QGIS. See https://grass.osgeo.org/grass75/manuals/v.buffer.html for more Information.
SELECT <id_or_attribute_1> AS <name>, ..., ST_Expand(geometry, <X / 2 * 1000>) AS geometry FROM <your_layer>;
This will expand the BBOX in each direction by the given value in units of the data's CRS.
Note: this, as many other solutions, only makes sense if the data is in a metric map projection; best find an equal area projection for your region of interest and reproject either on the fly with
ST_Transform or in advance.