@MicheleTobias @aimandel
QGIS Plugin Development
Is Not Scary
Lessons Learned from Literature Mapper
Michele Tobias, PhD & Alex Mandel, Phd
FOSS4G - Buenos Aires, Argentina - Sept. 27-Oct.2, 2021
@MicheleTobias @aimandel
Who are we?
Michele Tobias
Geospatial Data Specialist
University of California Davis’ DataLab
Mastermind behind Literature Mapper
Coding for text parsing
Really bad a Python
Frequent user of QGIS and R and SQL
Alex Mandel
Geospatial Engineer
Development Seed
Advises on feasibility
Coding for interface functions
Much better at Python
Literature Mapper is NOT a product of UC Davis or Development Seed.
@MicheleTobias @aimandel
What is Literature Mapper?
An experimental Python QGIS Plugin,
available in the plugin repository
Connects Zotero (an open source
citation manager) with QGIS
Allows users to georeference their
citations through QGIS
Store location information inside the
Zotero database to keep the spatial
and non-spatial data together
@MicheleTobias @aimandel
@MicheleTobias @aimandel
Literature Mapper’s Story
Academic journal articles are often about a specific location
Plants & Animals
Geology
Social Justice
History
… ALL of these happen in a location & location matters.
@MicheleTobias @aimandel
Literature Mapper’s Story
We might care about the spatial distribution of studies
BUT
There was no method for connecting location data to a citation manager
We identified a need that had no available solution.
@MicheleTobias @aimandel
The Building Process
1. Idea stage (a paper map
hand annotated in pencil)
2. Prototype
“proof of concept”
3. Code in the
QGIS Plugin repository
4. A tool that is steadily
gaining users
@MicheleTobias @aimandel
Preparation
@MicheleTobias @aimandel
What is the need/gap you want to fill?
Be specific about what your tool SHOULD do.
Be specific about what you tool WILL NOT do.
Scope creep is real. Ideas are cheap.
Keep a list of ideas to work on later. Ignore the ideas that aren’t your goal.
@MicheleTobias @aimandel
Do your research.
What tools/software/methods already exist?
Do they solve your problem?
If a tool already exists, does the world need another option?
Should you contribute to existing projects instead?
@MicheleTobias @aimandel
Pick a Name Carefully
It’s hard to change the name once your tool is in use
Consider a name that describes the tool’s function
Avoid names that are similar to other tools
Example: Literature Mapper vs. Journal Map - both developed independently
about the same time, have similar goals, but do slightly different things (and
yes, both teams talk now)
@MicheleTobias @aimandel
Make It Happen
@MicheleTobias @aimandel
Draw it!
What is the workflow?
What should the interface look like?
@MicheleTobias @aimandel
Level Up Your Skills
Plenty of FREE resources to
learn what you need:
● Python
● PyQGIS
● QGIS Plugin Development Workflow
● GitHub (or other version control system)
Specific to Literature Mapper:
● Zotero API
@MicheleTobias @aimandel
Don’t get stuck in the preparation phase
Learn the basics and move on.
You’ll learn more as you develop your plugin.
You don’t need to be good at Python to write useful code.
@MicheleTobias @aimandel
Start Small & Add Incrementally
Don’t try to code all the functions at once.
Start with a blank plugin.
Add a blank interface.
Add a button.
Make the button do something.
Keep going.
@MicheleTobias @aimandel
Tell People
@MicheleTobias @aimandel
Let people
see your code
Tell people what
you’re working on
Make it Public
@MicheleTobias @aimandel
Be Loud
Write Documentation
Post on social media
Publish blog posts
Meet with people developing
related tools
Talk at conferences
Write journal articles (for academics)
@MicheleTobias @aimandel
You can do it!
Any questions?
@MicheleTobias @aimandel
Resources
PyQGIS Developer Cookbook:
https://docs.qgis.org/3.16/en/docs/pyqgis_developer_cookbook/ (Especially section
16 “Developing Python Plugins”)
@MicheleTobias @aimandel
Abstract - for reference
This is the story of how one QGIS plugin came to be and the lessons we learned
along the way. The Literature Mapper QGIS Plugin was created to fill a need:
academic journal articles are often about a specific location (this is common in
fields such as ecology, archaeology, and history), but there was no method for
connecting location data to a citation manager. We built the tool we needed from
the idea stage (a paper map hand annotated in pencil), to prototype, to freely
available code in the QGIS Plugin repository, to a tool that is steadily gaining users.
In this talk, we will describe our experience developing the Literature Mapper QGIS
plugin – all the ups and downs – to explain the process and encourage more
people to try making their own plugin.

