[Qgis-user] How to define a region of interest mask in QGIS Processing Model

Paolo Cavallini cavallini at faunalia.it
Mon Jun 8 08:12:35 PDT 2015


Il 08/06/2015 15:48, Hanssen, Frank ha scritto:
> Yes Bernd, you got it!
> 
>  
> 
> And hmm, that sounds cumbersome ..

Hi Frank,
if a rectangle is enough for you, you can use the extent as an input,
and the user can draw a rectangle on the map.
If you need a polygon, you have to draw it before running the model.
See the attached supersimple example.
All the best.

-- 
Paolo Cavallini - www.faunalia.eu
QGIS & PostGIS courses: http://www.faunalia.eu/training.html
-------------- next part --------------
{
    "values": {
        "inputs": {
            "RASTERLAYER_RESTER": {
                "values": {
                    "pos": {
                        "values": {
                            "y": 207.0, 
                            "x": 66.0
                        }, 
                        "class": "point"
                    }, 
                    "param": {
                        "values": {
                            "isAdvanced": false, 
                            "name": "RASTERLAYER_RESTER", 
                            "showSublayersDialog": true, 
                            "value": null, 
                            "exported": null, 
                            "hidden": false, 
                            "optional": false, 
                            "description": "rester"
                        }, 
                        "class": "processing.core.parameters.ParameterRaster"
                    }
                }, 
                "class": "processing.modeler.ModelerAlgorithm.ModelerParameter"
            }, 
            "EXTENT_ESTENSIONE": {
                "values": {
                    "pos": {
                        "values": {
                            "y": 100.0, 
                            "x": 172.0
                        }, 
                        "class": "point"
                    }, 
                    "param": {
                        "values": {
                            "isAdvanced": false, 
                            "name": "EXTENT_ESTENSIONE", 
                            "default": "0,1,0,1", 
                            "value": null, 
                            "hidden": false, 
                            "description": "estensione"
                        }, 
                        "class": "processing.core.parameters.ParameterExtent"
                    }
                }, 
                "class": "processing.modeler.ModelerAlgorithm.ModelerParameter"
            }
        }, 
        "helpContent": {}, 
        "group": "test", 
        "name": "test", 
        "algs": {
            "GDALOGRCLIPRASTERBYEXTENT_1": {
                "values": {
                    "name": "GDALOGRCLIPRASTERBYEXTENT_1", 
                    "paramsFolded": true, 
                    "outputs": {
                        "OUTPUT": {
                            "values": {
                                "description": "clip", 
                                "pos": {
                                    "values": {
                                        "y": 359.0, 
                                        "x": 683.0
                                    }, 
                                    "class": "point"
                                }
                            }, 
                            "class": "processing.modeler.ModelerAlgorithm.ModelerOutput"
                        }
                    }, 
                    "outputsFolded": true, 
                    "pos": {
                        "values": {
                            "y": 314.0, 
                            "x": 483.0
                        }, 
                        "class": "point"
                    }, 
                    "dependencies": [], 
                    "params": {
                        "INPUT": {
                            "values": {
                                "name": "RASTERLAYER_RESTER"
                            }, 
                            "class": "processing.modeler.ModelerAlgorithm.ValueFromInput"
                        }, 
                        "EXTRA": null, 
                        "PROJWIN": {
                            "values": {
                                "name": "EXTENT_ESTENSIONE"
                            }, 
                            "class": "processing.modeler.ModelerAlgorithm.ValueFromInput"
                        }, 
                        "NO_DATA": "0"
                    }, 
                    "active": true, 
                    "consoleName": "gdalogr:cliprasterbyextent", 
                    "description": "Clip raster by extent"
                }, 
                "class": "processing.modeler.ModelerAlgorithm.Algorithm"
            }
        }
    }, 
    "class": "processing.modeler.ModelerAlgorithm.ModelerAlgorithm"
}


More information about the Qgis-user mailing list