Tag: plugins

QGIS Add to Felt Plugin – Phase 2

We have been continuing our work with the Flagship sponsor of QGISFelt to develop their QGIS Plugin – Add to Felt  that makes it even easier to share your maps and data on the web.

What is the ‘Add to Felt’ QGIS Plugin?

The ‘Add to Felt’ QGIS Plugin is a powerful tool that empowers users to export their QGIS projects and layers directly to a Felt web map. This update introduces two fantastic features:

  1. Single Layer Sharing: You can now share a single layer from your QGIS project to a Felt map. This means you have greater control over which specific data layers to share, allowing you to tailor your map precisely to your audience’s needs.
  2. Map Selection: With the updated plugin, you can choose which map on Felt to add your layer to – a new map, or an ongoing project. This flexibility simplifies your workflow and ensures that your data ends up in the right place.

Businesses that rely on QGIS love how these new features provide a seamless way to view and share results, ultimately allowing them to move more quickly and stay in sync:

“Felt helps us keep each other updated on what we’ve done, what we’ve modeled, how things are progressing.” – ICON Engineering

Why is this Update Important?

Web maps are invaluable tools for sharing data with a wider audience, be it colleagues, clients, or the public. They provide creators with the ability to control data visibility, display options, and audience access, all within an easily shareable digital format. However, creating web maps can be an arduous and complex task.

Here’s where the ‘Add to Felt’ QGIS Plugin update comes to the rescue:

1. Streamlining the Process: Creating web maps traditionally involves website development, data hosting, and map application development—tasks that require a diverse skill set. This complexity can be a significant barrier, especially for smaller operations with limited resources or budget constraints.

2. Felt Simplifies Web Mapping: Felt makes it effortless to create web maps, and share them as easily as you would a Google Doc or Sheet. Simply drag and drop your data, customize the symbology to your liking, and share the map with a link or by inviting collaborators. No need to send large data files or answer questions about the map’s data sources.

3. Integration with QGIS: Now, the ‘Add to Felt’ QGIS Plugin bridges the gap between QGIS and Felt. It seamlessly imports your QGIS data into Felt, eliminating the need for manual data transfers and reducing the complexity of web map creation.

In essence, the ‘Add to Felt’ QGIS Plugin update simplifies the process of sharing and collaborating on web maps. It empowers users to harness the full potential of web-based mapping, making it accessible to everyone, regardless of their technical expertise. The update makes it even easier to share progress updates or model re-run outputs without creating a new map, or sharing a new map link.

So, if you’re a QGIS user looking to enhance your map-sharing capabilities and streamline your workflow, make sure to take advantage of this fantastic update. Say goodbye to the complexities of web map creation and hello to effortless, data-rich web maps with Felt and the ‘Add to Felt’ QGIS Plugin.

How to install and upgrade

  • Open QGIS on your computer. You must have version 3.22 or later installed.
  • In the plugins tab, select Manage and Install Plugins.
  • Search for the ‘Add to Felt’ plugin, select and click Install Plugin.
  • Close the Plugins dialog. The Felt plugin toolbar will appear in your toolbar for use.
  • Sign into Felt and begin sharing your maps to the web.

If you want more features in this plugin, let us know or you’re interested in exploring how a QGIS plugin can make your service easily accessible to the millions of daily QGIS users, contact us to discuss how we can help!

Learn More

Soar.Earth Digital Atlas QGIS Plugin

Soar banner

Growing up, I would spend hours lost in National Geographic maps. The feeling of discovering new regions and new ways to view the world was addictive! It’s this same feeling of discovery and exploration which has made me super excited about Soar’s Digital Atlas. Soar is the brainchild of Australian, Amir Farhand, and is fuelled by the talents of staff located across the globe to build a comprehensive digital atlas of the world’s maps and images. Soar has been designed to be an easy to use, expansive collection of diverse maps from all over the Earth. A great aspect of Soar is that it has implemented Strong Community Guidelines and moderation to ensure the maps are fit for purpose.

Recently, North Road collaborated with Soar to help facilitate their digital atlas goals by creating a QGIS plugin for Soar. The Soar plugin allows QGIS users to directly:

  • Export their QGIS maps and images straight to Soar
  • Browse and load maps from the entire Soar public catalogue into their QGIS projects

There’s lots of extra tweaks we’ve added to help make the plugin user friendly, whilst offering tons of functionality that power users want. For instance, users can:

  • Filter Soar maps by their current project extent and/or by category
  • Export raw or rendered raster data directly to Soar via a Processing tool
  • Batch upload multiple maps to Soar
  • Incorporate Soar map publishing into a Processing model or Python based workflow

Soar will be presenting their new plugin at the QGIS Open Day in August so check out the details here and tune in at 2300 AEST or 1300 HR UTC. You can follow along via either YouTube or Jitsi.

Browsing Soar maps from QGIS

One of the main goals of the Soar QGIS plugin was to make it very easy to find new datasets and add them to your QGIS projects. There’s two ways users can explore the Soar catalog from QGIS:

You can open the Soar Browser Panel via the Soar toolbar button  Soar browser . This opens a floating catalog browser panel which allows you to interactively search Soar’s content while working on your map.

Soar browser panel

Alternatively, you can also access the Soar catalog and maps from the standard QGIS Data Source Manager dialog. Just open the “Soar” tab and search away!

When you’ve found an interesting map, hit the “Add to Map” button and the map will be added as a new layer into your current project. After the layer is loaded you can freely modify the layer’s style (such as the opacity, colorization, contrast etc) just like any other raster dataset using the standard QGIS Layer Style controls.

Sharing your maps

Before you can share your maps on Soar, you’ll need to first sign up for a free Soar account.

We’ve designed the Soar plugin with two specific use cases in mind for sharing maps. The first use case is when you want to share an entire map (i.e. QGIS project) to Soar. This will publish all the visible content from your map onto Soar, including all the custom styling, labeling, decorations and other content you’ve carefully designed. To do this, just select the Project menu, Import/Export -> Export map to Soar option.

Upload via Project to Soar

You’ll have a chance to enter all the metadata and descriptive text explaining your map, and then the map will be rendered and uploaded directly to Soar.

Soar Metadata

All content on the Soar atlas is moderated, so your shared maps get added to the moderation queue ready for review by the Soar team. (You’ll be notified as soon as the review is complete and your map is publicly available).

Alternatively, you might have a specific raster layer which you want to publish on Soar. For instance, you’ve completed some flood modelling or vegetation analysis and want to share the outcome widely. To do this, you can use the “Publish dataset to Soar” tool available from the QGIS Processing toolbox:

Upload product to Soar via processing tools

Just pick the raster layer you want to upload, enter the metadata information, and let the plugin do the rest! Since this tool is made available through QGIS’ Processing framework, it also allows you to run it as a batch process (eg uploading a whole folder of raster data to Soar), or as a step in your QGIS Graphical Models!

Some helpful hints

All maps uploaded to Soar require the following information:

  • Map Title
  • Description
  • Tags
  • Categories
  • Permission to publish

This helps other users to find your maps with ease, and also gives the Soar moderation team the information required for their review process.

We’ve a few other tips to keep in mind to successfully share your maps on Soar:

  • The Soar catalog currently works with raster image formats including GeoTIFF / ECW / JP2 / JPEG / PNG
  • All data uploaded to Soar must be in the WGS84 Pseudo-Mercator (EPSG: 3857) projection
  • Check the size of your data before sharing it, as a large size dataset may take a long time to upload

So there you have it! So simple to start building up your contribution to Soar’s Digital Atlas. Those who might find this useful to upload maps include:

  • Community groups
  • Hobbyists
  • Building a cartographic/geospatial portfolio
  • Education/research
  • Contributing to world events (some of the biggest news agencies already use this service i.e. BBC)

You can find out more about the QGIS Soar plugin at the QGIS Open Day on August 23rd, 2023 at 2300 HR AEST or 1300 HR UTC. Check here for more information or to watch back after.

If you’re interested in exploring how a QGIS plugin can make your service easily accessible to the millions of daily QGIS users, contact us to discuss how we can help!

Learn More

‘Add to Felt’ QGIS Plugin

The gift economy of Open Source is community driven and filled by folks with ideas that just go for it!

We at North Road are blessed that we get to join these creatives on their journey in order to get their products to you. Recently, the first QGIS flagship sponsor, Felt, engaged us to further strengthen their support for the up to 600,000 daily QGIS users to integrate their workflows between QGIS and Felt.

The result is the “Add to Felt” QGIS Plugin, which makes it super-simple to publish your QGIS maps to the Felt platform.

To get started, install the Add to Felt Plugin from the QGIS Plugin manager.

If you don’t have a free Felt account, you’ll need to sign up for one online (or from the Add to Felt plugin itself once you have installed it).

Within QGIS, users can easily publish their maps and layers to Felt. You can either:

  • Publish a single layer by right-clicking the layer and selecting “Share Layer to Felt” from the Export sub-menu
  • Publish your whole QGIS project/map by selecting the Project Menu, Export, “Add to Felt” action

Whilst Felt is loading up your map, you can continue working and it will let you know once your map is ready to open on Felt and share with others.

We are happy to let you know that the collaboration does not stop there! As with our SLYR tool, there is ongoing development as the requirements of the community and technology grow.  So install the Add to Felt Plugin via the QGIS Plugin manager, and let us know where you want it to go via the Add to Felt GitHub page.

Read more about it here:

Learn More

Hepler modules for development of QGIS plugins

There are two things I have coded, re-coded and re-re-coded through all my plugins: the management of the settings and the management of combo boxes associated to layers and their fields.

I have decided to write two generic python modules to solve these tasks to avoid reinventing the wheel every time.

The first one is called QGIS setting manager.
This module allows you to:

  • manage different types of settings (bool, string, color, integer, double, stringlist)
  • read and write settings in QGIS application or in the QGIS project
  • automatically set widgets from corresponding setting
  • automatically write settings from widgets of a dialog

This means that the class of a dialog dedicated to editing the plugins settings can be reduced to just a few lines.
You just have to name widgets according to settings and the module automatically detect the widgets, sets/reads the value from the widget and read/write the settings accordingly.

A setting class would look like this

from qgissettingmanager import *

class MySettings(SettingManager):
    def __init__(self):
        SettingManager.__init__(self, myPluginName)
        self.addSetting("myVariable", "bool", "global", True)

reading and write settings are performed by doing

self.settings = MySettings()
self.settings.setValue("myVariable", False)
myVariable = self.settings.value("myVariable")

and a dialog looks like this

class MyDialog(QDialog, Ui_myDialog, SettingDialog):
    def __init__(self):
        QDialog.__init__(self)
        self.setupUi(self)
        self.settings = MySettings()
        SettingDialog.__init__(self, self.settings)

You can find a complete howto here and look at the code on github.

The second module is called QGIS combo manager. This module autmatically manages combo box widgets for layers, fields of vector layers and bands of raster layers.
You can associate a field combo to a layer combo: as soon as the layer has been modified, the fields are updated to the current layer.

Associating a combo box to layers and another one to its fields would look like this:

from qgiscombomanager import *

self.layerComboManager = VectorLayerCombo(self.layerComboWidget)
self.myFieldComboManager = FieldCombo(self.myFieldComboManager, self.layerComboManager)

You can find a complete howto here and look at the code on github.

Learn More

Identify feature on map

A very awaited feature is now available in the master version of QGIS: identifying features in the map!

You can define the class of the map tool as follows:

from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from qgis.gui import *

class IdentifyGeometry(QgsMapToolIdentify):
 def __init__(self, canvas):
  self.canvas = canvas
  QgsMapToolIdentify.__init__(self, canvas)

 def canvasReleaseEvent(self, mouseEvent):
  results = self.identify(mouseEvent.x(),mouseEvent.y(), self.TopDownStopAtFirst, self.VectorLayer)
  if len(results) > 0:
   self.emit( SIGNAL( "geomIdentified" ), results[0].mLayer, results[0].mFeature)