QGIS Plugin Development is Not Scary: Lessons Learned from Literature Mapper

  • 1.
    @MicheleTobias @aimandel QGIS PluginDevelopment Is Not Scary Lessons Learned from Literature Mapper Michele Tobias, PhD & Alex Mandel, Phd FOSS4G - Buenos Aires, Argentina - Sept. 27-Oct.2, 2021
  • 2.
    @MicheleTobias @aimandel Who arewe? Michele Tobias Geospatial Data Specialist University of California Davis’ DataLab Mastermind behind Literature Mapper Coding for text parsing Really bad a Python Frequent user of QGIS and R and SQL Alex Mandel Geospatial Engineer Development Seed Advises on feasibility Coding for interface functions Much better at Python Literature Mapper is NOT a product of UC Davis or Development Seed.
  • 3.
    @MicheleTobias @aimandel What isLiterature Mapper? An experimental Python QGIS Plugin, available in the plugin repository Connects Zotero (an open source citation manager) with QGIS Allows users to georeference their citations through QGIS Store location information inside the Zotero database to keep the spatial and non-spatial data together
  • 4.
  • 5.
    @MicheleTobias @aimandel Literature Mapper’sStory Academic journal articles are often about a specific location Plants & Animals Geology Social Justice History … ALL of these happen in a location & location matters.
  • 6.
    @MicheleTobias @aimandel Literature Mapper’sStory We might care about the spatial distribution of studies BUT There was no method for connecting location data to a citation manager We identified a need that had no available solution.
  • 7.
    @MicheleTobias @aimandel The BuildingProcess 1. Idea stage (a paper map hand annotated in pencil) 2. Prototype “proof of concept” 3. Code in the QGIS Plugin repository 4. A tool that is steadily gaining users
  • 8.
  • 9.
    @MicheleTobias @aimandel What isthe need/gap you want to fill? Be specific about what your tool SHOULD do. Be specific about what you tool WILL NOT do. Scope creep is real. Ideas are cheap. Keep a list of ideas to work on later. Ignore the ideas that aren’t your goal.
  • 10.
    @MicheleTobias @aimandel Do yourresearch. What tools/software/methods already exist? Do they solve your problem? If a tool already exists, does the world need another option? Should you contribute to existing projects instead?
  • 11.
    @MicheleTobias @aimandel Pick aName Carefully It’s hard to change the name once your tool is in use Consider a name that describes the tool’s function Avoid names that are similar to other tools Example: Literature Mapper vs. Journal Map - both developed independently about the same time, have similar goals, but do slightly different things (and yes, both teams talk now)
  • 12.
  • 13.
    @MicheleTobias @aimandel Draw it! Whatis the workflow? What should the interface look like?
  • 14.
    @MicheleTobias @aimandel Level UpYour Skills Plenty of FREE resources to learn what you need: ● Python ● PyQGIS ● QGIS Plugin Development Workflow ● GitHub (or other version control system) Specific to Literature Mapper: ● Zotero API
  • 15.
    @MicheleTobias @aimandel Don’t getstuck in the preparation phase Learn the basics and move on. You’ll learn more as you develop your plugin. You don’t need to be good at Python to write useful code.
  • 16.
    @MicheleTobias @aimandel Start Small& Add Incrementally Don’t try to code all the functions at once. Start with a blank plugin. Add a blank interface. Add a button. Make the button do something. Keep going.
  • 17.
  • 18.
    @MicheleTobias @aimandel Let people seeyour code Tell people what you’re working on Make it Public
  • 19.
    @MicheleTobias @aimandel Be Loud WriteDocumentation Post on social media Publish blog posts Meet with people developing related tools Talk at conferences Write journal articles (for academics)
  • 20.
    @MicheleTobias @aimandel You cando it! Any questions?
  • 21.
    @MicheleTobias @aimandel Resources PyQGIS DeveloperCookbook: https://docs.qgis.org/3.16/en/docs/pyqgis_developer_cookbook/ (Especially section 16 “Developing Python Plugins”)
  • 22.
    @MicheleTobias @aimandel Abstract -for reference This is the story of how one QGIS plugin came to be and the lessons we learned along the way. The Literature Mapper QGIS Plugin was created to fill a need: academic journal articles are often about a specific location (this is common in fields such as ecology, archaeology, and history), but there was no method for connecting location data to a citation manager. We built the tool we needed from the idea stage (a paper map hand annotated in pencil), to prototype, to freely available code in the QGIS Plugin repository, to a tool that is steadily gaining users. In this talk, we will describe our experience developing the Literature Mapper QGIS plugin – all the ups and downs – to explain the process and encourage more people to try making their own plugin.