Skip to content

Commit

Permalink
Fix to allow qgis_process to work
Browse files Browse the repository at this point in the history
  • Loading branch information
hamiltoncj committed May 4, 2023
1 parent e7cfdd1 commit 65b944d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PLUGINNAME = densityanalysis
PLUGINS = "$(HOME)"/AppData/Roaming/QGIS/QGIS3/profiles/default/python/plugins/$(PLUGINNAME)
PY_FILES = __init__.py densityanalysis.py densitygrid.py geohash.py geohashdensity.py geohashdensitymap.py geohashmultidensity.py geohashmultidensitymap.py graduatedstyle.py h3density.py h3densitymap.py h3grid.py h3multidensity.py h3multidensitymap.py heatmap.py polygondensity.py provider.py randomstyle.py rasterstyle.py settings.py style2layers.py styledkde.py styledpolygondensity.py utils.py
PY_FILES = __init__.py densityanalysis.py densityanalysisprocessing.py densitygrid.py geohash.py geohashdensity.py geohashdensitymap.py geohashmultidensity.py geohashmultidensitymap.py graduatedstyle.py h3density.py h3densitymap.py h3grid.py h3multidensity.py h3multidensitymap.py heatmap.py polygondensity.py provider.py randomstyle.py rasterstyle.py settings.py style2layers.py styledkde.py styledpolygondensity.py utils.py
EXTRAS = metadata.txt icon.png

deploy:
Expand Down
9 changes: 7 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
def classFactory(iface):
from .densityanalysis import DensityAnalysis
return DensityAnalysis(iface)
if iface:
from .densityanalysis import DensityAnalysis
return DensityAnalysis(iface)
else:
# This is used when the plugin is loaded from the command line command qgis_process
from .densityanalysisprocessing import DensityAnalysis
return DensityAnalysis()
22 changes: 22 additions & 0 deletions densityanalysisprocessing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-

from qgis.core import QgsApplication
from .provider import DensityAnalysisProvider

import os

class DensityAnalysis(object):
def __init__(self):
self.provider = None

def initProcessing(self):
self.provider = DensityAnalysisProvider()
QgsApplication.processingRegistry().addProvider(self.provider)

def initGui(self):
self.initProcessing()

def unload(self):
QgsApplication.processingRegistry().removeProvider(self.provider)


3 changes: 2 additions & 1 deletion metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name=Density Analysis
qgisMinimumVersion=3.12
description=This plugin automates the creation of density heatmaps in QGIS with a heatmap explorer to examine the areas of greatest concentrations. It includes H3, geohash, and polygon density map algorithms along with several styling algorithms. It can paste a style onto all selected layers.
version=2023.3.13
version=2023.5.4
author=C Hamilton
[email protected]
about=This plugin adds six new density heatmap algorithms to QGIS including geohash, H3, and polygon density maps. It adds a vector density heatmap explorer to examine the areas of greatest concentrations. It wraps the QGIS Heatmap algorithm into a new version that automatically styles the layer and allows the user to specify the cell size in various units of measure and not just the units of the layer's CRS. It provides an algorithm to create a raster density map of polygons. It has three processing algorithms to create a gradient style, random style, and raster pseudocolor style so that they can be used in QGIS models. Another tool allows a copied style or a .qml file to be pasted onto all selected layers. The plugin can be extended by installing the H3 library for blazing fast hexagon density maps.
Expand All @@ -16,6 +16,7 @@ hasProcessingProvider=yes
experimental=False
deprecated=False
changelog=
2023.5.4 - Fix to allow qgis_process to function correctly.
2023.3.13 - Replace QSettings with QgsSettings
2023.2.2 - Added multi layer input to geohash and H3 algorithms and rearranged algorithms.
2022.12.19 - Added the ability to set the color and line width of density hotspot explorer marker.
Expand Down

0 comments on commit 65b944d

Please sign in to comment.