5

I am looking for a very simple thing. I want to create a polygon based on the current view extent of my project.

In fact I want to

1) open google satellite layers 
2) zoom to my area of interest
3) create a polygon based on the 'view extent'

of course, the GE layer is not important, it should work with any view.

5

Sounds like spatial bookmarks - maybe that's also an option.

But given that you have a current polygon layer in the same CRS as the project, you can do this in the python console to add a new feature with the current extent:

   f = QgsFeature()
   f.setGeometry( QgsGeometry.fromRect( qgis.utils.iface.mapCanvas().extent() ) )
   l = qgis.utils.iface.activeLayer()
   l.startEditing()
   l.addFeature(f)
   l.commitChanges()
  • hi, yes that looks like a good way. yet I never used the python console. I will check out how that works. can you suggest a good read on that? – Jens Jul 2 '12 at 11:29
3

I have found the optimal answer (sorry Jef, I started digging into the python console, and will continue, but this one was quicker).

The QMarxan plugin allows for creating a grid from the view extent.

thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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