Skip to content

Commit 9cdea17

Browse files
committedSep 24, 2014
Add option for unscaled values for heatmaps rasters, set as default
1 parent 957e791 commit 9cdea17

File tree

5 files changed

+260
-202
lines changed

5 files changed

+260
-202
lines changed
 

‎src/plugins/heatmap/heatmap.cpp

Lines changed: 83 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ void Heatmap::run()
132132
int rows = d.rows();
133133
double cellsize = d.cellSizeX(); // or d.cellSizeY(); both have the same value
134134
mDecay = d.decayRatio();
135-
int kernelShape = d.kernelShape();
135+
KernelShape kernelShape = d.kernelShape();
136+
OutputValues valueType = d.outputValues();
136137

137138
//is input layer multipoint?
138139
bool isMultiPoint = inputLayer->wkbType() == QGis::WKBMultiPoint || inputLayer->wkbType() == QGis::WKBMultiPoint25D;
@@ -311,7 +312,7 @@ void Heatmap::run()
311312
continue;
312313
}
313314

314-
double pixelValue = weight * calculateKernelValue( distance, myBuffer, kernelShape );
315+
double pixelValue = weight * calculateKernelValue( distance, myBuffer, kernelShape, valueType );
315316

316317
// clearing anamolies along the axes
317318
if ( xp == 0 && yp == 0 )
@@ -386,24 +387,24 @@ int Heatmap::bufferSize( double radius, double cellsize )
386387
return buffer;
387388
}
388389

