Skip to content
Permalink
Browse files

[feature] Adapted k-neighbour concave hull plugin as QGIS 3 algorithm

Co-authored-by: Detlev Neumann <dneumann@geospatial-services.de>
  • Loading branch information
rudivs and detlevn committed Aug 15, 2018
1 parent 6fcc162 commit 52ccc43ebb238db84d2ef4758d864a4257848a41
@@ -0,0 +1,164 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="24"
height="24"
id="svg2"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="icon.svg"
inkscape:export-filename="E:\0000200_Entwicklung\ConcaveHull_for_QGIS\concavehull\icon2.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="11.107168"
inkscape:cx="14.965358"
inkscape:cy="9.330254"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1160"
inkscape:window-height="795"
inkscape:window-x="830"
inkscape:window-y="169"
inkscape:window-maximized="0" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1028.3622)">
<path
style="fill:#6d97c4;fill-opacity:1;stroke:#253e5b;stroke-width:0.96177327999999995px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 2.5017811,1034.7051 0.083121,6.8555 6.1509752,0.6314 4.4054287,8.2086 8.229007,-0.3608 1.246819,-14.2523 -5.901611,-5.4122 -10.5564036,0.09 z"
id="path3862"
inkscape:connector-curvature="0" />
<path
sodipodi:type="arc"
style="fill:#ffff00;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="path2996"
sodipodi:cx="8.2379236"
sodipodi:cy="6.8489137"
sodipodi:rx="1.9356869"
sodipodi:ry="1.9356869"
d="m 10.173611,6.8489137 a 1.9356869,1.9356869 0 1 1 -3.8713743,0 1.9356869,1.9356869 0 1 1 3.8713743,0 z"
transform="translate(-1.2604474,1024.0407)" />
<path
sodipodi:type="arc"
style="fill:#ffff00;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="path2996-1"
sodipodi:cx="8.2379236"
sodipodi:cy="6.8489137"
sodipodi:rx="1.9356869"
sodipodi:ry="1.9356869"
d="m 10.173611,6.8489137 a 1.9356869,1.9356869 0 1 1 -3.8713743,0 1.9356869,1.9356869 0 1 1 3.8713743,0 z"
transform="translate(9.4083383,1024.1757)" />
<path
sodipodi:type="arc"
style="fill:#ffff00;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="path2996-1-7"
sodipodi:cx="8.2379236"
sodipodi:cy="6.8489137"
sodipodi:rx="1.9356869"
sodipodi:ry="1.9356869"
d="m 10.173611,6.8489137 a 1.9356869,1.9356869 0 1 1 -3.8713743,0 1.9356869,1.9356869 0 1 1 3.8713743,0 z"
transform="translate(13.369744,1029.1275)" />
<path
sodipodi:type="arc"
style="fill:#ffff00;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="path2996-1-7-4"
sodipodi:cx="8.2379236"
sodipodi:cy="6.8489137"
sodipodi:rx="1.9356869"
sodipodi:ry="1.9356869"
d="m 10.173611,6.8489137 a 1.9356869,1.9356869 0 1 1 -3.8713743,0 1.9356869,1.9356869 0 1 1 3.8713743,0 z"
transform="translate(-5.7170289,1034.7095)" />
<path
sodipodi:type="arc"
style="fill:#ffff00;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="path2996-1-7-0"
sodipodi:cx="8.2379236"
sodipodi:cy="6.8489137"
sodipodi:rx="1.9356869"
sodipodi:ry="1.9356869"
d="m 10.173611,6.8489137 a 1.9356869,1.9356869 0 1 1 -3.8713743,0 1.9356869,1.9356869 0 1 1 3.8713743,0 z"
transform="translate(13.279713,1042.9023)" />
<path
sodipodi:type="arc"
style="fill:#ffff00;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="path2996-1-7-9"
sodipodi:cx="8.2379236"
sodipodi:cy="6.8489137"
sodipodi:rx="1.9356869"
sodipodi:ry="1.9356869"
d="m 10.173611,6.8489137 a 1.9356869,1.9356869 0 1 1 -3.8713743,0 1.9356869,1.9356869 0 1 1 3.8713743,0 z"
transform="translate(5.8070607,1042.9024)" />
<path
sodipodi:type="arc"
style="fill:#ffff00;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="path2996-1-7-48"
sodipodi:cx="8.2379236"
sodipodi:cy="6.8489137"
sodipodi:rx="1.9356869"
sodipodi:ry="1.9356869"
d="m 10.173611,6.8489137 a 1.9356869,1.9356869 0 1 1 -3.8713743,0 1.9356869,1.9356869 0 1 1 3.8713743,0 z"
transform="translate(1.2154309,1035.4297)" />
<path
sodipodi:type="arc"
style="fill:#ffff00;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="path2996-1-7-8"
sodipodi:cx="8.2379236"
sodipodi:cy="6.8489137"
sodipodi:rx="1.9356869"
sodipodi:ry="1.9356869"
d="m 10.173611,6.8489137 a 1.9356869,1.9356869 0 1 1 -3.8713743,0 1.9356869,1.9356869 0 1 1 3.8713743,0 z"
transform="translate(10.39869,1036.7802)" />
<path
sodipodi:type="arc"
style="fill:#ffff00;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="path2996-1-7-2"
sodipodi:cx="8.2379236"
sodipodi:cy="6.8489137"
sodipodi:rx="1.9356869"
sodipodi:ry="1.9356869"
d="m 10.173611,6.8489137 a 1.9356869,1.9356869 0 1 1 -3.8713743,0 1.9356869,1.9356869 0 1 1 3.8713743,0 z"
transform="translate(5.4469326,1029.7577)" />
<path
sodipodi:type="arc"
style="fill:#ffff00;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="path2996-1-7-45"
sodipodi:cx="8.2379236"
sodipodi:cy="6.8489137"
sodipodi:rx="1.9356869"
sodipodi:ry="1.9356869"
d="m 10.173611,6.8489137 a 1.9356869,1.9356869 0 1 1 -3.8713743,0 1.9356869,1.9356869 0 1 1 3.8713743,0 z"
transform="translate(-5.5369652,1028.1372)" />
</g>
</svg>
@@ -69,13 +69,13 @@ def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterBoolean(self.NO_MULTIGEOMETRY,
self.tr('Split multipart geometry into singleparts geometries'), defaultValue=False))

self.addParameter(QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Concave hull'), type=QgsProcessing.TypeVectorPolygon))
self.addParameter(QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Output layer'), type=QgsProcessing.TypeVectorPolygon))

def name(self):
return 'concavehull'

def displayName(self):
return self.tr('Concave hull')
return self.tr('Concave hull (using alpha shapes algorithm)')

def processAlgorithm(self, parameters, context, feedback):
layer = self.parameterAsSource(parameters, ConcaveHull.INPUT, context)

0 comments on commit 52ccc43

Please sign in to comment.
You can’t perform that action at this time.