Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heatmap C++ Plugin #82

Closed
wants to merge 7 commits into from
Closed

Heatmap C++ Plugin #82

wants to merge 7 commits into from

Conversation

tecoholic
Copy link
Contributor

Hello,

I have written the Heatmap plugin in C++. The plugin presently takes in a point layer as input, and the buffer pixel distance and decay ratio, and produces a heatmap raster in the ASCII grid file format.

I hope this makes a good addition in to QGIS plugins.

@tecoholic
Copy link
Contributor Author

With regards to the changes in legend.cpp, I didn't manually edit it. I think it must be from upstream merging.

@timlinux
Copy link
Member

timlinux commented Jan 9, 2012

Hi

Thanks, I am evaluating your plugin.

Regards

Tim

@timlinux
Copy link
Member

timlinux commented Jan 9, 2012

Hi

I want to thank you for your patch. First the bad news: I don't think the plugin is yet suitable for inclusion into QGIS.

However I would like to make some suggestions to enable it to be added.

  • Output should be generated using gdal tif rather than ascii grid. Ascii files do not scale well to large datasets. Your current implementation tries to allocate the entire raster in memory which leads to crashes for large datasets.

  • The user interface should provide the user with more information (e.g. context help) to explain what the plugin will do and what it's parameters will do, and what its outputs mean.

  • Under OSX it failed to compile initially - you need to add this include line to the CMakeLists.txt:

    30 INCLUDE_DIRECTORIES(
    31 ${GEOS_INCLUDE_DIR}

  • The output seems to have anomolies on the 4 axes surrounding each point - see http://www.imagebanana.com/view/hv363cto/heat.jpg

  • Take note of our coding conventions (see CODING at the top of the source tree), in particular take care of indentation (2 spaces) and avoid using magic numbers e.g. if( theLayer->geometryType() != 0 ) should replace 0 with the appropriate enumerated type.

  • The plugin should appear in the Raster menu. (on osx it appears under plugin menu for me).

  • I would prefer to see the analytical logic implemented in the analysis library (with a nice high level api) and then the user interface simply providing a front end to that, though this is not mandatory I guess.

  • I got the following crash under OSX

I am sorry it is such a long issue list, but I think with a little work following my pointers above, your plugin could be made ready for inclusion into QGIS and I will be happy to re-evaluate it when you are ready.

Best regards

Tim

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   QtCore                          0x0000000102e61e51 QString::operator==(QString const&) const + 7
1   libheatmapplugin.so             0x0000000118f24412 HeatmapGui::on_mButtonBox_accepted() + 686 (heatmapgui.cpp:131)
2   libheatmapplugin.so             0x0000000118f27366 HeatmapGui::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 304 (moc_heatmapgui.cxx:60)
3   libheatmapplugin.so             0x0000000118f273d3 HeatmapGui::qt_metacall(QMetaObject::Call, int, void**) + 89 (moc_heatmapgui.cxx:101)
4   QtCore                          0x0000000102f21ed5 QMetaObject::activate(QObject*, QMetaObject const*, int, void**) + 1781
5   QtGui                           0x000000010352368c QDialogButtonBoxPrivate::_q_handleButtonClicked() + 200
6   QtGui                           0x0000000103523334 QDialogButtonBox::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 218
7   QtCore                          0x0000000102f21fb1 QMetaObject::activate(QObject*, QMetaObject const*, int, void**) + 2001
8   QtGui                           0x000000010378a7c5 QAbstractButton::clicked(bool) + 49
9   QtGui                           0x00000001034f77ee QAbstractButtonPrivate::emitClicked() + 50
10  QtGui                           0x00000001034f850a QAbstractButtonPrivate::click() + 230
11  QtGui                           0x00000001034f86cc QAbstractButton::mouseReleaseEvent(QMouseEvent*) + 106
12  QtGui                           0x00000001031e438b QWidget::event(QEvent*) + 245
13  QtGui                           0x00000001034f77b6 QAbstractButton::event(QEvent*) + 220
14  QtGui                           0x00000001035876c2 QPushButton::event(QEvent*) + 170
15  QtGui                           0x0000000103195be8 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 304
16  QtGui                           0x0000000103196638 QApplication::notify(QObject*, QEvent*) + 2602
17  org.qgis.qgis_core              0x0000000101e3caf4 QgsApplication::notify(QObject*, QEvent*) + 120 (qgsapplication.cpp:188)
18  QtCore                          0x0000000102f0c982 QCoreApplication::notifyInternal(QObject*, QEvent*) + 104
19  QtGui                           0x000000010319e2ee QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer&, bool) + 432
20  QtGui                           0x000000010314cfa8 qt_mac_handleMouseEvent(NSEvent*, QEvent::Type, Qt::MouseButton, QWidget*) + 904
21  com.apple.AppKit                0x00007fff8743f431 -[NSWindow sendEvent:] + 5547
22  QtGui                           0x000000010313d32f -[QCocoaPanel sendEvent:] + 111
23  com.apple.AppKit                0x00007fff87374afa -[NSApplication sendEvent:] + 4719
24  QtGui                           0x0000000103148092 -[QNSApplication sendEvent:] + 82
25  com.apple.AppKit                0x00007fff8730b6de -[NSApplication run] + 474
26  QtGui                           0x00000001031512a0 QEventDispatcherMac::processEvents(QFlags) + 840
27  QtCore                          0x0000000102f09f08 QEventLoop::exec(QFlags) + 394
28  QtCore                          0x0000000102f0d0d3 QCoreApplication::exec() + 175
29  org.qgis.qgis                   0x0000000100013259 main + 10340 (main.cpp:759)
30  org.qgis.qgis                   0x00000001000104f0 start + 52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants