Skip to content

Instantly share code, notes, and snippets.

@vicmortelmans
Last active May 2, 2018 22:51
Show Gist options
  • Save vicmortelmans/06cd7264ca44fe28dc26508a4466dbf7 to your computer and use it in GitHub Desktop.
Save vicmortelmans/06cd7264ca44fe28dc26508a4466dbf7 to your computer and use it in GitHub Desktop.
QGIS model to generate parish borders based on list of addresses
{
"values": {
"inputs": {
"parishes": {
"values": {
"pos": {
"values": {
"y": 369.0,
"x": 351.0
},
"class": "point"
},
"param": {
"values": {
"isAdvanced": false,
"name": "parishes",
"default": null,
"value": null,
"exported": null,
"hidden": false,
"optional": false,
"description": "Parishes"
},
"class": "processing.core.parameters.ParameterTable"
}
},
"class": "processing.modeler.ModelerAlgorithm.ModelerParameter"
},
"crab": {
"values": {
"pos": {
"values": {
"y": 367.0,
"x": 127.0
},
"class": "point"
},
"param": {
"values": {
"isAdvanced": false,
"name": "crab",
"shapetype": [
0
],
"default": null,
"value": null,
"exported": null,
"hidden": false,
"optional": false,
"description": "CRAB"
},
"class": "processing.core.parameters.ParameterVector"
}
},
"class": "processing.modeler.ModelerAlgorithm.ModelerParameter"
}
},
"helpContent": {
"ALG_DESC": "Based on a vector layer with address points and a table with address ranges and attributes for parish and organisatie_id, create a vector layer with polygons that describe the parish borders.",
"parishes": "Table containing address ranges mapped to parishes. Check the script \"assign parishes\" for proper field names.",
"OUTPUT_ALGQGISDELETEHOLES_1": "Set of polygons describing the borders of the parishes.",
"ALG_CREATOR": "Vic Mortelmans",
"ALG_VERSION": "1.0",
"ALG_HELP_CREATOR": "Vic Mortelmans",
"crab": "Subset of the CRAB adressenlijst, saved with UTF-8 endcoding and WGS 84 crs. \n"
},
"group": "Kerknet",
"name": "Parish boundaries",
"algs": {
"GRASS7V.VORONOI_1": {
"values": {
"name": "GRASS7V.VORONOI_1",
"paramsFolded": true,
"outputs": {},
"outputsFolded": true,
"pos": {
"values": {
"y": 51.844937500000015,
"x": 371.40729375
},
"class": "point"
},
"dependencies": [],
"params": {
"GRASS_SNAP_TOLERANCE_PARAMETER": -1.0,
"GRASS_MIN_AREA_PARAMETER": 0.0001,
"-l": false,
"GRASS_OUTPUT_TYPE_PARAMETER": 0,
"-t": false,
"input": {
"values": {
"alg": "SCRIPTASSIGNPARISHES_1",
"output": "crab_with_parishes"
},
"class": "processing.modeler.ModelerAlgorithm.ValueFromOutput"
},
"GRASS_REGION_PARAMETER": null
},
"active": true,
"consoleName": "grass7:v.voronoi",
"description": "v.voronoi - Creates a Voronoi diagram from an input vector layer containing points."
},
"class": "processing.modeler.ModelerAlgorithm.Algorithm"
},
"QGISDELETEHOLES_1": {
"values": {
"name": "QGISDELETEHOLES_1",
"paramsFolded": true,
"outputs": {
"OUTPUT": {
"values": {
"description": "parish_boundaries",
"pos": {
"values": {
"y": 547.34656875,
"x": 843.7837687500005
},
"class": "point"
}
},
"class": "processing.modeler.ModelerAlgorithm.ModelerOutput"
}
},
"outputsFolded": true,
"pos": {
"values": {
"y": 466.52504375,
"x": 843.1160687500005
},
"class": "point"
},
"dependencies": [],
"params": {
"INPUT": {
"values": {
"alg": "QGISSAVESELECTEDFEATURES_1",
"output": "OUTPUT_LAYER"
},
"class": "processing.modeler.ModelerAlgorithm.ValueFromOutput"
}
},
"active": true,
"consoleName": "qgis:deleteholes",
"description": "Delete holes"
},
"class": "processing.modeler.ModelerAlgorithm.Algorithm"
},
"GRASS7V.DELAUNAY_1": {
"values": {
"name": "GRASS7V.DELAUNAY_1",
"paramsFolded": true,
"outputs": {},
"outputsFolded": true,
"pos": {
"values": {
"y": 189.24968124999998,
"x": 370.27594999999985
},
"class": "point"
},
"dependencies": [],
"params": {
"GRASS_SNAP_TOLERANCE_PARAMETER": -1.0,
"GRASS_MIN_AREA_PARAMETER": 0.0001,
"GRASS_OUTPUT_TYPE_PARAMETER": 0,
"-r": false,
"input": {
"values": {
"alg": "SCRIPTASSIGNPARISHES_1",
"output": "crab_with_parishes"
},
"class": "processing.modeler.ModelerAlgorithm.ValueFromOutput"
},
"GRASS_REGION_PARAMETER": null
},
"active": true,
"consoleName": "grass7:v.delaunay",
"description": "v.delaunay - Creates a Delaunay triangulation from an input vector map containing points or centroids."
},
"class": "processing.modeler.ModelerAlgorithm.Algorithm"
},
"GRASS7V.DISSOLVE_1": {
"values": {
"name": "GRASS7V.DISSOLVE_1",
"paramsFolded": true,
"outputs": {},
"outputsFolded": true,
"pos": {
"values": {
"y": 53.0525375,
"x": 605.4139249999998
},
"class": "point"
},
"dependencies": [],
"params": {
"GRASS_SNAP_TOLERANCE_PARAMETER": -1.0,
"GRASS_MIN_AREA_PARAMETER": 0.0001,
"column": "parish",
"GRASS_OUTPUT_TYPE_PARAMETER": 0,
"input": {
"values": {
"alg": "GRASS7V.VORONOI_1",
"output": "output"
},
"class": "processing.modeler.ModelerAlgorithm.ValueFromOutput"
},
"GRASS_REGION_PARAMETER": null
},
"active": true,
"consoleName": "grass7:v.dissolve",
"description": "v.dissolve - Dissolves boundaries between adjacent areas sharing a common category number or attribute."
},
"class": "processing.modeler.ModelerAlgorithm.Algorithm"
},
"QGISCLIP_1": {
"values": {
"name": "QGISCLIP_1",
"paramsFolded": true,
"outputs": {},
"outputsFolded": true,
"pos": {
"values": {
"y": 52.99811249999988,
"x": 824.2610562500001
},
"class": "point"
},
"dependencies": [],
"params": {
"INPUT": {
"values": {
"alg": "GRASS7V.DISSOLVE_1",
"output": "output"
},
"class": "processing.modeler.ModelerAlgorithm.ValueFromOutput"
},
"OVERLAY": {
"values": {
"alg": "QGISDISSOLVE_1",
"output": "OUTPUT"
},
"class": "processing.modeler.ModelerAlgorithm.ValueFromOutput"
}
},
"active": true,
"consoleName": "qgis:clip",
"description": "Clip"
},
"class": "processing.modeler.ModelerAlgorithm.Algorithm"
},
"QGISSAVESELECTEDFEATURES_1": {
"values": {
"name": "QGISSAVESELECTEDFEATURES_1",
"paramsFolded": true,
"outputs": {},
"outputsFolded": true,
"pos": {
"values": {
"y": 370.35351875000003,
"x": 836.0980500000005
},
"class": "point"
},
"dependencies": [],
"params": {
"INPUT_LAYER": {
"values": {
"alg": "QGISSELECTBYEXPRESSION_1",
"output": "RESULT"
},
"class": "processing.modeler.ModelerAlgorithm.ValueFromOutput"
}
},
"active": true,
"consoleName": "qgis:saveselectedfeatures",
"description": "Save selected features"
},
"class": "processing.modeler.ModelerAlgorithm.Algorithm"
},
"SCRIPTASSIGNPARISHES_1": {
"values": {
"name": "SCRIPTASSIGNPARISHES_1",
"paramsFolded": true,
"outputs": {},
"outputsFolded": true,
"pos": {
"values": {
"y": 74.0,
"x": 149.0
},
"class": "point"
},
"dependencies": [],
"params": {
"parishes": {
"values": {
"name": "parishes"
},
"class": "processing.modeler.ModelerAlgorithm.ValueFromInput"
},
"crab": {
"values": {
"name": "crab"
},
"class": "processing.modeler.ModelerAlgorithm.ValueFromInput"
}
},
"active": true,
"consoleName": "script:assignparishes",
"description": "assign parishes"
},
"class": "processing.modeler.ModelerAlgorithm.Algorithm"
},
"QGISFIELDCALCULATOR_1": {
"values": {
"name": "QGISFIELDCALCULATOR_1",
"paramsFolded": true,
"outputs": {},
"outputsFolded": true,
"pos": {
"values": {
"y": 188.21709999999996,
"x": 827.5490312500001
},
"class": "point"
},
"dependencies": [],
"params": {
"FIELD_TYPE": 1,
"NEW_FIELD": true,
"INPUT_LAYER": {
"values": {
"alg": "QGISCLIP_1",
"output": "OUTPUT"
},
"class": "processing.modeler.ModelerAlgorithm.ValueFromOutput"
},
"FIELD_PRECISION": 0.0,
"FIELD_LENGTH": 10.0,
"FORMULA": "$area",
"FIELD_NAME": "area"
},
"active": true,
"consoleName": "qgis:fieldcalculator",
"description": "Field calculator"
},
"class": "processing.modeler.ModelerAlgorithm.Algorithm"
},
"QGISDISSOLVE_1": {
"values": {
"name": "QGISDISSOLVE_1",
"paramsFolded": true,
"outputs": {},
"outputsFolded": true,
"pos": {
"values": {
"y": 192.37974999999994,
"x": 597.9895437499999
},
"class": "point"
},
"dependencies": [],
"params": {
"INPUT": {
"values": {
"alg": "GRASS7V.DELAUNAY_1",
"output": "output"
},
"class": "processing.modeler.ModelerAlgorithm.ValueFromOutput"
},
"DISSOLVE_ALL": true,
"FIELD": null
},
"active": true,
"consoleName": "qgis:dissolve",
"description": "Dissolve"
},
"class": "processing.modeler.ModelerAlgorithm.Algorithm"
},
"QGISSELECTBYEXPRESSION_1": {
"values": {
"name": "QGISSELECTBYEXPRESSION_1",
"paramsFolded": true,
"outputs": {},
"outputsFolded": true,
"pos": {
"values": {
"y": 276.73546250000004,
"x": 835.5879375000004
},
"class": "point"
},
"dependencies": [],
"params": {
"LAYERNAME": {
"values": {
"alg": "QGISFIELDCALCULATOR_1",
"output": "OUTPUT_LAYER"
},
"class": "processing.modeler.ModelerAlgorithm.ValueFromOutput"
},
"EXPRESSION": "\"area\" > 15000",
"METHOD": 0
},
"active": true,
"consoleName": "qgis:selectbyexpression",
"description": "Select by expression"
},
"class": "processing.modeler.ModelerAlgorithm.Algorithm"
}
}
},
"class": "processing.modeler.ModelerAlgorithm.ModelerAlgorithm"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment