In QGIS, how can I automate drawing a 100km x 100km square around a number of points, with the point being dead in the center?
I'd need to loop through all the points and create a polygon, but not sure what would be the automated way of doing so.
I was able to create buffers (circular) around the points, but now looking for a solution to convert those circles to squares -- something like the Envelope approach described here (but need it in QGIS): Creating square buffer around point feature using ArcGIS for Desktop?
Answer
QGIS ships with OGR which has a method GetEnvelope()
:
# Returns the geometry's extent as a list (minx, maxx, miny, maxy)
.GetEnvelope()
You can easily use it from within your QGIS python console. If you want to convert those coordinates into a shape? Have a look at my answer to this question for some info on modules which will help you turning this list into a vector file. There you find also further details and some helpful links.
No comments:
Post a Comment