Skip to content

Commit

Permalink
Run autoformatters
Browse files Browse the repository at this point in the history
  • Loading branch information
mhhd2020 committed Jul 23, 2023
1 parent 16eb77a commit 15f2b90
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Helper script for 'count_overlaps'.
"""

import processing
from PyQt5.QtCore import QCoreApplication, QVariant
from qgis.core import (
QgsFeature,
Expand All @@ -14,7 +13,6 @@
QgsProcessingException,
QgsProcessingParameterFeatureSink,
QgsProcessingParameterFeatureSource,
QgsProcessingParameterString,
)


Expand Down Expand Up @@ -101,16 +99,22 @@ def processAlgorithm(self, parameters, context, feedback):
for i, feature in enumerate(features):
attributes = feature.attributes()
del attributes[name_index]
attributes += [0] * (len(out_fields) - len(attributes)) # Initialise new fields with zero
attributes += [0] * (
len(out_fields) - len(attributes)
) # Initialise new fields with zero

count = 0 # Each feature has the same geometry as itself, so the count will be incremented by one in any
# case in the following inner loop

features_ = source.getFeatures()
for j, other_feature in enumerate(features_):
if feature.geometry().equals(other_feature.geometry()):
feature_id = other_feature.attributes()[name_index] # Name of the sketch map this marking is from
attributes[out_fields.indexOf(str(feature_id))] = 1 # Set the indicator variable for this
feature_id = other_feature.attributes()[
name_index
] # Name of the sketch map this marking is from
attributes[
out_fields.indexOf(str(feature_id))
] = 1 # Set the indicator variable for this
# sketch map to one
count += 1
if j >= i: # duplicate feature not already added
Expand Down

0 comments on commit 15f2b90

Please sign in to comment.