389-
double Heatmap::calculateKernelValue( double distance, int bandwidth, int kernelShape )
390+
double Heatmap::calculateKernelValue( const double distance, const int bandwidth, const KernelShape shape, const OutputValues outputType )
390391
{
391-
switch ( kernelShape )
392+
switch ( shape )
392393
{
393394
case Heatmap::Triangular:
394-
return triangularKernel( distance , bandwidth );
395+
return triangularKernel( distance , bandwidth, outputType );
395396

396397
case Heatmap::Uniform:
397-
return uniformKernel( distance, bandwidth );
398+
return uniformKernel( distance, bandwidth, outputType );
398399

399400
case Heatmap::Quartic:
400-
return quarticKernel( distance, bandwidth );
401+
return quarticKernel( distance, bandwidth, outputType );
401402

402403
case Heatmap::Triweight:
403-
return triweightKernel( distance, bandwidth );
404+
return triweightKernel( distance, bandwidth, outputType );
404405

405406
case Heatmap::Epanechnikov:
406-
return epanechnikovKernel( distance, bandwidth );
407+
return epanechnikovKernel( distance, bandwidth, outputType );
407408
}
408409
return 0;
409410

@@ -417,59 +418,99 @@ double Heatmap::calculateKernelValue( double distance, int bandwidth, int kernel
417418
* k is calculated by polar double integration of the kernel function
418419
* between a radius of 0 to the specified bandwidth and equating the area to 1. */
419420

420-
double Heatmap::uniformKernel( double distance, int bandwidth )
421+
double Heatmap::uniformKernel( const double distance, const int bandwidth, const OutputValues outputType ) const
421422
{
422423
Q_UNUSED( distance );
423-
// Normalizing constant
424-
double k = 2. / ( M_PI * ( double )bandwidth );
424+
switch ( outputType )
425+
{
426+
case Heatmap::Scaled:
427+
{
428+
// Normalizing constant
429+
double k = 2. / ( M_PI * ( double )bandwidth );
425430

426-
// Derived from Wand and Jones (1995), p. 175
427-
return k * ( 0.5 / ( double )bandwidth );
431+
// Derived from Wand and Jones (1995), p. 175
432+
return k * ( 0.5 / ( double )bandwidth );
433+
}
434+
default:
435+
return 1.0;
436+
}
428437
}
429438

430-
double Heatmap::quarticKernel( double distance, int bandwidth )
439+
double Heatmap::quarticKernel( const double distance, const int bandwidth, const OutputValues outputType ) const
431440
{
432-
// Normalizing constant
433-
double k = 16. / ( 5. * M_PI * pow(( double )bandwidth, 2 ) );
441+
switch ( outputType )
442+
{
443+
case Heatmap::Scaled:
444+
{
445+
// Normalizing constant
446+
double k = outputType == Heatmap::Scaled ? 116. / ( 5. * M_PI * pow(( double )bandwidth, 2 ) ) : 1.0;
434447

435-
// Derived from Wand and Jones (1995), p. 175
436-
return k * ( 15. / 16. ) * pow( 1. - pow( distance / ( double )bandwidth, 2 ), 2 );
448+
// Derived from Wand and Jones (1995), p. 175
449+
return k * ( 15. / 16. ) * pow( 1. - pow( distance / ( double )bandwidth, 2 ), 2 );
450+
}
451+
default:
452+
return pow( 1. - pow( distance / ( double )bandwidth, 2 ), 2 );
453+
}
437454
}
438455

439-
double Heatmap::triweightKernel( double distance, int bandwidth )
456+
double Heatmap::triweightKernel( const double distance, const int bandwidth, const OutputValues outputType ) const
440457
{
441-
// Normalizing constant
442-
double k = 128. / ( 35. * M_PI * pow(( double )bandwidth, 2 ) );
458+
switch ( outputType )
459+
{
460+
case Heatmap::Scaled:
461+
{
462+
// Normalizing constant
463+
double k = outputType == Heatmap::Scaled ? 128. / ( 35. * M_PI * pow(( double )bandwidth, 2 ) ) : 1.0;
443464

444-
// Derived from Wand and Jones (1995), p. 175
445-
return k * ( 35. / 32. ) * pow( 1. - pow( distance / ( double )bandwidth, 2 ), 3 );
465+
// Derived from Wand and Jones (1995), p. 175
466+
return k * ( 35. / 32. ) * pow( 1. - pow( distance / ( double )bandwidth, 2 ), 3 );
467+
}
468+
default:
469+
return pow( 1. - pow( distance / ( double )bandwidth, 2 ), 3 );
470+
}
446471
}
447472

448-
double Heatmap::epanechnikovKernel( double distance, int bandwidth )
473+
double Heatmap::epanechnikovKernel( const double distance, const int bandwidth, const OutputValues outputType ) const
449474
{
450-
// Normalizing constant
451-
double k = 8. / ( 3. * M_PI * pow(( double )bandwidth, 2 ) );
475+
switch ( outputType )
476+
{
477+
case Heatmap::Scaled:
478+
{
479+
// Normalizing constant
480+
double k = outputType == Heatmap::Scaled ? 8. / ( 3. * M_PI * pow(( double )bandwidth, 2 ) ) : 1.0;
452481

453-
// Derived from Wand and Jones (1995), p. 175
454-
return k * ( 3. / 4. ) * ( 1. - pow( distance / ( double )bandwidth, 2 ) );
482+
// Derived from Wand and Jones (1995), p. 175
483+
return k * ( 3. / 4. ) * ( 1. - pow( distance / ( double )bandwidth, 2 ) );
484+
}
485+
default:
486+
return ( 1. - pow( distance / ( double )bandwidth, 2 ) );
487+
}
455488
}
456489

457-
double Heatmap::triangularKernel( double distance, int bandwidth )
490+
double Heatmap::triangularKernel( const double distance, const int bandwidth, const OutputValues outputType ) const
458491
{
459-
// Normalizing constant. In this case it's calculated a little different
460-
// due to the inclusion of the non-standard "decay" parameter
461-
462-
if ( mDecay >= 0 )
492+
switch ( outputType )
463493
{
464-
double k = 3. / (( 1. + 2. * mDecay ) * M_PI * pow(( double )bandwidth, 2 ) );
494+
case Heatmap::Scaled:
495+
{
496+
// Normalizing constant. In this case it's calculated a little different
497+
// due to the inclusion of the non-standard "decay" parameter
465498

466-
// Derived from Wand and Jones (1995), p. 175 (with addition of decay parameter)
467-
return k * ( 1. - ( 1. - mDecay ) * ( distance / ( double )bandwidth ) );
468-
}
469-
else
470-
{
471-
// Non-standard or mathematically valid negative decay ("coolmap")
472-
return ( 1. - ( 1. - mDecay ) * ( distance / ( double )bandwidth ) );
499+
if ( mDecay >= 0 )
500+
{
501+
double k = 3. / (( 1. + 2. * mDecay ) * M_PI * pow(( double )bandwidth, 2 ) );
502+
503+
// Derived from Wand and Jones (1995), p. 175 (with addition of decay parameter)
504+
return k * ( 1. - ( 1. - mDecay ) * ( distance / ( double )bandwidth ) );
505+
}
506+
else
507+
{
508+
// Non-standard or mathematically valid negative decay ("coolmap")
509+
return ( 1. - ( 1. - mDecay ) * ( distance / ( double )bandwidth ) );
510+
}
511+
}
512+
default:
513+
return ( 1. - ( 1. - mDecay ) * ( distance / ( double )bandwidth ) );
473514
}
474515
}
475516

‎src/plugins/heatmap/heatmap.h

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class Heatmap: public QObject, public QgisPlugin
7171
virtual ~Heatmap();
7272

7373
// Kernel shape type
74-
enum kernelShape
74+
enum KernelShape
7575
{
7676
Quartic,
7777
Triangular,
@@ -80,6 +80,13 @@ class Heatmap: public QObject, public QgisPlugin
8080
Epanechnikov
8181
};
8282

83+
// Output values type
84+
enum OutputValues
85+
{
86+
Raw,
87+
Scaled
88+
};
89+
8390
QMap<QString, QVariant> mSessionSettings;
8491

8592
public slots:
@@ -100,17 +107,17 @@ class Heatmap: public QObject, public QgisPlugin
100107
//! Worker to calculate buffer size in pixels
101108
int bufferSize( double radius, double cellsize );
102109
//! Calculate the value given to a point width a given distance for a specified kernel shape
103-
double calculateKernelValue( double distance, int bandwidth, int kernelShape );
110+
double calculateKernelValue( const double distance, const int bandwidth, const KernelShape shape, const OutputValues outputType );
104111
//! Uniform kernel function
105-
double uniformKernel( double distance, int bandwidth );
112+
double uniformKernel( const double distance, const int bandwidth , const OutputValues outputType ) const;
106113
//! Quartic kernel function
107-
double quarticKernel( double distance, int bandwidth );
114+
double quarticKernel( const double distance, const int bandwidth , const OutputValues outputType ) const;
108115
//! Triweight kernel function
109-
double triweightKernel( double distance, int bandwidth );
116+
double triweightKernel( const double distance, const int bandwidth , const OutputValues outputType ) const;
110117
//! Epanechnikov kernel function
111-
double epanechnikovKernel( double distance, int bandwidth );
118+
double epanechnikovKernel( const double distance, const int bandwidth, const OutputValues outputType ) const;
112119
//! Triangular kernel function
113-
double triangularKernel( double distance, int bandwidth );
120+
double triangularKernel( const double distance, const int bandwidth , const OutputValues outputType ) const;
114121

115122
// MANDATORY PLUGIN PROPERTY DECLARATIONS .....
116123

‎src/plugins/heatmap/heatmapgui.cpp

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ HeatmapGui::HeatmapGui( QWidget* parent, Qt::WindowFlags fl, QMap<QString, QVari
4646

4747
blockAllSignals( true );
4848

49+
mKernelShapeCombo->addItem( tr( "Quartic (biweight)" ), Heatmap::Quartic );
50+
mKernelShapeCombo->addItem( tr( "Triangular" ), Heatmap::Triangular );
51+
mKernelShapeCombo->addItem( tr( "Uniform" ), Heatmap::Uniform );
52+
mKernelShapeCombo->addItem( tr( "Triweight" ), Heatmap::Triweight );
53+
mKernelShapeCombo->addItem( tr( "Epanechnikov" ), Heatmap::Epanechnikov );
54+
55+
mOutputValuesComboBox->addItem( tr( "Raw values" ), Heatmap::Raw );
56+
mOutputValuesComboBox->addItem( tr( "Scaled by kernel size" ), Heatmap::Scaled );
57+
4958
mHeatmapSessionSettings = temporarySettings;
5059

5160
// Adding point layers to the inputLayerCombo
@@ -124,6 +133,7 @@ void HeatmapGui::blockAllSignals( bool b )
124133
mColumnsSpinBox->blockSignals( b );
125134
mCellXLineEdit->blockSignals( b );
126135
mCellYLineEdit->blockSignals( b );
136+
mOutputValuesComboBox->blockSignals( b );
127137
}
128138

129139
/*
@@ -184,10 +194,15 @@ void HeatmapGui::restoreSettings( bool usingLastInputLayer )
184194
// Kernel setting - not layer specific
185195
if ( mHeatmapSessionSettings->value( QString( "lastKernel" ) ).toInt() )
186196
{
187-
mKernelShapeCombo->setCurrentIndex( mHeatmapSessionSettings->value( QString( "lastKernel" ) ).toInt() );
197+
mKernelShapeCombo->setCurrentIndex( mKernelShapeCombo->findData(
198+
( Heatmap::KernelShape )( mHeatmapSessionSettings->value( QString( "lastKernel" ) ).toInt() ) ) );
188199
mDecayLineEdit->setText( mHeatmapSessionSettings->value( QString( "decayRatio" ) ).toString() );
189-
mDecayLineEdit->setEnabled( mAdvancedGroupBox->isChecked() && mKernelShapeCombo->currentIndex() == Heatmap::Triangular );
200+
mDecayLineEdit->setEnabled( mAdvancedGroupBox->isChecked() &&
201+
( Heatmap::KernelShape )( mKernelShapeCombo->itemData( mKernelShapeCombo->currentIndex() ).toInt() ) == Heatmap::Triangular );
190202
}
203+
mOutputValuesComboBox->setCurrentIndex( mOutputValuesComboBox->findData(
204+
( Heatmap::OutputValues )( mHeatmapSessionSettings->value( QString( "lastOutputValues" ), "0" ).toInt() ) ) );
205+
191206
}
192207

193208
void HeatmapGui::saveSettings()
@@ -203,13 +218,14 @@ void HeatmapGui::saveSettings()
203218
mHeatmapSessionSettings->insert( QString( "lastRadiusUnit" ), QVariant( mBufferUnitCombo->currentIndex() ) );
204219
mHeatmapSessionSettings->insert( QString( "advancedEnabled" ), QVariant( mAdvancedGroupBox->isChecked() ) );
205220
mHeatmapSessionSettings->insert( QString( "lastRows" ), QVariant( mRowsSpinBox->value() ) );
206-
mHeatmapSessionSettings->insert( QString( "lastKernel" ), QVariant( mKernelShapeCombo->currentIndex() ) );
221+
mHeatmapSessionSettings->insert( QString( "lastKernel" ), QVariant( mKernelShapeCombo->itemData( mKernelShapeCombo->currentIndex() ).toInt() ) );
207222
mHeatmapSessionSettings->insert( QString( "useRadius" ), QVariant( mRadiusFieldCheckBox->isChecked() ) );
208223
mHeatmapSessionSettings->insert( QString( "radiusField" ), QVariant( mRadiusFieldCombo->currentField() ) );
209224
mHeatmapSessionSettings->insert( QString( "radiusFieldUnit" ), QVariant( mRadiusFieldUnitCombo->currentIndex() ) );
210225
mHeatmapSessionSettings->insert( QString( "useWeight" ), QVariant( mWeightFieldCheckBox->isChecked() ) );
211226
mHeatmapSessionSettings->insert( QString( "weightField" ), QVariant( mWeightFieldCombo->currentField() ) );
212227
mHeatmapSessionSettings->insert( QString( "decayRatio" ), QVariant( mDecayLineEdit->text() ) );
228+
mHeatmapSessionSettings->insert( QString( "lastOutputValues" ), QVariant( mOutputValuesComboBox->itemData( mOutputValuesComboBox->currentIndex() ).toInt() ) );
213229
}
214230

215231
void HeatmapGui::on_mButtonBox_rejected()
@@ -260,7 +276,8 @@ void HeatmapGui::on_mAdvancedGroupBox_toggled( bool enabled )
260276
}
261277

262278
updateBBox();
263-
mDecayLineEdit->setEnabled( mKernelShapeCombo->currentIndex() == Heatmap::Triangular );
279+
mDecayLineEdit->setEnabled(( Heatmap::KernelShape )( mKernelShapeCombo->itemData( mKernelShapeCombo->currentIndex() ).toInt() ) == Heatmap::Triangular );
280+
264281
}
265282
}
266283

@@ -464,7 +481,7 @@ void HeatmapGui::updateBBox()
464481
updateSize();
465482
}
466483

467-
double HeatmapGui::mapUnitsOf( double meters, QgsCoordinateReferenceSystem layerCrs )
484+
double HeatmapGui::mapUnitsOf( double meters, QgsCoordinateReferenceSystem layerCrs ) const
468485
{
469486
// converter function to transform metres input to mapunits
470487
// so that bounding box can be updated
@@ -485,17 +502,17 @@ double HeatmapGui::mapUnitsOf( double meters, QgsCoordinateReferenceSystem layer
485502
*
486503
*/
487504

488-
bool HeatmapGui::weighted()
505+
bool HeatmapGui::weighted() const
489506
{
490507
return mWeightFieldCheckBox->isChecked();
491508
}
492509

493-
bool HeatmapGui::variableRadius()
510+
bool HeatmapGui::variableRadius() const
494511
{
495512
return mRadiusFieldCheckBox->isChecked();
496513
}
497514

498-
double HeatmapGui::radius()
515+
double HeatmapGui::radius() const
499516
{
500517
double radius = mBufferSizeLineEdit->text().toDouble();
501518
if ( mBufferUnitCombo->currentIndex() == HeatmapGui::Meters )
@@ -505,7 +522,7 @@ double HeatmapGui::radius()
505522
return radius;
506523
}
507524

508-
int HeatmapGui::radiusUnit()
525+
int HeatmapGui::radiusUnit() const
509526
{
510527
if ( mRadiusFieldCheckBox->isChecked() )
511528
{
@@ -514,17 +531,22 @@ int HeatmapGui::radiusUnit()
514531
return mBufferUnitCombo->currentIndex();
515532
}
516533

517-
int HeatmapGui::kernelShape()
534+
Heatmap::KernelShape HeatmapGui::kernelShape() const
535+
{
536+
return ( Heatmap::KernelShape ) mKernelShapeCombo->itemData( mKernelShapeCombo->currentIndex() ).toInt();
537+
}
538+
539+
Heatmap::OutputValues HeatmapGui::outputValues() const
518540
{
519-
return mKernelShapeCombo->currentIndex();
541+
return ( Heatmap::OutputValues ) mOutputValuesComboBox->itemData( mOutputValuesComboBox->currentIndex() ).toInt();
520542
}
521543

522-
double HeatmapGui::decayRatio()
544+
double HeatmapGui::decayRatio() const
523545
{
524546
return mDecayLineEdit->text().toDouble();
525547
}
526548

527-
int HeatmapGui::radiusField()
549+
int HeatmapGui::radiusField() const
528550
{
529551
QgsVectorLayer *inputLayer = inputVectorLayer();
530552
if ( !inputLayer )
@@ -533,7 +555,7 @@ int HeatmapGui::radiusField()
533555
return inputLayer->pendingFields().indexFromName( mRadiusFieldCombo->currentField() );
534556
}
535557

536-
int HeatmapGui::weightField()
558+
int HeatmapGui::weightField() const
537559
{
538560
QgsVectorLayer *inputLayer = inputVectorLayer();
539561
if ( !inputLayer )
@@ -542,12 +564,12 @@ int HeatmapGui::weightField()
542564
return inputLayer->pendingFields().indexFromName( mWeightFieldCombo->currentField() );
543565
}
544566

545-
bool HeatmapGui::addToCanvas()
567+
bool HeatmapGui::addToCanvas() const
546568
{
547569
return mAddToCanvas->isChecked();
548570
}
549571

550-
QString HeatmapGui::outputFilename()
572+
QString HeatmapGui::outputFilename() const
551573
{
552574
QString outputFileName;
553575
QString outputFormat;
@@ -582,7 +604,7 @@ QString HeatmapGui::outputFilename()
582604
return outputFileName;
583605
}
584606

585-
QString HeatmapGui::outputFormat()
607+
QString HeatmapGui::outputFormat() const
586608
{
587609
return mFormatCombo->itemData( mFormatCombo->currentIndex() ).toString();
588610
}

‎src/plugins/heatmap/heatmapgui.h

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <QDialog>
1616
#include <ui_heatmapguibase.h>
1717

18+
#include "heatmap.h"
1819
#include "qgsvectorlayer.h"
1920
#include "qgscoordinatereferencesystem.h"
2021
#include "qgsgeometry.h"
@@ -37,55 +38,58 @@ class HeatmapGui : public QDialog, private Ui::HeatmapGuiBase
3738
};
3839

3940
/** Returns whether to apply weighted heat */
40-
bool weighted();
41+
bool weighted() const;
4142

4243
/** Returns whether the radius is static or based on a field */
43-
bool variableRadius();
44+
bool variableRadius() const;
4445

4546
/** Returns the fixed radius value */
46-
double radius();
47+
double radius() const;
4748

4849
/** Return the radius Unit (meters/map units) */
49-
int radiusUnit();
50+
int radiusUnit() const;
5051

5152
/** Return the selected kernel shape */
52-
int kernelShape();
53+
Heatmap::KernelShape kernelShape() const;
54+
55+
/** Return the selected output values setting */
56+
Heatmap::OutputValues outputValues() const;
5357

5458
/** Return the decay ratio */
55-
double decayRatio();
59+
double decayRatio() const;
5660

5761
/** Return the attribute field for variable radius */
58-
int radiusField();
62+
int radiusField() const;
5963

6064
/** Returns the attrinute field for weighted heat */
61-
int weightField();
65+
int weightField() const;
6266

6367
/** Returns state of the add to canvas checkbox*/
64-
bool addToCanvas();
68+
bool addToCanvas() const;
6569

6670
/** Returns the output filename/path */
67-
QString outputFilename();
71+
QString outputFilename() const;
6872

6973
/** Returns the GDAL Format for output raster */
70-
QString outputFormat();
74+
QString outputFormat() const;
7175

7276
/** Returns the input Vector layer */
7377
QgsVectorLayer* inputVectorLayer() const;
7478

7579
/** Returns the no of rows for the raster */
76-
int rows() { return mRows; }
80+
int rows() const { return mRows; }
7781

7882
/** Returns the no of columns in the raster */
79-
int columns() { return mColumns; }
83+
int columns() const { return mColumns; }
8084

8185
/** Returns the cell size X value */
82-
double cellSizeX() { return mXcellsize; }
86+
double cellSizeX() const { return mXcellsize; }
8387

8488
/** Returns the cell size Y valuue */
85-
double cellSizeY() { return mYcellsize; }
89+
double cellSizeY() const { return mYcellsize; }
8690

8791
/** Return the BBox */
88-
QgsRectangle bbox() { return mBBox; }
92+
QgsRectangle bbox() const { return mBBox; }
8993

9094
private:
9195
QMap<QString, QString> mExtensionMap;
@@ -116,7 +120,7 @@ class HeatmapGui : public QDialog, private Ui::HeatmapGuiBase
116120
void updateSize();
117121

118122
/** Convert Maters value to the corresponding map units based on Layer projection */
119-
double mapUnitsOf( double meters, QgsCoordinateReferenceSystem layerCrs );
123+
double mapUnitsOf( double meters, QgsCoordinateReferenceSystem layerCrs ) const;
120124

121125
/** Estimate a reasonable starting value for the radius field */
122126
double estimateRadius();

‎src/plugins/heatmap/heatmapguibase.ui

Lines changed: 103 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<x>0</x>
88
<y>0</y>
99
<width>460</width>
10-
<height>447</height>
10+
<height>493</height>
1111
</rect>
1212
</property>
1313
<property name="sizePolicy">
@@ -133,108 +133,6 @@
133133
<bool>false</bool>
134134
</property>
135135
<layout class="QGridLayout" name="gridLayout_3">
136-
<item row="1" column="0">
137-
<layout class="QGridLayout" name="gridLayout_2">
138-
<item row="1" column="0">
139-
<widget class="QCheckBox" name="mRadiusFieldCheckBox">
140-
<property name="text">
141-
<string>Use radius from field</string>
142-
</property>
143-
</widget>
144-
</item>
145-
<item row="1" column="1">
146-
<widget class="QgsFieldComboBox" name="mRadiusFieldCombo">
147-
<property name="enabled">
148-
<bool>false</bool>
149-
</property>
150-
</widget>
151-
</item>
152-
<item row="1" column="2">
153-
<widget class="QComboBox" name="mRadiusFieldUnitCombo">
154-
<property name="enabled">
155-
<bool>false</bool>
156-
</property>
157-
<item>
158-
<property name="text">
159-
<string>meters</string>
160-
</property>
161-
</item>
162-
<item>
163-
<property name="text">
164-
<string>map units</string>
165-
</property>
166-
</item>
167-
</widget>
168-
</item>
169-
<item row="2" column="0">
170-
<widget class="QCheckBox" name="mWeightFieldCheckBox">
171-
<property name="text">
172-
<string>Use weight from field</string>
173-
</property>
174-
</widget>
175-
</item>
176-
<item row="2" column="1" colspan="2">
177-
<widget class="QgsFieldComboBox" name="mWeightFieldCombo">
178-
<property name="enabled">
179-
<bool>false</bool>
180-
</property>
181-
</widget>
182-
</item>
183-
<item row="3" column="1" colspan="2">
184-
<widget class="QLineEdit" name="mDecayLineEdit">
185-
<property name="enabled">
186-
<bool>false</bool>
187-
</property>
188-
<property name="text">
189-
<string>0.0</string>
190-
</property>
191-
</widget>
192-
</item>
193-
<item row="3" column="0">
194-
<widget class="QLabel" name="decayLabel">
195-
<property name="text">
196-
<string>Decay ratio</string>
197-
</property>
198-
</widget>
199-
</item>
200-
<item row="0" column="1" colspan="2">
201-
<widget class="QComboBox" name="mKernelShapeCombo">
202-
<item>
203-
<property name="text">
204-
<string>Quartic (biweight)</string>
205-
</property>
206-
</item>
207-
<item>
208-
<property name="text">
209-
<string>Triangular</string>
210-
</property>
211-
</item>
212-
<item>
213-
<property name="text">
214-
<string>Uniform</string>
215-
</property>
216-
</item>
217-
<item>
218-
<property name="text">
219-
<string>Triweight</string>
220-
</property>
221-
</item>
222-
<item>
223-
<property name="text">
224-
<string>Epanechnikov</string>
225-
</property>
226-
</item>
227-
</widget>
228-
</item>
229-
<item row="0" column="0">
230-
<widget class="QLabel" name="kernelShapeLabel">
231-
<property name="text">
232-
<string>Kernel shape</string>
233-
</property>
234-
</widget>
235-
</item>
236-
</layout>
237-
</item>
238136
<item row="0" column="0">
239137
<layout class="QGridLayout" name="advancedGrid">
240138
<property name="sizeConstraint">
@@ -314,6 +212,92 @@
314212
</item>
315213
</layout>
316214
</item>
215+
<item row="1" column="0">
216+
<layout class="QGridLayout" name="gridLayout_2">
217+
<item row="2" column="0">
218+
<widget class="QCheckBox" name="mWeightFieldCheckBox">
219+
<property name="text">
220+
<string>Use weight from field</string>
221+
</property>
222+
</widget>
223+
</item>
224+
<item row="1" column="1">
225+
<widget class="QgsFieldComboBox" name="mRadiusFieldCombo">
226+
<property name="enabled">
227+
<bool>false</bool>
228+
</property>
229+
</widget>
230+
</item>
231+
<item row="1" column="0">
232+
<widget class="QCheckBox" name="mRadiusFieldCheckBox">
233+
<property name="text">
234+
<string>Use radius from field</string>
235+
</property>
236+
</widget>
237+
</item>
238+
<item row="0" column="1" colspan="2">
239+
<widget class="QComboBox" name="mKernelShapeCombo"/>
240+
</item>
241+
<item row="3" column="1" colspan="2">
242+
<widget class="QLineEdit" name="mDecayLineEdit">
243+
<property name="enabled">
244+
<bool>false</bool>
245+
</property>
246+
<property name="text">
247+
<string>0.0</string>
248+
</property>
249+
</widget>
250+
</item>
251+
<item row="3" column="0">
252+
<widget class="QLabel" name="decayLabel">
253+
<property name="text">
254+
<string>Decay ratio</string>
255+
</property>
256+
</widget>
257+
</item>
258+
<item row="0" column="0">
259+
<widget class="QLabel" name="kernelShapeLabel">
260+
<property name="text">
261+
<string>Kernel shape</string>
262+
</property>
263+
</widget>
264+
</item>
265+
<item row="1" column="2">
266+
<widget class="QComboBox" name="mRadiusFieldUnitCombo">
267+
<property name="enabled">
268+
<bool>false</bool>
269+
</property>
270+
<item>
271+
<property name="text">
272+
<string>meters</string>
273+
</property>
274+
</item>
275+
<item>
276+
<property name="text">
277+
<string>map units</string>
278+
</property>
279+
</item>
280+
</widget>
281+
</item>
282+
<item row="4" column="1" colspan="2">
283+
<widget class="QComboBox" name="mOutputValuesComboBox"/>
284+
</item>
285+
<item row="4" column="0">
286+
<widget class="QLabel" name="label">
287+
<property name="text">
288+
<string>Output values</string>
289+
</property>
290+
</widget>
291+
</item>
292+
<item row="2" column="1" colspan="2">
293+
<widget class="QgsFieldComboBox" name="mWeightFieldCombo">
294+
<property name="enabled">
295+
<bool>false</bool>
296+
</property>
297+
</widget>
298+
</item>
299+
</layout>
300+
</item>
317301
</layout>
318302
</widget>
319303
</item>
@@ -411,22 +395,6 @@
411395
</hint>
412396
</hints>
413397
</connection>
414-
<connection>
415-
<sender>mWeightFieldCheckBox</sender>
416-
<signal>toggled(bool)</signal>
417-
<receiver>mWeightFieldCombo</receiver>
418-
<slot>setEnabled(bool)</slot>
419-
<hints>
420-
<hint type="sourcelabel">
421-
<x>109</x>
422-
<y>315</y>
423-
</hint>
424-
<hint type="destinationlabel">
425-
<x>408</x>
426-
<y>318</y>
427-
</hint>
428-
</hints>
429-
</connection>
430398
<connection>
431399
<sender>mRadiusFieldCheckBox</sender>
432400
<signal>toggled(bool)</signal>
@@ -507,5 +475,21 @@
507475
</hint>
508476
</hints>
509477
</connection>
478+
<connection>
479+
<sender>mWeightFieldCheckBox</sender>
480+
<signal>toggled(bool)</signal>
481+
<receiver>mWeightFieldCombo</receiver>
482+
<slot>setEnabled(bool)</slot>
483+
<hints>
484+
<hint type="sourcelabel">
485+
<x>109</x>
486+
<y>315</y>
487+
</hint>
488+
<hint type="destinationlabel">
489+
<x>408</x>
490+
<y>318</y>
491+
</hint>
492+
</hints>
493+
</connection>
510494
</connections>
511495
</ui>

0 commit comments

Comments
 (0)
Please sign in to comment.