This class will try to identify a feature of any visible vector layer and returning the first found feature (using layer order). Then, it will emit the signal with the layer and the feature identified.
To customize this, you can use the identify method with different arguments:

  • type of layer
  • type of identification (current layer, top-down, top-down stop at first or the QGIS setting)
  • list of layers

There is two ways of calling the identify methods:

  • identify (x, y, layerList=[], IdentifyMode mode=self.DefaultQgsSetting)
  • identify (x, y, identifyMode, layerType=AllLayers)

Identify mode and layer types are defined here. Mainly the options can be:

  • Identify mode: self.DefaultQgsSetting, self.ActiveLayer, self.TopDownStopAtFirst, self.TopDownAll
  • Layer type: self.AllLayers, self.VectorLayer, self.RasterLayer

Both methods return a structure IdentifyResult defined in the API. Mainly, it contains:

  • the feature (mFeature) if the identified layer is a vector layer
  • the corresponding layer (mLayer)
  • the derived attributes (mDerivedAttributes): the raster value for raster layers

In your plugin main code, you can define a toolbox button to enable your map tool:

class myPlugin():
 def initGui(self):
  self.mapToolAction = QAction(QIcon(":/plugins/myPlugin/icons/myIcon.png"), "My Plugin", self.iface.mainWindow())
  self.mapToolAction.setCheckable(True)
  QObject.connect(self.mapToolAction, SIGNAL("triggered()"), self.mapToolInit)
  self.iface.addToolBarIcon(self.mapToolAction)
  self.iface.addPluginToMenu("&My Plugin", self.mapToolAction)

 def mapToolInit(self):
  canvas = self.iface.mapCanvas()
  if self.mapToolAction.isChecked() is False:
   canvas.unsetMapTool(self.mapTool)
   return
  self.mapToolAction.setChecked( True )
  self.mapTool = IdentifyGeometry(canvas)
  QObject.connect(self.mapTool , SIGNAL("geomIdentified") , self.doSometing )
  canvas.setMapTool(self.mapTool)
  QObject.connect( canvas, SIGNAL( "mapToolSet(QgsMapTool *)" ), self.mapToolChanged)</em>

 def doSomething(self, layer, feature):
  # do something

If you want your plugin to be back compatible with version before 1.9, you can select the features at the clicked point using a given tolerance and using the current layer:

try:
 from qgis.gui import QgsMapToolIdentify
except:
 from qgis.gui import QgsMapTool as QgsMapToolIdentify

class IdentifyGeometry(QgsMapToolIdentify):
 def __init__(self, canvas):
  self.canvas = canvas
  QgsMapToolIdentify.__init__(self, canvas)

 def canvasReleaseEvent(self, mouseEvent):
  try:
  results = self.identify(mouseEvent.x(),mouseEvent.y(), self.TopDownStopAtFirst, self.VectorLayer)
  if len(results) > 0:
   self.emit( SIGNAL( "geomIdentified" ), results[0].mLayer, results[0].mFeature)
  except: # qgis <1.9
   point = self.toMapCoordinates( mouseEvent.pos() )
   layer = self.canvas.currentLayer()
   if layer == None:
    return
   if layer.type() != QgsMapLayer.VectorLayer:
    return
   point = self.canvas.mapRenderer().mapToLayerCoordinates(layer, point)
   pixTolerance = 6
   mapTolerance = pixTolerance * self.canvas.mapUnitsPerPixel()
   rect = QgsRectangle(point.x()-mapTolerance,point.y()-mapTolerance,point.x()+mapTolerance,point.y()+mapTolerance)
   provider = layer.dataProvider()
   provider.select([], rect, True, True)
   subset = []
   f = QgsFeature()
   while (provider.nextFeature(f)):
    subset.append(f)
    if len(subset) == 0:
     return
    if len(subset) > 1:
     idx = QgsSpatialIndex()
    for f in subset:
     idx.insertFeature(f)
     nearest = idx.nearestNeighbor( point, 1 )
     layer.featureAtId(nearest[0],f, True, False)
    self.emit( SIGNAL( "geomIdentified" ), layer, f)

Note, that this last code (for version <1.9) does not consider scale dependent visibility and can therefore return a feature which is not visible in the map!

Learn More