Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

In QGIS (or alternatively any other scripting + GIS stack), 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.


UPDATE: 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 a square buffer around a point feature in ArcMap

share|improve this question
1  
what is the arrangement of points, are they in a square? –  Willy Oct 4 '12 at 3:23
    
This depends strongly which area on the globe we are talking about. The polar and equatorial circumferences are different. And also: are your coordinates in degrees or cartesian? It should be fairly easy to calculate the bounding box with this information. –  LarsVegas Oct 4 '12 at 9:52
    
The arrangement of points would be a square. 1km apart (or 500m apart). We're looking at North America only at this point, Canada specifically. –  NikG Oct 4 '12 at 14:39
add comment

1 Answer

up vote 1 down vote accepted

QGIS ships with OGR which has a method GetEnvelope():

# Returns the geometry's extent as a list (minx, maxx, miny, maxy)
<geom>.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.

share|improve this answer
    
Thanks LarsVegas! Can you script the entire process in QGIS (or outside of QGIS)? –  NikG Oct 5 '12 at 21:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.