4

I would like to select a map's region in QGIS for further processing with python console.enter image description here Ideally I would like to select the region with a mouse drag (like Gimp crop function) and then e.g. analyze the elements inside that area using Python, take a snapshot the selected area and others stuff like these. Is there a prebuilt function in QGIS that allows me to do that? I want to achieve this for many tasks, mainly to export the data, these are three examples:

1 Get the RELATIVE COORDINATES of attributes inside the selected area

What I need for an application is to get coordinates relative to the selected area and not only the "geographical" CRS of the attributes. enter image description here

E.g. if I have the attribute "DILLINGHAM" inside the selection (the image is from Alaksa data set Airports) I need to have the image coordinates of the label and the name field e.g. (X,Y, "label"):

(210,150,"ST "DILLINGHAM") (200,350,"PORT HEIDEN") ...

So I would like to retrieve the position of the attribute relative to a simple reference system (my selection), where the 0 is a corner of my selection

2 Make a better clipper

I would like to use this function even for make a better clipper. Raster->Extraction->Clipper. When I work with may raster files I would like that QGIS allow me to clip only the rasters that are into my selection and not to show me all the list of other rasters that are not inside the selection as actually does.

3 Get a snapshot of the selection

3
  • why not specify an extent as input in a Processing model (modeller) and then crop your input vector layer
    – Curlew
    Commented Dec 28, 2013 at 14:55
  • 1
    @Curlew thanks I've try to improve the answer, with QGIS 1.8 I can't see any interesting feature in print composer maybe. Do you think I can do what I've asked?
    – G M
    Commented Dec 28, 2013 at 18:46
  • Is that an animated gif you are using in your example? Thanks cool! Have never thought of using one before.
    – TsvGis
    Commented Aug 17, 2015 at 1:52

2 Answers 2

1

In fact, Processing will only use the selected features - if there is a selection in the input layer. To verify, please check the Processing options:

enter image description here

3
  • Thanks, I've try to improve the question for one of my specific needs, maybe now is more clear...
    – G M
    Commented Dec 28, 2013 at 18:49
  • @GM Sorry, it's even less clear for me now. Now it is about Print Composer? You show a map item with coordinate grid, yet you write that you want image coordinates ... Try to be very specific about what data you have and what output you need. Leave it to us to provide a possible way to achieve this.
    – underdark
    Commented Dec 28, 2013 at 19:21
  • In fact I need this function to improve many tasks I'm dealing with... at the root there is the need to work with the same specific area with different layers. Thanks a lot for your help!
    – G M
    Commented Dec 28, 2013 at 22:22
0

The closest pre-built function is the "Clip tool" (geoprocessing) . If you use the selection, you will not create new geometries, therefore your entire polygon will be used.

1
  • Thanks, but what I need is to analyze the same region with different layers and not to crop a specific layer, maybe my question wasn't so clear, I've try to improve it...
    – G M
    Commented Dec 28, 2013 at 18:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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